WARNING: suspicious RCU usage in nf_reinject

23 views
Skip to first unread message

syzbot

unread,
Mar 2, 2020, 1:20:14 AM3/2/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 78d697fc Linux 4.14.172
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16458331e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=31ad682bcda9b93f
dashboard link: https://syzkaller.appspot.com/bug?extid=f077f84b754e74484909
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14fcf2c3e00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+f077f8...@syzkaller.appspotmail.com

ip_tables: iptables: counters copy to user failed while replacing table
IPv6: ADDRCONF(NETDEV_UP): veth0_to_batadv: link is not ready
device veth1_vlan entered promiscuous mode
IPv6: ADDRCONF(NETDEV_UP): macvlan0: link is not ready
=============================
WARNING: suspicious RCU usage
IPv6: ADDRCONF(NETDEV_UP): veth1_to_batadv: link is not ready
4.14.172-syzkaller #0 Not tainted
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
-----------------------------
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
net/netfilter/nf_queue.c:227 suspicious rcu_dereference_check() usage!

other info that might help us debug this:


rcu_scheduler_active = 2, debug_locks = 1
2 locks held by ksoftirqd/1/17:
#0: (rcu_callback){....}, at: [<ffffffff814be896>] __rcu_reclaim kernel/rcu/rcu.h:185 [inline]
#0: (rcu_callback){....}, at: [<ffffffff814be896>] rcu_do_batch kernel/rcu/tree.c:2699 [inline]
#0: (rcu_callback){....}, at: [<ffffffff814be896>] invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
#0: (rcu_callback){....}, at: [<ffffffff814be896>] __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
#0: (rcu_callback){....}, at: [<ffffffff814be896>] rcu_process_callbacks+0x866/0x1190 kernel/rcu/tree.c:2946
#1: (&(&inst->lock)->rlock){+.-.}, at: [<ffffffff851f160f>] spin_lock_bh include/linux/spinlock.h:322 [inline]
#1: (&(&inst->lock)->rlock){+.-.}, at: [<ffffffff851f160f>] nfqnl_flush+0x2f/0x2a0 net/netfilter/nfnetlink_queue.c:232

stack backtrace:
CPU: 1 PID: 17 Comm: ksoftirqd/1 Not tainted 4.14.172-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x13e/0x194 lib/dump_stack.c:58
nf_reinject+0x51c/0x6d0 net/netfilter/nf_queue.c:227
nfqnl_flush+0x1ab/0x2a0 net/netfilter/nfnetlink_queue.c:237
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
instance_destroy_rcu+0x19/0x30 net/netfilter/nfnetlink_queue.c:171
__rcu_reclaim kernel/rcu/rcu.h:195 [inline]
rcu_do_batch kernel/rcu/tree.c:2699 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
rcu_process_callbacks+0x792/0x1190 kernel/rcu/tree.c:2946
__do_softirq+0x254/0x9bf kernel/softirq.c:288
run_ksoftirqd kernel/softirq.c:670 [inline]
run_ksoftirqd+0x87/0x1a0 kernel/softirq.c:662
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
smpboot_thread_fn+0x5c1/0x920 kernel/smpboot.c:164
kthread+0x30d/0x420 kernel/kthread.c:232
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
IPv6: ADDRCONF(NETDEV_UP): batadv_slave_0: link is not ready
batman_adv: batadv0: Interface activated: batadv_slave_0
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready
batman_adv: batadv0: Interface activated: batadv_slave_1
IPv6: ADDRCONF(NETDEV_UP): macvlan1: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): macvlan1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): macsec0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): macvlan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): macvlan1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
ip_tables: iptables: counters copy to user failed while replacing table
IPv6: ADDRCONF(NETDEV_UP): veth0_macvtap: link is not ready
IPv6: ADDRCONF(NETDEV_UP): veth0_macvtap: link is not ready
IPv6: ADDRCONF(NETDEV_UP): veth1_macvtap: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_macvtap: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0_macvtap: link becomes ready
ip_tables: iptables: counters copy to user failed while replacing table
IPv6: ADDRCONF(NETDEV_UP): veth1_macvtap: link is not ready
device veth0_macvtap entered promiscuous mode
IPv6: ADDRCONF(NETDEV_UP): macvtap0: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): macvtap0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_macvtap: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0_macvtap: link becomes ready
device veth0_macvtap entered promiscuous mode
IPv6: ADDRCONF(NETDEV_UP): macvtap0: link is not ready
device veth1_macvtap entered promiscuous mode
IPv6: ADDRCONF(NETDEV_UP): macsec0: link is not ready
ip_tables: iptables: counters copy to user failed while replacing table
IPv6: ADDRCONF(NETDEV_UP): veth0_to_batadv: link is not ready
device veth1_macvtap entered promiscuous mode
IPv6: ADDRCONF(NETDEV_UP): macsec0: link is not ready
IPv6: ADDRCONF(NETDEV_UP): veth1_to_batadv: link is not ready
IPv6: ADDRCONF(NETDEV_UP): veth0_to_batadv: link is not ready
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
IPv6: ADDRCONF(NETDEV_UP): batadv_slave_0: link is not ready
batman_adv: batadv0: Interface activated: batadv_slave_0
ip_tables: iptables: counters copy to user failed while replacing table
IPv6: ADDRCONF(NETDEV_UP): veth1_to_batadv: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): macsec0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): macvtap0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): macsec0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready
batman_adv: batadv0: Interface activated: batadv_slave_1
IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
IPv6: ADDRCONF(NETDEV_UP): batadv_slave_0: link is not ready
batman_adv: batadv0: Interface activated: batadv_slave_0
ip_tables: iptables: counters copy to user failed while replacing table
IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready
batman_adv: batadv0: Interface activated: batadv_slave_1
ip_tables: iptables: counters copy to user failed while replacing table
IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
net_ratelimit: 186 callbacks suppressed
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
net_ratelimit: 367 callbacks suppressed
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Sep 22, 2020, 11:45:19 AM9/22/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: cbfa1702 Linux 4.14.198
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13753365900000
kernel config: https://syzkaller.appspot.com/x/.config?x=3990958d85b55e59
dashboard link: https://syzkaller.appspot.com/bug?extid=f077f84b754e74484909
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=177a89ab900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1753f481900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f077f8...@syzkaller.appspotmail.com

ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
=============================
WARNING: suspicious RCU usage
4.14.198-syzkaller #0 Not tainted
-----------------------------
net/netfilter/nf_queue.c:227 suspicious rcu_dereference_check() usage!

