Eric Dumazet
158b71f3a9
udp: annotate data-races around udp->encap_type
...
[ Upstream commit 70a36f571362a8de8b8c02d21ae524fc776287f2 ]
syzbot/KCSAN complained about UDP_ENCAP_L2TPINUDP setsockopt() racing.
Add READ_ONCE()/WRITE_ONCE() to document races on this lockless field.
syzbot report was:
BUG: KCSAN: data-race in udp_lib_setsockopt / udp_lib_setsockopt
read-write to 0xffff8881083603fa of 1 bytes by task 16557 on cpu 0:
udp_lib_setsockopt+0x682/0x6c0
udp_setsockopt+0x73/0xa0 net/ipv4/udp.c:2779
sock_common_setsockopt+0x61/0x70 net/core/sock.c:3697
__sys_setsockopt+0x1c9/0x230 net/socket.c:2263
__do_sys_setsockopt net/socket.c:2274 [inline]
__se_sys_setsockopt net/socket.c:2271 [inline]
__x64_sys_setsockopt+0x66/0x80 net/socket.c:2271
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-write to 0xffff8881083603fa of 1 bytes by task 16554 on cpu 1:
udp_lib_setsockopt+0x682/0x6c0
udp_setsockopt+0x73/0xa0 net/ipv4/udp.c:2779
sock_common_setsockopt+0x61/0x70 net/core/sock.c:3697
__sys_setsockopt+0x1c9/0x230 net/socket.c:2263
__do_sys_setsockopt net/socket.c:2274 [inline]
__se_sys_setsockopt net/socket.c:2271 [inline]
__x64_sys_setsockopt+0x66/0x80 net/socket.c:2271
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: 0x01 -> 0x05
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 16554 Comm: syz-executor.5 Not tainted 6.5.0-rc7-syzkaller-00004-gf7757129e3de #0
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-10 17:10:28 +01:00
..
2023-03-17 08:50:25 +01:00
2024-01-10 17:10:27 +01:00
2022-09-29 07:17:59 +02:00
2023-10-10 22:00:42 +02:00
2022-09-10 17:27:32 -07:00
2022-07-08 12:10:33 +01:00
2023-08-30 16:11:02 +02:00
2023-09-19 12:28:08 +02:00
2023-06-28 11:12:29 +02:00
2023-10-25 12:03:06 +02:00
2023-03-22 13:33:50 +01:00
2022-02-17 11:44:20 -08:00
2021-09-28 17:32:56 -07:00
2022-04-30 15:12:58 +01:00
2023-10-25 12:03:11 +02:00
2023-10-25 12:03:11 +02:00
2022-08-29 12:47:15 +01:00
2022-08-25 10:33:21 +02:00
2023-04-13 16:55:21 +02:00
2023-12-08 08:51:17 +01:00
2023-10-25 12:03:12 +02:00
2023-08-11 12:08:14 +02:00
2022-04-30 15:12:58 +01:00
2023-11-28 17:07:04 +00:00
2023-07-27 08:50:45 +02:00
2022-07-08 12:10:33 +01:00
2022-07-15 11:49:55 +01:00
2022-03-03 14:38:48 +00:00
2023-12-13 18:39:09 +01:00
2023-09-19 12:28:01 +02:00
2022-01-29 17:53:07 +00:00
2024-01-10 17:10:23 +01:00
2024-01-10 17:10:23 +01:00
2023-08-16 18:27:27 +02:00
2023-03-22 13:33:46 +01:00
2023-08-23 17:52:32 +02:00
2022-09-29 07:18:00 +02:00
2022-08-04 11:31:20 -07:00
2022-10-03 07:59:06 +01:00
2022-06-24 11:34:38 +01:00
2022-09-22 13:02:10 -07:00
2022-11-16 13:02:04 +00:00
2023-02-01 08:34:45 +01:00
2022-05-16 13:03:29 +02:00
2023-10-10 22:00:42 +02:00
2023-04-13 16:55:24 +02:00
2022-09-20 10:21:49 -07:00
2023-04-13 16:55:23 +02:00
2023-08-11 12:08:15 +02:00
2023-12-03 07:32:07 +01:00
2023-11-20 11:51:54 +01:00
2023-10-19 23:08:54 +02:00
2022-07-21 20:59:42 -07:00
2022-04-06 12:05:41 -07:00
2023-10-25 12:03:13 +02:00
2022-10-16 15:27:07 -07:00
2022-04-07 20:33:15 -07:00
2022-07-21 20:59:42 -07:00
2022-07-21 20:59:42 -07:00
2022-09-20 10:21:49 -07:00
2023-07-27 08:50:49 +02: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-13 18:39:11 +01:00
2024-01-10 17:10:27 +01:00
2022-04-06 12:05:41 -07:00
2023-11-20 11:51:53 +01:00
2023-07-27 08:50:45 +02:00
2022-04-06 12:05:41 -07:00
2023-06-14 11:15:20 +02:00
2023-12-20 17:00:18 +01:00
2022-04-28 13:02:01 -07:00
2023-10-25 12:03:06 +02:00
2022-04-06 12:05:41 -07:00
2023-09-13 09:42:32 +02:00
2023-01-24 07:24:43 +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
2024-01-10 17:10:27 +01:00
2023-03-17 08:50:24 +01:00
2021-07-13 09:28:29 -07:00
2022-04-12 15:00:25 +02:00
2024-01-10 17:10:28 +01:00
2024-01-10 17:10:28 +01:00
2022-02-23 12:35:00 +00:00
2024-01-10 17:10:28 +01:00
2023-05-30 14:03:20 +01:00
2024-01-10 17:10:28 +01:00
2022-06-09 21:52:55 -07:00
2022-06-08 10:10:13 -07:00
2022-09-29 07:18:00 +02:00