Eric Dumazet
70a36f5713
udp: annotate data-races around udp->encap_type
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: 1da177e4c3 ("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>
2023-09-14 16:16:36 +02:00
..
2023-08-24 07:26:06 +10:00
2023-09-04 15:17:28 -07:00
2023-08-22 15:50:57 +02:00
2023-09-01 09:53:54 -07:00
2023-09-05 12:37:28 -07:00
2023-08-30 13:34:34 -07:00
2023-09-01 09:43:18 -07:00
2023-09-06 12:10:15 -07:00
2023-09-01 09:38:00 -07:00
2023-09-01 09:53:54 -07:00
2023-09-04 21:57:59 +03:00
2023-08-30 19:53:39 -07:00
2023-09-04 13:15:57 -07:00
2023-09-04 13:47:59 -07:00
2023-08-29 20:51:40 +02:00
2023-08-31 12:43:10 -07:00
2023-08-29 11:23:29 -07:00
2023-08-24 16:20:30 -07:00
2023-09-03 10:49:42 -07:00
2023-08-30 13:34:34 -07:00
2023-08-30 19:23:00 -07:00
2023-09-01 09:53:54 -07:00
2023-08-22 15:51:33 +02:00
2023-08-30 16:42:21 -07:00
2023-08-29 10:21:56 -07:00
2023-09-07 13:52:20 -07:00
2023-09-01 12:31:44 -07:00
2023-08-28 13:31:06 -05:00
2023-09-04 11:26:29 -07:00
2023-09-01 09:53:54 -07:00
2023-08-18 16:42:26 +01:00
2023-09-04 13:44:11 -07:00
2023-09-06 01:21:47 +02:00
2023-08-28 16:35:01 -07:00
2023-09-01 09:53:54 -07:00
2023-09-02 12:02:41 -07:00
2023-09-06 09:24:25 -07:00
2023-08-30 19:53:39 -07:00
2023-09-01 16:54:25 -07:00
2023-08-30 20:05:42 -07:00
2023-08-20 14:29:37 +02:00
2023-09-04 13:52:58 -07:00
2023-08-31 12:43:10 -07:00
2023-09-05 10:11:01 -05:00
2023-08-29 20:21:42 -07:00
2023-09-01 12:21:32 -07:00
2023-08-29 09:47:33 -07:00
2023-09-01 09:53:54 -07:00
2023-09-01 09:38:00 -07:00
2023-09-04 13:47:59 -07:00
2023-08-28 13:36:24 -05:00
2023-09-14 16:16:36 +02:00
2023-08-30 18:32:24 -07:00
2023-08-30 20:52:08 -07:00
2023-08-29 20:21:42 -07:00
2023-08-23 16:34:02 +02:00
2023-08-30 16:59:03 -07:00
2023-08-18 10:55:49 +05:30
2023-08-28 18:00:27 +02:00
2023-09-01 09:38:00 -07:00
2023-08-31 12:43:10 -07:00
2023-09-07 13:52:20 -07:00
2023-09-03 10:38:02 -07:00
2023-08-30 19:36:19 -07:00
2023-09-01 09:23:34 -07:00
2023-08-17 19:38:35 +02:00
2023-08-28 18:04:39 -07:00
2023-09-07 18:05:58 -07:00
2023-09-07 15:51:07 -07:00
2023-09-04 15:12:26 -07:00
2023-08-30 19:53:39 -07:00
2023-09-04 15:08:52 -07:00
2023-09-07 16:07:35 -07:00
2023-09-07 10:52:13 -07:00
2023-08-28 13:36:24 -05:00
2023-09-05 12:37:28 -07:00
2023-08-30 19:53:39 -07:00
2023-09-03 10:20:57 -07:00
2023-09-07 15:49:20 -07:00
2023-09-07 18:05:58 -07:00
2023-09-02 12:02:41 -07:00
2023-08-29 20:48:35 +02:00
2023-08-22 14:22:35 +02:00
2023-09-01 09:38:00 -07:00
2023-09-02 08:25:19 +01:00
2023-08-22 13:41:55 +02:00
2023-09-07 10:35:14 -07:00
2023-09-04 10:43:44 -07:00
2023-08-30 20:41:37 -07:00
2023-09-03 18:10:22 -04:00
2023-09-06 09:00:37 -07:00
2023-08-24 16:20:18 -07:00
2023-09-03 18:10:24 -04:00
2023-09-06 09:19:12 -07:00
2023-08-29 20:32:10 -07:00
2023-08-21 13:27:44 +02:00
2023-08-30 16:37:00 -07:00