Eric Dumazet
7170a97774
net: annotate accesses to sk->sk_incoming_cpu
...
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>
2019-10-30 13:24:25 -07:00
..
2019-05-30 11:26:32 -07:00
2019-10-01 18:42:15 +02:00
2019-10-22 15:17:03 -07:00
2019-10-16 13:41:26 -04:00
2019-04-27 17:07:21 -04:00
2019-07-03 13:51:54 -07:00
2019-07-11 14:43:25 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:45 +02:00
2019-09-16 09:02:18 +02:00
2019-07-05 15:01:15 -07:00
2019-07-01 06:16:40 +02:00
2019-07-27 14:23:48 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2017-09-01 20:33:42 -07:00
2019-09-26 09:34:25 +02:00
2019-05-21 10:50:45 +02:00
2019-07-01 10:54:51 -07:00
2019-09-27 12:05:02 +02:00
2019-10-30 13:24:25 -07:00
2018-10-24 14:18:16 -07:00
2019-09-20 19:17:57 -07:00
2019-07-11 14:43:25 -07:00
2019-10-29 17:36:42 -07:00
2017-11-02 11:10:55 +01:00
2019-10-03 11:40:21 -04:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-10-18 10:02:37 -07:00
2019-07-26 14:17:44 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:32 -07:00
2019-09-07 17:49:00 +02:00
2019-06-06 08:34:50 +02:00
2019-05-31 08:34:32 -07:00
2019-05-21 10:50:46 +02:00
2019-04-08 09:15:17 +02:00
2019-06-05 17:37:07 +02:00
2019-08-28 14:47:35 -07:00
2019-06-06 08:34:50 +02:00
2019-07-22 12:10:54 -07:00
2019-10-18 10:02:37 -07:00
2019-05-21 10:50:45 +02:00
2019-09-12 11:20:33 +01:00
2019-06-07 11:00:14 -07:00
2019-05-30 11:26:32 -07:00
2019-10-01 18:42:15 +02:00
2019-08-08 15:55:10 -07:00
2019-10-16 13:41:26 -04:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-07-14 12:15:28 -07:00
2019-05-30 11:26:32 -07:00
2019-07-18 17:08:07 -07:00
2019-10-13 10:13:08 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:45 +02:00
2019-01-17 15:01:08 -08:00
2019-05-30 11:26:32 -07:00
2019-10-30 13:24:25 -07:00
2019-05-30 11:26:32 -07:00
2018-12-19 11:21:37 -08:00
2019-05-30 11:26:32 -07:00
2019-04-23 07:42:20 +02:00
2019-05-30 11:26:32 -07:00
2019-06-06 08:34:50 +02:00
2019-05-21 11:28:45 +02:00