Eric Dumazet
2261df133d
net: annotate accesses to sk->sk_incoming_cpu
...
[ Upstream commit 7170a977743b72cf3eb46ef6ef89885dc7ad3621 ]
This socket field can be read and written by concurrent cpus.
Use READ_ONCE() and WRITE_ONCE() annotations to document this,
and avoid some compiler 'optimizations'.
KCSAN reported :
BUG: KCSAN: data-race in tcp_v4_rcv / tcp_v4_rcv
write to 0xffff88812220763c of 4 bytes by interrupt on cpu 0:
sk_incoming_cpu_update include/net/sock.h:953 [inline]
tcp_v4_rcv+0x1b3c/0x1bb0 net/ipv4/tcp_ipv4.c:1934
ip_protocol_deliver_rcu+0x4d/0x420 net/ipv4/ip_input.c:204
ip_local_deliver_finish+0x110/0x140 net/ipv4/ip_input.c:231
NF_HOOK include/linux/netfilter.h:305 [inline]
NF_HOOK include/linux/netfilter.h:299 [inline]
ip_local_deliver+0x133/0x210 net/ipv4/ip_input.c:252
dst_input include/net/dst.h:442 [inline]
ip_rcv_finish+0x121/0x160 net/ipv4/ip_input.c:413
NF_HOOK include/linux/netfilter.h:305 [inline]
NF_HOOK include/linux/netfilter.h:299 [inline]
ip_rcv+0x18f/0x1a0 net/ipv4/ip_input.c:523
__netif_receive_skb_one_core+0xa7/0xe0 net/core/dev.c:5010
__netif_receive_skb+0x37/0xf0 net/core/dev.c:5124
process_backlog+0x1d3/0x420 net/core/dev.c:5955
napi_poll net/core/dev.c:6392 [inline]
net_rx_action+0x3ae/0xa90 net/core/dev.c:6460
__do_softirq+0x115/0x33f kernel/softirq.c:292
do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1082
do_softirq.part.0+0x6b/0x80 kernel/softirq.c:337
do_softirq kernel/softirq.c:329 [inline]
__local_bh_enable_ip+0x76/0x80 kernel/softirq.c:189
read to 0xffff88812220763c of 4 bytes by interrupt on cpu 1:
sk_incoming_cpu_update include/net/sock.h:952 [inline]
tcp_v4_rcv+0x181a/0x1bb0 net/ipv4/tcp_ipv4.c:1934
ip_protocol_deliver_rcu+0x4d/0x420 net/ipv4/ip_input.c:204
ip_local_deliver_finish+0x110/0x140 net/ipv4/ip_input.c:231
NF_HOOK include/linux/netfilter.h:305 [inline]
NF_HOOK include/linux/netfilter.h:299 [inline]
ip_local_deliver+0x133/0x210 net/ipv4/ip_input.c:252
dst_input include/net/dst.h:442 [inline]
ip_rcv_finish+0x121/0x160 net/ipv4/ip_input.c:413
NF_HOOK include/linux/netfilter.h:305 [inline]
NF_HOOK include/linux/netfilter.h:299 [inline]
ip_rcv+0x18f/0x1a0 net/ipv4/ip_input.c:523
__netif_receive_skb_one_core+0xa7/0xe0 net/core/dev.c:5010
__netif_receive_skb+0x37/0xf0 net/core/dev.c:5124
process_backlog+0x1d3/0x420 net/core/dev.c:5955
napi_poll net/core/dev.c:6392 [inline]
net_rx_action+0x3ae/0xa90 net/core/dev.c:6460
__do_softirq+0x115/0x33f kernel/softirq.c:292
run_ksoftirqd+0x46/0x60 kernel/softirq.c:603
smpboot_thread_fn+0x37d/0x4a0 kernel/smpboot.c:165
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-10 11:25:23 +01:00
..
2018-10-03 17:00:47 -07:00
2019-07-31 07:28:39 +02:00
2017-11-02 11:10:55 +01:00
2019-05-16 19:42:34 +02:00
2019-10-05 12:47:43 +02:00
2019-04-27 09:35:33 +02:00
2019-10-05 12:47:43 +02:00
2019-09-21 07:15:35 +02:00
2019-10-05 12:47:31 +02:00
2019-09-19 09:07:59 +02:00
2019-05-08 07:20:45 +02:00
2019-07-21 09:04:22 +02:00
2019-08-29 08:26:42 +02:00
2019-11-10 11:25:23 +01:00
2018-09-19 22:43:43 +02:00
2019-11-10 11:25:22 +01:00
2018-02-25 11:07:52 +01:00
2018-07-22 14:28:49 +02:00
2019-05-16 19:42:34 +02:00
2019-03-19 13:13:22 +01:00
2019-10-05 12:47:44 +02:00
2018-04-29 11:33:13 +02:00
2019-11-10 11:25:23 +01:00
2019-11-10 11:25:23 +01:00
2017-11-02 11:10:55 +01:00
2018-03-31 18:10:41 +02:00
2019-04-17 08:37:45 +02:00
2019-09-16 08:20:44 +02:00
2019-08-09 17:53:35 +02:00
2019-06-22 08:16:14 +02:00
2019-11-06 12:43:36 +01:00
2019-10-29 09:17:35 +01:00
2018-09-09 19:55:52 +02:00
2019-03-13 14:03:09 -07:00
2017-10-21 01:56:38 +01:00
2019-10-11 18:18:39 +02:00
2019-03-13 14:03:08 -07:00
2019-04-03 06:25:08 +02:00
2019-07-31 07:28:46 +02:00
2019-10-07 18:55:22 +02:00
2018-07-22 14:28:49 +02:00
2019-10-05 12:47:41 +02:00
2019-08-25 10:50:26 +02:00
2019-03-23 14:35:16 +01:00
2019-09-10 10:32:21 +01:00
2019-10-05 12:47:40 +02:00
2019-10-07 18:55:20 +02:00
2018-05-16 10:10:26 +02:00
2019-05-02 09:40:34 +02:00
2019-11-06 12:43:37 +01:00
2019-11-06 12:43:39 +01:00
2019-11-06 12:43:39 +01:00
2019-09-06 10:20:50 +02:00
2018-07-22 14:28:47 +02:00
2019-07-21 09:04:29 +02:00
2017-08-07 14:48:48 -07:00
2019-10-07 18:55:20 +02:00
2018-12-05 19:41:11 +01:00
2019-03-19 13:13:24 +01:00
2019-10-07 18:55:19 +02:00
2017-11-02 11:10:55 +01:00
2019-11-06 12:43:34 +01:00
2019-03-19 13:13:23 +01:00
2019-09-16 08:20:44 +02:00
2019-01-09 17:14:46 +01:00
2017-09-04 13:25:20 +02:00
2017-11-02 11:10:55 +01:00
2019-08-25 10:50:02 +02:00