Eric Dumazet
e3bcf2a770
netlink: annotate lockless accesses to nlk->max_recvmsg_len
...
[ Upstream commit a1865f2e7d10dde00d35a2122b38d2e469ae67ed ]
syzbot reported a data-race in data-race in netlink_recvmsg() [1]
Indeed, netlink_recvmsg() can be run concurrently,
and netlink_dump() also needs protection.
[1]
BUG: KCSAN: data-race in netlink_recvmsg / netlink_recvmsg
read to 0xffff888141840b38 of 8 bytes by task 23057 on cpu 0:
netlink_recvmsg+0xea/0x730 net/netlink/af_netlink.c:1988
sock_recvmsg_nosec net/socket.c:1017 [inline]
sock_recvmsg net/socket.c:1038 [inline]
__sys_recvfrom+0x1ee/0x2e0 net/socket.c:2194
__do_sys_recvfrom net/socket.c:2212 [inline]
__se_sys_recvfrom net/socket.c:2208 [inline]
__x64_sys_recvfrom+0x78/0x90 net/socket.c:2208
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
write to 0xffff888141840b38 of 8 bytes by task 23037 on cpu 1:
netlink_recvmsg+0x114/0x730 net/netlink/af_netlink.c:1989
sock_recvmsg_nosec net/socket.c:1017 [inline]
sock_recvmsg net/socket.c:1038 [inline]
____sys_recvmsg+0x156/0x310 net/socket.c:2720
___sys_recvmsg net/socket.c:2762 [inline]
do_recvmmsg+0x2e5/0x710 net/socket.c:2856
__sys_recvmmsg net/socket.c:2935 [inline]
__do_sys_recvmmsg net/socket.c:2958 [inline]
__se_sys_recvmmsg net/socket.c:2951 [inline]
__x64_sys_recvmmsg+0xe2/0x160 net/socket.c:2951
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: 0x0000000000000000 -> 0x0000000000001000
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 23037 Comm: syz-executor.2 Not tainted 6.3.0-rc4-syzkaller-00195-g5a57b48fdfcb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Fixes: 9063e21fb026 ("netlink: autosize skb lengthes")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230403214643.768555-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-13 16:55:24 +02:00
..
2023-03-22 13:33:54 +01:00
2022-12-31 13:33:02 +01:00
2022-08-25 10:33:21 +02:00
2022-10-15 11:08:36 +01:00
2022-08-22 17:55:50 -07:00
2022-09-22 13:02:10 -07:00
2023-03-30 12:49:22 +02:00
2023-03-17 08:50:32 +01:00
2023-03-11 13:55:24 +01:00
2023-03-17 08:50:24 +01:00
2023-04-06 12:10:52 +02:00
2023-02-09 11:28:04 +01:00
2023-04-13 16:55:21 +02:00
2023-02-22 12:59:52 +01:00
2023-03-30 12:49:09 +02:00
2022-08-25 10:33:21 +02:00
2023-04-13 16:55:24 +02:00
2023-04-06 12:10:58 +02:00
2022-10-07 09:29:17 +02:00
2023-04-13 16:55:24 +02:00
2023-04-13 16:55:23 +02:00
2023-03-22 13:33:50 +01:00
2022-11-15 12:42:26 +01:00
2022-11-22 07:14:55 +01:00
2023-04-13 16:55:20 +02:00
2023-04-13 16:55:19 +02:00
2022-12-05 09:53:08 +01:00
2023-02-06 08:06:34 +01:00
2023-02-22 12:59:53 +01:00
2023-03-30 12:49:00 +02:00
2022-08-29 12:47:15 +01:00
2023-03-22 13:33:42 +01:00
2022-08-29 12:47:15 +01:00
2023-04-13 16:55:24 +02:00
2023-02-09 11:28:06 +01:00
2023-03-17 08:50:17 +01:00
2023-02-22 12:59:52 +01:00
2022-11-29 08:30:18 -08:00
2022-08-29 12:47:15 +01:00
2023-04-13 16:55:21 +02:00
2023-03-10 09:33:02 +01:00
2023-02-22 12:59:42 +01:00
2022-12-31 13:32:55 +01:00
2023-03-30 12:49:20 +02:00
2023-04-13 16:55:21 +02:00
2023-03-22 13:33:47 +01:00
2022-07-08 18:38:44 -07:00
2023-04-13 16:55:23 +02:00
2023-02-22 12:59:53 +01:00
2023-03-17 08:50:26 +01:00
2023-03-17 08:50:28 +01:00
2022-12-31 13:32:26 +01:00
2023-03-22 13:33:43 +01:00
2023-02-09 11:28:13 +01:00
2023-03-30 12:49:02 +02:00
2023-04-06 12:10:37 +02:00
2023-02-09 11:28:04 +01:00
2022-08-22 14:26:30 +01:00
2022-09-20 14:23:56 -07:00
2022-08-22 14:26:30 +01:00
2023-03-10 09:34:34 +01:00