syzbot


KCSAN: data-race in __nf_conntrack_alloc / __nf_conntrack_find_get (2)

Status: auto-closed as invalid on 2021/01/16 23:05
Subsystems: netfilter
[Documentation on labels]
Reported-by: syzbot+16072e73a56af3190e02@syzkaller.appspotmail.com
First crash: 1230d, last: 1223d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __nf_conntrack_alloc / __nf_conntrack_find_get netfilter 1 1547d 1547d 0/26 auto-closed as invalid on 2020/04/02 17:02
upstream KCSAN: data-race in __nf_conntrack_alloc / __nf_conntrack_find_get (3) netfilter 2 864d 864d 20/26 fixed on 2022/03/08 16:11

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __nf_conntrack_alloc / __nf_conntrack_find_get

write to 0xffff88802fe35e08 of 4 bytes by interrupt on cpu 1:
 __nf_conntrack_alloc+0x147/0x270 net/netfilter/nf_conntrack_core.c:1508
 init_conntrack+0x178/0xa90 net/netfilter/nf_conntrack_core.c:1576
 resolve_normal_ct net/netfilter/nf_conntrack_core.c:1674 [inline]
 nf_conntrack_in+0x37f/0xad4 net/netfilter/nf_conntrack_core.c:1829
 ipv6_conntrack_in+0x19/0x20 net/netfilter/nf_conntrack_proto.c:391
 nf_hook_entry_hookfn include/linux/netfilter.h:136 [inline]
 nf_hook_slow net/netfilter/core.c:589 [inline]
 nf_hook_slow_list+0x133/0x340 net/netfilter/core.c:627
 NF_HOOK_LIST include/linux/netfilter.h:337 [inline]
 ip6_sublist_rcv+0x8cb/0x8f0 net/ipv6/ip6_input.c:315
 ipv6_list_rcv+0x25d/0x290 net/ipv6/ip6_input.c:352
 __netif_receive_skb_list_ptype net/core/dev.c:5354 [inline]
 __netif_receive_skb_list_core+0x34b/0x450 net/core/dev.c:5402
 __netif_receive_skb_list+0x262/0x2e0 net/core/dev.c:5454
 netif_receive_skb_list_internal+0xda/0x330 net/core/dev.c:5564
 gro_normal_list net/core/dev.c:5718 [inline]
 napi_complete_done+0x1b2/0x420 net/core/dev.c:6443
 wg_packet_rx_poll+0x1208/0x1290 drivers/net/wireguard/receive.c:496
 napi_poll+0x178/0x4c0 net/core/dev.c:6759
 net_rx_action+0x17a/0x480 net/core/dev.c:6829
 __do_softirq+0x12c/0x2b1 kernel/softirq.c:298
 asm_call_irq_on_stack+0xf/0x20
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
 do_softirq_own_stack+0x32/0x40 arch/x86/kernel/irq_64.c:77
 do_softirq kernel/softirq.c:343 [inline]
 __local_bh_enable_ip+0xba/0xd0 kernel/softirq.c:195
 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:176 [inline]
 _raw_spin_unlock_bh+0x33/0x40 kernel/locking/spinlock.c:207
 spin_unlock_bh include/linux/spinlock.h:399 [inline]
 ptr_ring_consume_bh include/linux/ptr_ring.h:367 [inline]
 wg_packet_decrypt_worker+0x6f2/0x730 drivers/net/wireguard/receive.c:507
 process_one_work+0x3e1/0x950 kernel/workqueue.c:2272
 worker_thread+0x635/0xb90 kernel/workqueue.c:2418
 kthread+0x1fd/0x220 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

read to 0xffff88802fe35e08 of 4 bytes by task 22055 on cpu 0:
 nf_ct_is_expired include/net/netfilter/nf_conntrack.h:272 [inline]
 ____nf_conntrack_find net/netfilter/nf_conntrack_core.c:747 [inline]
 __nf_conntrack_find_get+0x1c7/0xac0 net/netfilter/nf_conntrack_core.c:778
 resolve_normal_ct net/netfilter/nf_conntrack_core.c:1672 [inline]
 nf_conntrack_in+0x31e/0xad4 net/netfilter/nf_conntrack_core.c:1829
 ipv6_conntrack_local+0x19/0x20 net/netfilter/nf_conntrack_proto.c:398
 nf_hook_entry_hookfn include/linux/netfilter.h:136 [inline]
 nf_hook_slow+0x72/0x170 net/netfilter/core.c:589
 nf_hook include/linux/netfilter.h:256 [inline]
 __ip6_local_out+0x233/0x250 net/ipv6/output_core.c:167
 ip6_local_out+0x22/0x80 net/ipv6/output_core.c:177
 ip6_send_skb+0x43/0xf0 net/ipv6/ip6_output.c:1865
 udp_v6_send_skb+0x6d8/0xa30 net/ipv6/udp.c:1233
 udpv6_sendmsg+0x1576/0x17e0 net/ipv6/udp.c:1531
 inet6_sendmsg+0x5f/0x80 net/ipv6/af_inet6.c:638
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg net/socket.c:671 [inline]
 ____sys_sendmsg+0x352/0x4c0 net/socket.c:2353
 ___sys_sendmsg net/socket.c:2407 [inline]
 __sys_sendmmsg+0x335/0x4b0 net/socket.c:2497
 __do_sys_sendmmsg net/socket.c:2526 [inline]
 __se_sys_sendmmsg net/socket.c:2523 [inline]
 __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2523
 do_syscall_64+0x39/0x80 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 22055 Comm: syz-executor.3 Not tainted 5.10.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/12 23:05 upstream 7b1b868e1d91 bca53db9 .config console log report info ci2-upstream-kcsan-gce
2020/12/06 00:24 upstream 32f741b02f1a 50503117 .config console log report info ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.