Eric Dumazet
caf122caad
net-timestamp: convert sk->sk_tskey to atomic_t
[ Upstream commit a1cdec57e03a1352e92fbbe7974039dda4efcec0 ]
UDP sendmsg() can be lockless, this is causing all kinds
of data races.
This patch converts sk->sk_tskey to remove one of these races.
BUG: KCSAN: data-race in __ip_append_data / __ip_append_data
read to 0xffff8881035d4b6c of 4 bytes by task 8877 on cpu 1:
__ip_append_data+0x1c1/0x1de0 net/ipv4/ip_output.c:994
ip_make_skb+0x13f/0x2d0 net/ipv4/ip_output.c:1636
udp_sendmsg+0x12bd/0x14c0 net/ipv4/udp.c:1249
inet_sendmsg+0x5f/0x80 net/ipv4/af_inet.c:819
sock_sendmsg_nosec net/socket.c:705 [inline]
sock_sendmsg net/socket.c:725 [inline]
____sys_sendmsg+0x39a/0x510 net/socket.c:2413
___sys_sendmsg net/socket.c:2467 [inline]
__sys_sendmmsg+0x267/0x4c0 net/socket.c:2553
__do_sys_sendmmsg net/socket.c:2582 [inline]
__se_sys_sendmmsg net/socket.c:2579 [inline]
__x64_sys_sendmmsg+0x53/0x60 net/socket.c:2579
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
write to 0xffff8881035d4b6c of 4 bytes by task 8880 on cpu 0:
__ip_append_data+0x1d8/0x1de0 net/ipv4/ip_output.c:994
ip_make_skb+0x13f/0x2d0 net/ipv4/ip_output.c:1636
udp_sendmsg+0x12bd/0x14c0 net/ipv4/udp.c:1249
inet_sendmsg+0x5f/0x80 net/ipv4/af_inet.c:819
sock_sendmsg_nosec net/socket.c:705 [inline]
sock_sendmsg net/socket.c:725 [inline]
____sys_sendmsg+0x39a/0x510 net/socket.c:2413
___sys_sendmsg net/socket.c:2467 [inline]
__sys_sendmmsg+0x267/0x4c0 net/socket.c:2553
__do_sys_sendmmsg net/socket.c:2582 [inline]
__se_sys_sendmmsg net/socket.c:2579 [inline]
__x64_sys_sendmmsg+0x53/0x60 net/socket.c:2579
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
value changed: 0x0000054d -> 0x0000054e
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 8880 Comm: syz-executor.5 Not tainted 5.17.0-rc2-syzkaller-00167-gdcb85f85fa6f-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Fixes: 09c2d251b7 ("net-timestamp: add key to disambiguate concurrent datagrams")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@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>
2022-03-02 11:51:10 +01:00
..
2021-11-04 21:04:25 +09:00
2022-01-16 09:11:13 +01:00
2021-07-01 13:19:48 -07:00
2022-03-02 11:50:54 +01:00
2022-02-23 12:05:56 +01:00
2021-11-17 20:17:05 -08:00
2022-01-02 12:46:41 +00:00
2021-06-01 16:54:42 -07:00
2021-10-18 12:54:41 +01:00
2022-02-23 12:05:55 +01:00
2021-04-23 10:17:26 +01:00
2021-08-16 18:43:39 -07:00
2021-06-11 13:32:46 -07:00
2021-11-01 13:36:09 +00:00
2021-10-13 09:40:45 -07:00
2021-08-03 13:05:25 +01:00
2022-02-23 12:05:57 +01:00
2021-12-03 14:16:48 +00:00
2021-08-03 11:50:22 +01:00
2021-08-11 14:57:31 -07:00
2021-12-03 14:15:49 +00:00
2021-10-28 10:43:58 -07:00
2022-03-02 11:51:04 +01:00
2021-10-20 15:24:36 -07:00
2021-10-20 15:24:36 -07:00
2021-08-05 11:46:42 +01:00
2021-10-13 09:40:46 -07:00
2021-11-01 13:26:07 +00:00
2021-07-30 15:33:24 +02:00
2021-10-13 09:40:46 -07:00
2022-02-23 12:05:56 +01:00
2021-11-29 19:50:45 -08:00
2022-02-16 12:58:38 +01:00
2021-07-29 12:18:11 +01:00
2021-11-29 14:43:35 +00:00
2021-10-29 14:03:22 +01:00
2021-08-19 18:09:18 -07:00
2021-09-02 11:44:19 +01:00
2021-10-18 12:54:41 +01:00
2021-06-28 14:29:45 -07:00
2021-08-13 09:58:25 +02:00
2021-08-27 17:29:18 -07:00
2021-10-15 11:28:34 +01:00
2021-10-15 11:33:08 +01:00
2022-01-27 12:02:59 +01:00
2021-07-23 16:44:57 -07:00
2021-10-25 18:02:12 -07:00
2021-10-04 12:53:35 +01:00
2022-02-23 12:05:55 +01:00
2021-08-05 15:08:47 -07:00
2021-12-02 11:56:04 +00:00
2021-07-27 20:11:44 +01:00
2021-10-07 19:52:58 +02:00
2022-02-01 17:29:11 +01:00
2022-01-27 12:02:59 +01:00
2021-11-22 15:44:49 +00:00
2022-02-23 12:05:56 +01:00
2021-10-13 09:40:46 -07:00
2021-07-27 13:05:56 +01:00
2021-11-07 19:25:29 +00:00
2021-08-30 01:51:36 +02:00
2021-10-22 10:20:56 -07:00
2021-06-24 12:41:12 -07:00
2021-10-29 13:23:51 +01:00
2021-10-29 13:23:51 +01:00
2021-03-26 15:14:56 -07:00
2021-10-28 10:43:58 -07:00
2021-10-13 09:40:46 -07:00
2022-02-08 18:35:15 +01:00
2021-08-01 12:00:51 +02:00
2021-07-27 11:43:50 +01:00
2021-09-24 14:07:10 +01:00
2021-11-16 18:02:46 +01:00
2021-11-18 11:29:40 +00:00
2021-10-19 12:24:51 +01:00
2022-01-27 12:02:01 +01:00
2021-05-17 15:29:35 -07:00
2021-08-09 15:34:21 -07:00
2021-10-13 09:40:45 -07:00
2022-02-01 17:29:18 +01:00
2021-08-04 10:01:26 +01:00
2022-01-27 12:03:01 +01:00
2022-01-04 12:17:35 +00:00
2021-04-28 14:06:45 -07:00
2021-06-15 18:01:05 +02:00
2022-03-02 11:51:10 +01:00
2021-08-03 13:05:26 +01:00
2021-11-09 01:05:34 +01:00
2021-10-27 14:54:02 +01:00
2021-11-03 11:19:49 +00:00
2021-10-28 10:43:58 -07:00
2021-10-26 13:09:22 +01:00
2021-09-28 00:18:34 +02:00
2021-06-24 19:41:15 +02:00
2021-09-30 23:23:49 +02:00
2022-01-27 12:02:47 +01:00
2021-09-28 00:18:35 +02:00