Eric Dumazet
4781a75d34
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>
2023-11-20 11:58:56 +01:00
..
2023-08-09 15:32:43 -07:00
2023-08-18 12:44:56 -07:00
2023-06-24 15:50:13 -07:00
2023-06-24 15:50:13 -07:00
2023-09-18 12:56:58 +01:00
2023-08-24 10:51:39 -07:00
2023-10-13 20:06:33 -07:00
2023-08-30 08:36:17 +02:00
2023-05-31 13:06:57 +02:00
2023-10-01 17:14:37 +01:00
2023-06-24 15:50:13 -07:00
2023-10-06 12:54:33 +02:00
2023-10-09 13:35:24 +02:00
2023-10-20 17:41:29 -07:00
2023-08-01 21:07:46 -07:00
2023-09-18 07:10:31 +01:00
2023-10-06 15:56:46 -07:00
2023-08-09 13:08:09 -07:00
2023-10-19 09:27:12 -07:00
2023-10-23 10:19:33 -07:00
2023-09-18 08:26:19 +01:00
2023-08-29 17:39:15 -07:00
2023-11-20 11:58:56 +01:00
2023-11-20 11:58:56 +01:00
2023-09-14 10:43:51 +02:00
2023-08-18 12:44:56 -07:00
2023-11-20 11:58:56 +01:00
2023-08-09 15:34:28 -07:00
2023-11-20 11:58:55 +01:00
2023-06-24 15:41:46 -07:00
2023-10-10 19:43:22 -07:00
2023-08-15 15:26:18 -07:00
2023-10-19 09:10:00 -07:00
2023-09-18 07:06:05 +01:00
2023-10-25 11:35:46 +02:00
2023-08-02 12:28:22 -07:00
2023-10-04 17:32:54 -07:00
2023-08-28 06:58:46 +01:00
2023-10-16 17:34:53 -07:00
2023-06-10 00:11:41 -07:00
2023-08-18 12:44:56 -07:00
2023-10-12 09:15:15 +02:00
2023-06-24 15:50:13 -07:00
2023-07-17 09:02:30 +01:00
2023-10-01 19:31:29 +01:00
2023-10-11 16:55:10 +02:00
2023-06-24 15:50:13 -07:00
2023-06-28 16:43:10 -07:00
2023-10-25 11:35:57 +02:00
2023-10-04 17:29:58 -07:00
2023-10-16 16:37:40 -07:00
2023-09-27 15:16:40 -04:00
2023-07-21 08:54:03 +01:00
2023-10-04 13:24:12 -07:00
2023-10-13 16:49:32 -07:00
2023-09-07 18:33:07 -07:00
2023-10-25 15:49:47 -07:00
2023-11-20 11:58:55 +01:00
2023-06-24 15:50:13 -07:00
2023-10-09 16:13:29 +02:00
2023-10-17 18:21:13 -07:00
2023-07-19 10:07:27 -07:00
2023-10-01 19:31:29 +01:00
2023-08-15 15:26:17 -07:00