Eric Dumazet
482521d8e0
udp: annotate data-races around up->pending
up->pending can be read without holding the socket lock,
as pointed out by syzbot [1]
Add READ_ONCE() in lockless contexts, and WRITE_ONCE()
on write side.
[1]
BUG: KCSAN: data-race in udpv6_sendmsg / udpv6_sendmsg
write to 0xffff88814e5eadf0 of 4 bytes by task 15547 on cpu 1:
udpv6_sendmsg+0x1405/0x1530 net/ipv6/udp.c:1596
inet6_sendmsg+0x63/0x80 net/ipv6/af_inet6.c:657
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
__sys_sendto+0x257/0x310 net/socket.c:2192
__do_sys_sendto net/socket.c:2204 [inline]
__se_sys_sendto net/socket.c:2200 [inline]
__x64_sys_sendto+0x78/0x90 net/socket.c:2200
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
read to 0xffff88814e5eadf0 of 4 bytes by task 15551 on cpu 0:
udpv6_sendmsg+0x22c/0x1530 net/ipv6/udp.c:1373
inet6_sendmsg+0x63/0x80 net/ipv6/af_inet6.c:657
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x37c/0x4d0 net/socket.c:2586
___sys_sendmsg net/socket.c:2640 [inline]
__sys_sendmmsg+0x269/0x500 net/socket.c:2726
__do_sys_sendmmsg net/socket.c:2755 [inline]
__se_sys_sendmmsg net/socket.c:2752 [inline]
__x64_sys_sendmmsg+0x57/0x60 net/socket.c:2752
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
value changed: 0x00000000 -> 0x0000000a
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 15551 Comm: syz-executor.1 Tainted: G W 6.7.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: syzbot+8d482d0e407f665d9d10@syzkaller.appspotmail.com
Link: https://lore.kernel.org/netdev/0000000000009e46c3060ebcdffd@google.com/
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-01-13 15:46:20 +00:00
..
2023-11-09 17:09:35 -08:00
2023-12-13 18:30:24 -08:00
2023-10-27 18:04:29 +08:00
2023-03-15 00:37:32 -07:00
2023-12-19 08:23:03 -08:00
2023-08-16 11:09:17 +01:00
2023-10-01 19:39:19 +01:00
2023-09-08 08:02:17 +01:00
2023-10-06 07:30:40 +02:00
2023-10-25 10:38:07 +01:00
2023-03-16 17:26:31 -07:00
2024-01-03 16:42:48 -08:00
2023-10-18 18:11:31 -07:00
2023-12-27 11:50:20 -05:00
2023-11-01 22:33:53 -07:00
2023-04-12 16:40:39 -07:00
2023-05-26 10:30:14 +01:00
2023-05-26 10:30:14 +01:00
2023-06-10 00:11:41 -07:00
2023-10-06 08:31:53 +02:00
2023-11-24 15:25:56 +00:00
2023-12-22 22:15:35 +00:00
2023-12-22 22:15:35 +00:00
2022-10-31 20:14:27 -07:00
2023-12-22 22:15:35 +00:00
2023-12-22 22:15:35 +00:00
2022-07-08 12:10:33 +01:00
2023-10-13 09:58:45 -07:00
2023-08-15 15:26:18 -07:00
2023-12-06 10:08:05 +01:00
2023-09-01 08:11:51 +01:00
2023-10-20 12:01:00 +01:00
2024-01-04 10:23:10 -08:00
2023-08-04 18:24:52 -07:00
2023-04-13 16:43:38 -07:00
2023-10-06 08:31:53 +02:00
2022-09-29 07:18:00 +02:00
2023-05-22 11:17:55 +01:00
2023-04-12 16:40:39 -07:00
2022-06-24 11:34:38 +01:00
2024-01-03 16:42:48 -08:00
2023-10-27 10:35:44 +01:00
2024-01-04 10:23:10 -08:00
2023-01-23 21:37:25 -08:00
2023-10-06 08:31:53 +02:00
2023-08-15 18:54:53 -07:00
2023-10-16 21:05:33 -07:00
2023-10-27 10:35:45 +01:00
2023-11-19 20:09:13 +00:00
2023-10-01 19:39:19 +01:00
2023-11-21 12:55:22 +01:00
2023-11-29 20:16:38 -08:00
2023-12-08 10:44:42 -08:00
2023-12-07 17:53:17 -08:00
2023-10-01 19:09:54 +01:00
2022-04-06 12:05:41 -07:00
2023-10-18 18:09:31 -07:00
2022-10-16 15:27:07 -07:00
2023-03-22 22:53:00 -07:00
2023-02-02 00:25:14 +01:00
2023-02-02 00:25:14 +01:00
2023-11-19 20:09:13 +00:00
2023-08-16 11:09:18 +01:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2023-12-14 17:14:41 -08:00
2024-01-08 19:08:51 -08:00
2023-10-23 09:35:01 +01:00
2023-10-03 10:05:22 +02:00
2023-12-06 12:36:55 +01:00
2022-04-06 12:05:41 -07:00
2023-06-10 00:11:41 -07:00
2023-12-12 15:56:02 -08:00
2022-12-20 03:13:45 +01:00
2022-04-28 13:02:01 -07:00
2023-10-17 17:25:42 -07:00
2022-04-06 12:05:41 -07:00
2024-01-01 14:42:05 +00:00
2023-11-16 23:35:12 +00:00
2023-01-19 09:26:16 -08:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2024-01-11 10:07:29 -08:00
2023-03-03 17:25:15 +01:00
2023-11-19 20:09:13 +00:00
2023-06-24 15:50:13 -07:00
2023-09-14 16:16:36 +02:00
2023-10-16 09:57:52 +01:00
2023-10-03 11:39:34 +02:00
2024-01-13 15:46:20 +00:00
2023-09-14 16:16:36 +02:00
2023-10-23 07:10:39 +02:00
2023-08-29 17:39:15 -07:00
2022-06-08 10:10:13 -07:00
2022-09-29 07:18:00 +02:00