other info that might help us debug this:


rcu_scheduler_active = 2, debug_locks = 1
4 locks held by syz-executor874/6355:
#0: (&xt[i].mutex){+.+.}, at: [<ffffffff85418e78>] xt_find_table_lock+0x38/0x3d0 net/netfilter/x_tables.c:1092
#1: (console_lock){+.+.}, at: [<ffffffff814a45f8>] vprintk_func+0x58/0x152 kernel/printk/printk_safe.c:401
#2: (rcu_callback){....}, at: [<ffffffff814d023e>] __rcu_reclaim kernel/rcu/rcu.h:185 [inline]
#2: (rcu_callback){....}, at: [<ffffffff814d023e>] rcu_do_batch kernel/rcu/tree.c:2699 [inline]
#2: (rcu_callback){....}, at: [<ffffffff814d023e>] invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
#2: (rcu_callback){....}, at: [<ffffffff814d023e>] __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
#2: (rcu_callback){....}, at: [<ffffffff814d023e>] rcu_process_callbacks+0x84e/0x1180 kernel/rcu/tree.c:2946
#3: (&(&inst->lock)->rlock){+.-.}, at: [<ffffffff8534c3ff>] spin_lock_bh include/linux/spinlock.h:322 [inline]
#3: (&(&inst->lock)->rlock){+.-.}, at: [<ffffffff8534c3ff>] nfqnl_flush+0x2f/0x2a0 net/netfilter/nfnetlink_queue.c:232

stack backtrace:
CPU: 0 PID: 6355 Comm: syz-executor874 Not tainted 4.14.198-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x283 lib/dump_stack.c:58
nf_reinject+0x56e/0x700 net/netfilter/nf_queue.c:227
nfqnl_flush+0x1ab/0x2a0 net/netfilter/nfnetlink_queue.c:237
instance_destroy_rcu+0x19/0x30 net/netfilter/nfnetlink_queue.c:171
__rcu_reclaim kernel/rcu/rcu.h:195 [inline]
rcu_do_batch kernel/rcu/tree.c:2699 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
rcu_process_callbacks+0x780/0x1180 kernel/rcu/tree.c:2946
__do_softirq+0x254/0xa1d kernel/softirq.c:288
invoke_softirq kernel/softirq.c:368 [inline]
irq_exit+0x193/0x240 kernel/softirq.c:409
exiting_irq arch/x86/include/asm/apic.h:648 [inline]
smp_apic_timer_interrupt+0x141/0x5e0 arch/x86/kernel/apic/apic.c:1102
apic_timer_interrupt+0x93/0xa0 arch/x86/entry/entry_64.S:793
</IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:779 [inline]
RIP: 0010:console_unlock+0xbeb/0xf20 kernel/printk/printk.c:2405
RSP: 0018:ffff8880987e7a90 EFLAGS: 00000297 ORIG_RAX: ffffffffffffff10
RAX: ffff888097edc500 RBX: 0000000000000200 RCX: 1ffff11012fdb9ba
RDX: 0000000000000000 RSI: ffff888097edcdb0 RDI: 0000000000000297
RBP: 0000000000000000 R08: ffffffff8a094948 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff83e32d80
R13: ffffffff883a0490 R14: dffffc0000000000 R15: 0000000000000057
vprintk_emit+0x224/0x620 kernel/printk/printk.c:1923
vprintk_func+0x58/0x152 kernel/printk/printk_safe.c:401
printk+0x9e/0xbc kernel/printk/printk.c:1996
__do_replace.cold+0x11/0x1b net/ipv4/netfilter/ip_tables.c:1092
do_replace net/ipv4/netfilter/ip_tables.c:1142 [inline]
do_ipt_set_ctl+0x256/0x39e net/ipv4/netfilter/ip_tables.c:1674
nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
nf_setsockopt+0x5f/0xb0 net/netfilter/nf_sockopt.c:115
ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline]
ip_setsockopt+0x94/0xb0 net/ipv4/ip_sockglue.c:1240
raw_setsockopt+0xac/0xd0 net/ipv4/raw.c:857
SYSC_setsockopt net/socket.c:1865 [inline]
SyS_setsockopt+0x110/0x1e0 net/socket.c:1844
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x448939
RSP: 002b:00007f1d434abcd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00000000006ddc28 RCX: 0000000000448939
RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00000000006ddc20 R08: 0000000000000a08 R09: 0000000000000000
R10: 0000000020000740 R11: 0000000000000246 R12: 00000000006ddc2c
R13: 00007f1d434abd10 R14: 0000000000000000 R15: 0000000000000000
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
net_ratelimit: 1528 callbacks suppressed
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
ip_tables: iptables: counters copy to user failed while replacing table
net_ratelimit: 1656 callbacks suppressed
Reply all
Reply to author
Forward
0 new messages