Eric Dumazet
4493914009
net: deal with most data-races in sk_wait_event()
...
[ Upstream commit d0ac89f6f9879fae316c155de77b5173b3e2c9c9 ]
__condition is evaluated twice in sk_wait_event() macro.
First invocation is lockless, and reads can race with writes,
as spotted by syzbot.
BUG: KCSAN: data-race in sk_stream_wait_connect / tcp_disconnect
write to 0xffff88812d83d6a0 of 4 bytes by task 9065 on cpu 1:
tcp_disconnect+0x2cd/0xdb0
inet_shutdown+0x19e/0x1f0 net/ipv4/af_inet.c:911
__sys_shutdown_sock net/socket.c:2343 [inline]
__sys_shutdown net/socket.c:2355 [inline]
__do_sys_shutdown net/socket.c:2363 [inline]
__se_sys_shutdown+0xf8/0x140 net/socket.c:2361
__x64_sys_shutdown+0x31/0x40 net/socket.c:2361
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
read to 0xffff88812d83d6a0 of 4 bytes by task 9040 on cpu 0:
sk_stream_wait_connect+0x1de/0x3a0 net/core/stream.c:75
tcp_sendmsg_locked+0x2e4/0x2120 net/ipv4/tcp.c:1266
tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1484
inet6_sendmsg+0x63/0x80 net/ipv6/af_inet6.c:651
sock_sendmsg_nosec net/socket.c:724 [inline]
sock_sendmsg net/socket.c:747 [inline]
__sys_sendto+0x246/0x300 net/socket.c:2142
__do_sys_sendto net/socket.c:2154 [inline]
__se_sys_sendto net/socket.c:2150 [inline]
__x64_sys_sendto+0x78/0x90 net/socket.c:2150
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
value changed: 0x00000000 -> 0x00000068
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-30 12:57:46 +01:00
..
2021-09-15 09:50:34 +02:00
2023-04-20 12:10:25 +02:00
2023-01-14 10:16:18 +01:00
2023-05-17 11:47:47 +02:00
2021-04-07 15:00:08 +02:00
2022-10-30 09:41:16 +01:00
2022-06-22 14:13:17 +02:00
2022-05-18 10:23:42 +02:00
2023-05-17 11:47:30 +02:00
2023-01-14 10:15:31 +01:00
2021-07-14 16:56:29 +02:00
2023-04-26 11:27:34 +02:00
2023-03-17 08:45:11 +01:00
2023-04-20 12:10:23 +02:00
2022-05-25 09:17:56 +02:00
2023-05-30 12:57:46 +01:00
2022-03-08 19:09:37 +01:00
2023-04-26 11:27:42 +02:00
2022-08-31 17:15:19 +02:00
2022-12-14 11:32:01 +01:00
2023-01-24 07:19:55 +01:00
2023-04-05 11:23:52 +02:00
2022-11-03 23:57:51 +09:00
2023-05-30 12:57:46 +01:00
2023-05-17 11:48:10 +02:00
2023-03-22 13:30:00 +01:00
2022-11-25 17:45:56 +01:00
2022-12-02 17:39:58 +01:00
2023-04-26 11:27:41 +02:00
2022-04-27 13:53:50 +02:00
2023-05-30 12:57:46 +01:00
2023-04-20 12:10:21 +02:00
2022-12-14 11:32:01 +01:00
2023-02-22 12:55:58 +01:00
2023-04-26 11:27:41 +02:00
2023-05-17 11:48:10 +02:00
2023-05-30 12:57:46 +01:00
2022-04-13 21:01:00 +02:00
2023-05-30 12:57:46 +01:00
2023-02-15 17:22:12 +01:00
2023-03-17 08:45:07 +01:00
2023-02-22 12:55:57 +01:00
2023-05-17 11:48:11 +02:00
2022-01-11 15:25:01 +01:00
2023-04-20 12:10:26 +02:00
2023-03-11 16:39:26 +01:00
2023-02-22 12:55:53 +01:00
2023-05-17 11:48:11 +02:00
2023-05-17 11:48:11 +02:00
2023-04-26 11:27:42 +02:00
2023-05-30 12:57:46 +01:00
2021-11-18 14:04:27 +01:00
2023-05-17 11:48:03 +02:00
2023-05-30 12:57:46 +01:00
2023-05-30 12:57:46 +01:00
2022-12-14 11:32:01 +01:00
2023-01-14 10:15:42 +01:00
2023-03-13 10:19:36 +01:00
2023-02-15 17:22:15 +01:00
2023-05-17 11:47:50 +02:00
2023-03-22 13:29:55 +01:00
2021-06-18 10:00:06 +02:00
2023-05-30 12:57:46 +01:00