Eric Dumazet
b9bda52f8f
net: fix data-race in neigh_event_send()
[ Upstream commit 1b53d64435 ]
KCSAN reported the following data-race [1]
The fix will also prevent the compiler from optimizing out
the condition.
[1]
BUG: KCSAN: data-race in neigh_resolve_output / neigh_resolve_output
write to 0xffff8880a41dba78 of 8 bytes by interrupt on cpu 1:
neigh_event_send include/net/neighbour.h:443 [inline]
neigh_resolve_output+0x78/0x480 net/core/neighbour.c:1474
neigh_output include/net/neighbour.h:511 [inline]
ip_finish_output2+0x4af/0xe40 net/ipv4/ip_output.c:228
__ip_finish_output net/ipv4/ip_output.c:308 [inline]
__ip_finish_output+0x23a/0x490 net/ipv4/ip_output.c:290
ip_finish_output+0x41/0x160 net/ipv4/ip_output.c:318
NF_HOOK_COND include/linux/netfilter.h:294 [inline]
ip_output+0xdf/0x210 net/ipv4/ip_output.c:432
dst_output include/net/dst.h:436 [inline]
ip_local_out+0x74/0x90 net/ipv4/ip_output.c:125
__ip_queue_xmit+0x3a8/0xa40 net/ipv4/ip_output.c:532
ip_queue_xmit+0x45/0x60 include/net/ip.h:237
__tcp_transmit_skb+0xe81/0x1d60 net/ipv4/tcp_output.c:1169
tcp_transmit_skb net/ipv4/tcp_output.c:1185 [inline]
__tcp_retransmit_skb+0x4bd/0x15f0 net/ipv4/tcp_output.c:2976
tcp_retransmit_skb+0x36/0x1a0 net/ipv4/tcp_output.c:2999
tcp_retransmit_timer+0x719/0x16d0 net/ipv4/tcp_timer.c:515
tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:598
tcp_write_timer+0xd1/0xf0 net/ipv4/tcp_timer.c:618
read to 0xffff8880a41dba78 of 8 bytes by interrupt on cpu 0:
neigh_event_send include/net/neighbour.h:442 [inline]
neigh_resolve_output+0x57/0x480 net/core/neighbour.c:1474
neigh_output include/net/neighbour.h:511 [inline]
ip_finish_output2+0x4af/0xe40 net/ipv4/ip_output.c:228
__ip_finish_output net/ipv4/ip_output.c:308 [inline]
__ip_finish_output+0x23a/0x490 net/ipv4/ip_output.c:290
ip_finish_output+0x41/0x160 net/ipv4/ip_output.c:318
NF_HOOK_COND include/linux/netfilter.h:294 [inline]
ip_output+0xdf/0x210 net/ipv4/ip_output.c:432
dst_output include/net/dst.h:436 [inline]
ip_local_out+0x74/0x90 net/ipv4/ip_output.c:125
__ip_queue_xmit+0x3a8/0xa40 net/ipv4/ip_output.c:532
ip_queue_xmit+0x45/0x60 include/net/ip.h:237
__tcp_transmit_skb+0xe81/0x1d60 net/ipv4/tcp_output.c:1169
tcp_transmit_skb net/ipv4/tcp_output.c:1185 [inline]
__tcp_retransmit_skb+0x4bd/0x15f0 net/ipv4/tcp_output.c:2976
tcp_retransmit_skb+0x36/0x1a0 net/ipv4/tcp_output.c:2999
tcp_retransmit_timer+0x719/0x16d0 net/ipv4/tcp_timer.c:515
tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:598
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 0 Comm: swapper/0 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-12 19:20:28 +01:00
..
2019-07-03 13:14:42 +02:00
2019-06-25 11:36:01 +08:00
2018-06-28 10:40:47 -07:00
2019-09-10 10:33:42 +01:00
2019-06-17 19:51:56 +02:00
2019-05-16 19:41:27 +02:00
2019-03-23 20:09:51 +01:00
2019-05-05 14:42:39 +02:00
2019-05-04 09:20:18 +02:00
2019-09-10 10:33:39 +01:00
2018-08-11 01:58:46 +02:00
2018-07-13 12:18:18 -04:00
2018-08-03 12:46:20 -07:00
2018-08-07 12:39:13 -07:00
2019-06-11 12:20:57 +02:00
2019-02-23 09:07:27 +01:00
2018-04-19 16:11:11 -04:00
2018-08-04 13:23:15 -07:00
2019-11-12 19:20:26 +01:00
2019-11-10 11:27:39 +01:00
2019-09-16 08:21:42 +02:00
2018-04-02 20:16:17 +02:00
2018-07-27 13:17:50 -07:00
2018-10-10 10:19:10 -07:00
2018-07-18 15:08:31 -07:00
2018-03-05 12:52:45 -05:00
2019-07-28 08:29:24 +02:00
2018-05-20 18:31:42 -04:00
2018-02-28 11:43:28 -05:00
2018-05-28 22:59:54 -04:00
2018-04-23 10:21:24 -04:00
2019-11-10 11:27:54 +01:00
2018-07-20 10:14:41 +02:00
2019-11-10 11:27:54 +01:00
2019-11-10 11:27:54 +01:00
2018-08-11 12:37:10 -07:00
2018-02-27 14:46:26 -05:00
2019-03-10 07:17:19 +01:00
2018-06-15 14:04:00 +02:00
2018-05-29 10:12:45 -04:00
2018-04-22 21:12:00 -04:00
2018-06-26 11:33:04 +09:00
2018-08-14 10:04:36 -07:00
2019-04-27 09:36:33 +02:00
2018-10-02 15:52:12 -07:00
2018-06-05 10:45:24 -04:00
2019-02-23 09:07:24 +01:00
2019-06-11 12:20:48 +02:00
2018-07-04 15:22:13 +09:00
2019-07-14 08:11:14 +02:00
2019-01-31 08:14:32 +01:00
2019-01-09 17:38:31 +01:00
2019-07-26 09:14:11 +02:00
2019-04-17 08:38:42 +02:00
2019-07-10 09:53:46 +02:00
2018-08-01 13:45:31 -07:00
2018-03-27 09:51:23 +02:00
2019-02-06 17:30:06 +01:00
2018-07-11 23:10:19 -07:00
2019-11-06 13:06:23 +01:00
2018-08-07 15:54:00 -07:00
2018-06-18 22:40:32 +02:00
2019-11-12 19:20:28 +01:00
2018-05-28 22:59:54 -04:00
2019-11-10 11:27:42 +01:00
2018-08-01 09:52:30 -07:00
2018-09-29 11:48:26 -07:00
2019-05-02 09:58:57 +02:00
2018-04-07 22:32:31 -04:00
2018-05-24 18:36:15 -07:00
2018-05-16 07:23:35 +02:00
2018-08-22 21:40:21 -07:00
2018-07-04 22:30:27 +09:00
2019-09-10 10:33:38 +01:00
2018-05-16 07:23:35 +02:00
2018-08-28 11:11:47 +02:00
2018-05-16 07:23:35 +02:00
2018-05-29 10:12:45 -04:00
2018-03-13 18:37:02 +02:00
2018-05-31 22:48:46 -04:00
2019-11-06 13:06:27 +01:00
2018-07-21 10:43:12 -05:00
2018-06-22 13:43:27 +09:00
2018-07-31 09:22:48 +02:00
2018-06-22 13:43:27 +09:00
2018-04-11 10:33:46 -04:00
2018-06-30 20:42:25 +09:00
2019-09-21 07:16:43 +02:00
2019-11-10 11:27:40 +01:00
2018-03-01 21:21:36 -05:00
2018-06-06 14:07:53 -04:00
2018-05-03 13:46:47 -04:00
2018-02-21 15:06:05 -05:00
2019-07-28 08:29:26 +02:00
2018-05-08 00:02:41 -04:00
2019-07-28 08:29:27 +02:00
2018-07-07 10:58:49 +09:00
2018-06-26 11:33:04 +09:00
2018-07-03 10:29:26 +09:00
2018-04-17 13:53:13 -04:00
2019-05-04 09:20:12 +02:00
2018-08-10 16:12:20 +02:00
2019-05-25 18:23:41 +02:00