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