Eric Dumazet
47e82f6cea
net: add annotations on hh->hh_len lockless accesses
[ Upstream commit c305c6ae79 ]
KCSAN reported a data-race [1]
While we can use READ_ONCE() on the read sides,
we need to make sure hh->hh_len is written last.
[1]
BUG: KCSAN: data-race in eth_header_cache / neigh_resolve_output
write to 0xffff8880b9dedcb8 of 4 bytes by task 29760 on cpu 0:
eth_header_cache+0xa9/0xd0 net/ethernet/eth.c:247
neigh_hh_init net/core/neighbour.c:1463 [inline]
neigh_resolve_output net/core/neighbour.c:1480 [inline]
neigh_resolve_output+0x415/0x470 net/core/neighbour.c:1470
neigh_output include/net/neighbour.h:511 [inline]
ip6_finish_output2+0x7a2/0xec0 net/ipv6/ip6_output.c:116
__ip6_finish_output net/ipv6/ip6_output.c:142 [inline]
__ip6_finish_output+0x2d7/0x330 net/ipv6/ip6_output.c:127
ip6_finish_output+0x41/0x160 net/ipv6/ip6_output.c:152
NF_HOOK_COND include/linux/netfilter.h:294 [inline]
ip6_output+0xf2/0x280 net/ipv6/ip6_output.c:175
dst_output include/net/dst.h:436 [inline]
NF_HOOK include/linux/netfilter.h:305 [inline]
ndisc_send_skb+0x459/0x5f0 net/ipv6/ndisc.c:505
ndisc_send_ns+0x207/0x430 net/ipv6/ndisc.c:647
rt6_probe_deferred+0x98/0xf0 net/ipv6/route.c:615
process_one_work+0x3d4/0x890 kernel/workqueue.c:2269
worker_thread+0xa0/0x800 kernel/workqueue.c:2415
kthread+0x1d4/0x200 drivers/block/aoe/aoecmd.c:1253
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352
read to 0xffff8880b9dedcb8 of 4 bytes by task 29572 on cpu 1:
neigh_resolve_output net/core/neighbour.c:1479 [inline]
neigh_resolve_output+0x113/0x470 net/core/neighbour.c:1470
neigh_output include/net/neighbour.h:511 [inline]
ip6_finish_output2+0x7a2/0xec0 net/ipv6/ip6_output.c:116
__ip6_finish_output net/ipv6/ip6_output.c:142 [inline]
__ip6_finish_output+0x2d7/0x330 net/ipv6/ip6_output.c:127
ip6_finish_output+0x41/0x160 net/ipv6/ip6_output.c:152
NF_HOOK_COND include/linux/netfilter.h:294 [inline]
ip6_output+0xf2/0x280 net/ipv6/ip6_output.c:175
dst_output include/net/dst.h:436 [inline]
NF_HOOK include/linux/netfilter.h:305 [inline]
ndisc_send_skb+0x459/0x5f0 net/ipv6/ndisc.c:505
ndisc_send_ns+0x207/0x430 net/ipv6/ndisc.c:647
rt6_probe_deferred+0x98/0xf0 net/ipv6/route.c:615
process_one_work+0x3d4/0x890 kernel/workqueue.c:2269
worker_thread+0xa0/0x800 kernel/workqueue.c:2415
kthread+0x1d4/0x200 drivers/block/aoe/aoecmd.c:1253
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 29572 Comm: kworker/1:4 Not tainted 5.4.0-rc6+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events rt6_probe_deferred
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: Sasha Levin <sashal@kernel.org>
2023-05-15 16:31:00 +09:00
..
2015-04-11 22:28:27 -04:00
2023-05-15 13:55:27 +09:00
2023-05-15 12:38:05 +09:00
2014-12-10 15:33:16 -05:00
2015-09-21 16:03:04 -07:00
2023-05-15 14:58:00 +09:00
2023-05-15 14:18:16 +09:00
2023-05-15 08:24:46 +09:00
2023-05-15 12:05:35 +09:00
2023-05-15 16:08:32 +09:00
2023-05-12 17:06:33 +09:00
2016-06-15 20:41:22 -07:00
2016-08-17 19:27:51 -04:00
2017-05-15 09:26:49 +02:00
2015-09-17 13:20:05 +02:00
2016-09-08 11:10:12 +01:00
2016-09-04 13:29:29 -07:00
2023-05-12 16:57:03 +09:00
2014-09-18 10:54:36 +02:00
2023-05-15 13:41:16 +09:00
2023-05-15 11:43:44 +09:00
2016-02-09 04:45:49 -05:00
2014-11-10 13:27:49 -05:00
2015-07-27 01:05:24 -07:00
2023-05-15 09:01:44 +09:00
2015-11-18 16:17:38 -05:00
2016-06-27 15:06:17 -04:00
2018-04-13 19:47:49 +02:00
2016-07-08 12:20:57 +02:00
2016-03-13 15:01:00 -04:00
2017-02-18 15:11:41 +01:00
2016-04-19 20:09:25 -04:00
2016-04-25 16:44:27 -04:00
2016-06-25 12:19:35 -04:00
2016-04-25 16:44:27 -04:00
2016-06-09 23:41:03 -07:00
2014-02-09 17:32:50 -08:00
2013-12-06 12:37:56 -05:00
2015-03-06 21:50:02 -05:00
2016-08-26 11:55:18 -07:00
2013-12-10 21:50:00 -05:00
2013-09-20 14:49:32 -04:00
2015-09-17 17:18:37 -07:00
2013-09-20 14:49:32 -04:00
2014-02-09 17:32:49 -08:00
2014-02-09 17:32:49 -08:00
2016-09-23 08:38:50 -04:00
2013-01-09 23:59:53 -08:00
2016-02-16 20:21:48 -05:00
2016-09-10 20:53:55 -07:00
2015-10-08 04:27:02 -07:00
2023-05-15 16:20:28 +09:00
2013-11-07 19:28:58 -05:00
2015-09-23 15:33:15 -07:00
2017-01-27 13:55:58 -08:00
2013-03-26 12:32:13 -04:00
2023-05-15 14:57:24 +09:00
2017-01-27 13:55:59 -08:00
2014-02-12 07:02:11 +01:00
2016-05-20 18:03:16 -04:00
2023-05-15 14:57:24 +09:00
2023-05-15 14:57:24 +09:00
2013-09-20 14:49:33 -04:00
2016-06-07 16:37:14 -07:00
2016-02-18 11:42:19 -05:00
2016-06-17 20:23:32 -07:00
2016-08-18 01:17:32 -04:00
2023-05-15 11:55:36 +09:00
2016-07-25 17:55:43 -07:00
2014-11-05 16:30:03 -05:00
2016-03-14 12:19:46 -04:00
2023-05-15 11:50:01 +09:00
2016-09-12 11:45:45 +02:00
2016-01-04 20:40:41 +01:00
2016-10-14 10:59:15 -04:00
2015-12-15 23:25:20 -05:00
2016-03-22 15:45:44 -04:00
2016-04-04 22:11:20 -04:00
2016-05-20 18:03:17 -04:00
2017-10-31 01:04:32 -07:00
2016-08-13 15:08:00 -07:00
2023-05-15 12:36:15 +09:00
2023-05-15 16:21:53 +09:00
2023-05-15 09:02:06 +09:00
2018-05-16 10:08:41 +02:00
2023-05-15 11:43:33 +09:00
2016-03-13 23:55:13 -04:00
2017-09-20 08:19:53 +02:00
2017-07-21 08:55:50 +02:00
2023-05-15 13:58:21 +09:00
2023-05-15 11:09:54 +09:00
2016-09-17 10:13:07 -04:00
2023-05-15 14:58:44 +09:00
2023-05-15 16:17:37 +09:00
2023-05-15 14:29:07 +09:00
2023-05-15 12:36:17 +09:00
2014-11-24 04:28:49 -05:00
2017-08-11 08:49:34 -07:00
2016-08-17 19:36:23 -04:00
2023-05-15 11:16:26 +09:00
2013-09-21 14:01:38 -04:00
2014-10-14 02:18:27 +02:00
2013-09-21 14:01:38 -04:00
2013-09-21 14:01:38 -04:00
2014-12-10 15:21:24 -05:00
2023-05-15 14:56:19 +09:00
2013-09-21 14:01:38 -04:00
2014-01-01 22:22:43 -05:00
2013-09-21 14:01:38 -04:00
2013-09-21 14:01:38 -04:00
2014-12-10 15:21:24 -05:00
2013-09-21 14:01:38 -04:00
2023-05-15 15:09:01 +09:00
2017-02-18 15:11:42 +01:00
2018-05-30 07:50:28 +02:00
2016-07-08 13:23:12 +02:00
2013-12-06 12:37:56 -05:00
2014-09-22 16:23:15 -04:00
2015-10-23 06:26:42 -07:00
2016-10-03 02:00:22 -04:00
2013-10-01 17:06:14 -04:00
2016-10-04 02:11:51 -04:00
2016-06-15 20:41:23 -07:00
2023-05-15 16:31:00 +09:00
2023-05-15 12:22:38 +09:00
2016-07-05 09:06:29 -07:00
2016-06-27 15:06:18 -04:00
2017-10-12 11:51:25 +02:00
2015-12-08 22:02:33 -05:00
2013-09-21 14:01:39 -04:00
2018-05-16 10:08:41 +02:00
2016-07-08 12:20:57 +02:00
2013-09-21 14:01:39 -04:00
2016-03-23 22:09:58 -04:00
2016-09-28 05:02:44 -04:00
2016-08-10 17:19:02 -07:00
2016-08-15 10:55:53 -07:00
2016-04-07 16:53:30 -04:00
2013-09-23 01:51:08 -04:00
2016-02-11 03:54:14 -05:00
2013-09-23 01:51:08 -04:00
2018-02-25 11:05:48 +01:00
2018-05-30 07:50:30 +02:00
2016-04-04 22:11:19 -04:00
2013-09-23 01:51:08 -04:00
2018-05-30 13:19:56 +02:00
2016-06-30 06:15:04 -04:00
2023-05-15 14:56:24 +09:00
2016-02-08 10:30:42 -05:00
2014-06-02 11:00:41 -07:00
2018-04-20 08:21:07 +02:00
2016-04-28 11:49:45 -04:00
2016-01-19 14:44:23 -05:00
2023-05-15 16:21:53 +09:00
2013-12-19 18:51:20 -05:00
2013-09-23 01:51:09 -04:00
2016-08-28 23:32:41 -04:00
2016-09-28 04:48:00 -04:00
2015-03-12 22:58:12 -04:00
2023-05-15 16:17:41 +09:00
2015-07-09 15:12:20 -07:00
2016-05-03 16:08:14 -04:00
2015-10-26 22:24:22 -07:00
2016-06-17 20:23:32 -07:00
2016-10-20 14:45:52 -04:00
2018-03-11 16:21:32 +01:00
2013-07-27 22:14:06 -07:00
2017-07-21 07:42:18 +02:00
2013-09-23 16:29:40 -04:00
2014-09-05 17:35:28 -07:00
2018-04-13 19:48:00 +02:00
2023-05-15 14:29:05 +09:00