Eric Dumazet
ee8d153d46
net: annotate lockless accesses to sk->sk_napi_id
...
We already annotated most accesses to sk->sk_napi_id
We missed sk_mark_napi_id() and sk_mark_napi_id_once()
which might be called without socket lock held in UDP stack.
KCSAN reported :
BUG: KCSAN: data-race in udpv6_queue_rcv_one_skb / udpv6_queue_rcv_one_skb
write to 0xffff888121c6d108 of 4 bytes by interrupt on cpu 0:
sk_mark_napi_id include/net/busy_poll.h:125 [inline]
__udpv6_queue_rcv_skb net/ipv6/udp.c:571 [inline]
udpv6_queue_rcv_one_skb+0x70c/0xb40 net/ipv6/udp.c:672
udpv6_queue_rcv_skb+0xb5/0x400 net/ipv6/udp.c:689
udp6_unicast_rcv_skb.isra.0+0xd7/0x180 net/ipv6/udp.c:832
__udp6_lib_rcv+0x69c/0x1770 net/ipv6/udp.c:913
udpv6_rcv+0x2b/0x40 net/ipv6/udp.c:1015
ip6_protocol_deliver_rcu+0x22a/0xbe0 net/ipv6/ip6_input.c:409
ip6_input_finish+0x30/0x50 net/ipv6/ip6_input.c:450
NF_HOOK include/linux/netfilter.h:305 [inline]
NF_HOOK include/linux/netfilter.h:299 [inline]
ip6_input+0x177/0x190 net/ipv6/ip6_input.c:459
dst_input include/net/dst.h:442 [inline]
ip6_rcv_finish+0x110/0x140 net/ipv6/ip6_input.c:76
NF_HOOK include/linux/netfilter.h:305 [inline]
NF_HOOK include/linux/netfilter.h:299 [inline]
ipv6_rcv+0x1a1/0x1b0 net/ipv6/ip6_input.c:284
__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
write to 0xffff888121c6d108 of 4 bytes by interrupt on cpu 1:
sk_mark_napi_id include/net/busy_poll.h:125 [inline]
__udpv6_queue_rcv_skb net/ipv6/udp.c:571 [inline]
udpv6_queue_rcv_one_skb+0x70c/0xb40 net/ipv6/udp.c:672
udpv6_queue_rcv_skb+0xb5/0x400 net/ipv6/udp.c:689
udp6_unicast_rcv_skb.isra.0+0xd7/0x180 net/ipv6/udp.c:832
__udp6_lib_rcv+0x69c/0x1770 net/ipv6/udp.c:913
udpv6_rcv+0x2b/0x40 net/ipv6/udp.c:1015
ip6_protocol_deliver_rcu+0x22a/0xbe0 net/ipv6/ip6_input.c:409
ip6_input_finish+0x30/0x50 net/ipv6/ip6_input.c:450
NF_HOOK include/linux/netfilter.h:305 [inline]
NF_HOOK include/linux/netfilter.h:299 [inline]
ip6_input+0x177/0x190 net/ipv6/ip6_input.c:459
dst_input include/net/dst.h:442 [inline]
ip6_rcv_finish+0x110/0x140 net/ipv6/ip6_input.c:76
NF_HOOK include/linux/netfilter.h:305 [inline]
NF_HOOK include/linux/netfilter.h:299 [inline]
ipv6_rcv+0x1a1/0x1b0 net/ipv6/ip6_input.c:284
__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
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 10890 Comm: syz-executor.0 Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Fixes: e68b6e50fa35 ("udp: enable busy polling for all sockets")
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 17:34:35 -07:00
..
2019-05-30 11:29:21 -07:00
2019-09-05 17:27:21 +02:00
2019-05-30 11:29:22 -07:00
2018-09-26 09:56:07 -07:00
2019-09-25 11:01:19 +02:00
2019-09-04 13:29:14 +02:00
2019-06-19 17:09:07 +02:00
2019-06-05 17:37:07 +02:00
2019-10-09 16:27:04 -07:00
2019-09-16 09:18:03 +02:00
2019-09-16 09:18:03 +02:00
2019-08-19 17:19:46 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-02-28 08:24:23 -07:00
2019-06-05 17:37:05 +02:00
2019-05-05 11:25:49 -07:00
2019-01-23 11:18:00 -08:00
2019-06-19 17:09:55 +02:00
2019-05-24 17:37:53 +02:00
2019-05-21 11:28:40 +02:00
2019-07-04 12:30:48 -07:00
2019-10-24 14:53:49 -07:00
2019-08-17 23:18:54 +02:00
2019-10-30 17:34:35 -07:00
2019-05-21 11:28:45 +02:00
2019-06-19 17:09:55 +02:00
2019-10-07 22:10:50 +02:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:45 +02:00
2019-05-30 11:26:32 -07:00
2019-04-19 14:07:40 -07:00
2019-05-30 11:29:52 -07:00
2019-05-30 11:29:52 -07:00
2019-09-13 22:11:14 +02:00
2019-05-21 11:52:39 +02:00
2019-05-21 11:52:39 +02:00
2019-08-17 12:40:08 -07:00
2019-09-16 21:32:57 +02:00
2019-07-01 10:48:34 -07:00
2019-06-19 17:09:55 +02:00
2018-05-28 22:59:54 -04:00
2019-04-22 21:50:53 -07:00
2019-07-11 14:22:53 -07:00
2019-10-23 20:13:22 -07:00
2019-09-16 09:18:02 +02:00
2019-02-27 12:50:17 -08:00
2019-10-23 20:13:22 -07:00
2019-10-23 20:13:22 -07:00
2018-11-17 21:37:29 -08:00
2019-04-27 17:07:22 -04:00
2019-03-22 12:09:31 -07:00
2018-12-10 15:53:04 -08:00
2019-07-01 10:58:23 -07:00
2019-10-25 16:24:32 -07:00
2019-05-30 11:26:32 -07:00
2019-02-22 12:56:24 -08:00
2019-05-30 11:26:41 -07:00
2019-08-28 14:43:03 -07:00
2019-04-22 21:50:53 -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-03 13:51:54 -07:00
2019-08-31 23:44:28 -07:00
2018-10-17 17:45:07 -07:00
2019-08-08 15:55:10 -07:00
2019-05-30 11:26:32 -07:00
2019-09-13 21:44:19 +02:00
2019-09-27 12:05:02 +02:00
2019-02-08 21:50:15 -08:00
2019-05-30 11:26:32 -07:00
2019-06-24 10:18:49 -07:00
2019-06-27 21:06:39 -07:00
2019-06-18 20:48:45 -04:00
2019-09-05 12:35:58 +02:00
2019-02-27 12:50:17 -08:00
2019-10-24 11:56:02 +02:00
2019-10-21 10:46:42 -07:00
2019-06-19 11:37:47 -04:00
2019-05-22 17:48:43 -07:00
2019-09-27 12:05:02 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2018-07-11 23:10:19 -07:00
2019-10-08 13:23:05 -07:00
2018-09-13 09:04:58 -07:00
2019-04-23 19:42:29 -07:00
2019-09-11 09:33:29 +02:00
2019-05-30 11:26:41 -07:00
2019-05-21 11:28:45 +02:00
2019-06-05 17:36:38 +02:00
2019-06-05 17:36:38 +02:00
2019-07-22 12:10:54 -07:00
2019-04-17 23:19:07 -07:00
2018-05-28 22:59:54 -04:00
2019-10-25 20:14:42 -07:00
2018-08-01 09:52:30 -07:00
2019-05-21 11:28:45 +02:00
2019-08-13 20:37:16 -07:00
2019-05-30 11:26:32 -07:00
2019-04-11 13:59:49 -07:00
2019-09-05 12:35:58 +02:00
2019-07-08 14:58:04 -07:00
2019-05-30 11:26:32 -07:00
2019-08-26 14:17:43 -07:00
2019-09-17 23:51:10 +02:00
2019-05-30 11:26:32 -07:00
2019-09-16 09:18:03 +02:00
2019-05-30 11:26:32 -07:00
2018-08-28 11:11:47 +02:00
2019-10-09 21:34:31 -07:00
2019-09-20 18:23:33 -07:00
2018-11-06 15:00:45 -08:00
2019-04-22 21:47:25 -07:00
2019-09-27 10:29:11 +02:00
2018-07-21 10:43:12 -05: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-02-21 10:34:37 -08:00
2019-05-30 11:26:32 -07:00
2019-09-16 09:02:18 +02:00
2019-10-30 13:24:25 -07:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-10-13 10:13:08 -07:00
2019-05-30 11:26:32 -07:00
2019-09-05 09:49:49 +02:00
2018-07-07 10:58:49 +09:00
2019-03-29 10:53:45 -07:00
2019-08-30 19:49:37 -07:00
2019-06-05 17:37:05 +02:00
2019-10-24 14:53:49 -07:00
2019-06-05 17:30:29 +02:00
2019-06-19 11:23:13 -04:00
2019-08-31 01:08:26 +02:00
2019-06-19 11:23:13 -04:00
2019-07-17 10:03:54 +02:00