syzbot


KCSAN: data-race in __inet_lookup_established / sock_setsockopt

Status: auto-closed as invalid on 2021/02/21 23:14
Subsystems: net
[Documentation on labels]
First crash: 1194d, last: 1194d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __inet_lookup_established / sock_setsockopt

write to 0xffff8880304ea514 of 4 bytes by task 21522 on cpu 0:
 sock_bindtoindex_locked net/core/sock.c:574 [inline]
 sock_setsockopt+0x148a/0x2030 net/core/sock.c:1254
 __sys_setsockopt+0x337/0x460 net/socket.c:2111
 __do_sys_setsockopt net/socket.c:2126 [inline]
 __se_sys_setsockopt net/socket.c:2123 [inline]
 __x64_sys_setsockopt+0x62/0x70 net/socket.c:2123
 do_syscall_64+0x39/0x80 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

read to 0xffff8880304ea514 of 4 bytes by interrupt on cpu 1:
 __inet_lookup_established+0x30a/0x3d0 net/ipv4/inet_hashtables.c:415
 __inet_lookup include/net/inet_hashtables.h:353 [inline]
 __inet_lookup_skb include/net/inet_hashtables.h:395 [inline]
 tcp_v4_rcv+0x867/0x2370 net/ipv4/tcp_ipv4.c:1959
 ip_protocol_deliver_rcu+0x1f9/0x3e0 net/ipv4/ip_input.c:204
 ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline]
 NF_HOOK include/linux/netfilter.h:301 [inline]
 ip_local_deliver+0x1c0/0x280 net/ipv4/ip_input.c:252
 dst_input include/net/dst.h:447 [inline]
 ip_rcv_finish net/ipv4/ip_input.c:428 [inline]
 NF_HOOK include/linux/netfilter.h:301 [inline]
 ip_rcv+0x1a6/0x250 net/ipv4/ip_input.c:539
 __netif_receive_skb_one_core net/core/dev.c:5323 [inline]
 __netif_receive_skb+0x8b/0x1b0 net/core/dev.c:5437
 process_backlog+0x23f/0x3d0 net/core/dev.c:6327
 napi_poll+0x181/0x630 net/core/dev.c:6805
 net_rx_action+0x17a/0x480 net/core/dev.c:6888
 __do_softirq+0x13c/0x2c3 kernel/softirq.c:343
 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:246 [inline]
 __local_bh_enable_ip+0xba/0xd0 kernel/softirq.c:196
 local_bh_enable+0x1b/0x20 include/linux/bottom_half.h:32
 rcu_read_unlock_bh include/linux/rcupdate.h:737 [inline]
 ip_finish_output2+0xb10/0xba0 net/ipv4/ip_output.c:231
 __ip_finish_output+0x2ce/0x430 net/ipv4/ip_output.c:252
 ip_finish_output+0x39/0x160 net/ipv4/ip_output.c:318
 NF_HOOK_COND include/linux/netfilter.h:290 [inline]
 ip_output+0xf6/0x1a0 net/ipv4/ip_output.c:432
 dst_output include/net/dst.h:441 [inline]
 ip_local_out net/ipv4/ip_output.c:126 [inline]
 __ip_queue_xmit+0x9ca/0x9f0 net/ipv4/ip_output.c:532
 ip_queue_xmit+0x34/0x40 net/ipv4/ip_output.c:546
 __tcp_transmit_skb+0x1253/0x1870 net/ipv4/tcp_output.c:1405
 tcp_transmit_skb net/ipv4/tcp_output.c:1423 [inline]
 tcp_send_active_reset+0x24b/0x350 net/ipv4/tcp_output.c:3453
 tcp_disconnect+0x14e/0xd40 net/ipv4/tcp.c:2905
 __tcp_close+0x7ed/0x870 net/ipv4/tcp.c:2707
 tcp_close+0x24/0xa0 net/ipv4/tcp.c:2829
 inet_release+0xed/0x130 net/ipv4/af_inet.c:431
 inet6_release+0x3a/0x50 net/ipv6/af_inet6.c:475
 __sock_release net/socket.c:597 [inline]
 sock_release+0x40/0xd0 net/socket.c:625
 rds_tcp_accept_one+0xd0/0x640 net/rds/tcp_listen.c:220
 rds_tcp_accept_worker+0x20/0x40 net/rds/tcp.c:515
 process_one_work+0x3e1/0x950 kernel/workqueue.c:2275
 worker_thread+0x635/0xb90 kernel/workqueue.c:2421
 kthread+0x1fd/0x220 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 3067 Comm: kworker/u4:4 Not tainted 5.11.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: krdsd rds_tcp_accept_worker
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/17 23:10 upstream 0da0a8a0a0e1 fd103621 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in __inet_lookup_established / sock_setsockopt
* Struck through repros no longer work on HEAD.