Jason A. Donenfeld
2fe3d6d205
wireguard: queueing: annotate intentional data race in cpu round robin
KCSAN reports a race in the CPU round robin function, which, as the
comment points out, is intentional:
BUG: KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
read to 0xffff88811254eb28 of 4 bytes by task 3160 on cpu 1:
wg_cpumask_next_online drivers/net/wireguard/queueing.h:127 [inline]
wg_queue_enqueue_per_device_and_peer drivers/net/wireguard/queueing.h:173 [inline]
wg_packet_create_data drivers/net/wireguard/send.c:320 [inline]
wg_packet_send_staged_packets+0x60e/0xac0 drivers/net/wireguard/send.c:388
wg_packet_send_keepalive+0xe2/0x100 drivers/net/wireguard/send.c:239
wg_receive_handshake_packet drivers/net/wireguard/receive.c:186 [inline]
wg_packet_handshake_receive_worker+0x449/0x5f0 drivers/net/wireguard/receive.c:213
process_one_work kernel/workqueue.c:3248 [inline]
process_scheduled_works+0x483/0x9a0 kernel/workqueue.c:3329
worker_thread+0x526/0x720 kernel/workqueue.c:3409
kthread+0x1d1/0x210 kernel/kthread.c:389
ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
write to 0xffff88811254eb28 of 4 bytes by task 3158 on cpu 0:
wg_cpumask_next_online drivers/net/wireguard/queueing.h:130 [inline]
wg_queue_enqueue_per_device_and_peer drivers/net/wireguard/queueing.h:173 [inline]
wg_packet_create_data drivers/net/wireguard/send.c:320 [inline]
wg_packet_send_staged_packets+0x6e5/0xac0 drivers/net/wireguard/send.c:388
wg_packet_send_keepalive+0xe2/0x100 drivers/net/wireguard/send.c:239
wg_receive_handshake_packet drivers/net/wireguard/receive.c:186 [inline]
wg_packet_handshake_receive_worker+0x449/0x5f0 drivers/net/wireguard/receive.c:213
process_one_work kernel/workqueue.c:3248 [inline]
process_scheduled_works+0x483/0x9a0 kernel/workqueue.c:3329
worker_thread+0x526/0x720 kernel/workqueue.c:3409
kthread+0x1d1/0x210 kernel/kthread.c:389
ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
value changed: 0xffffffff -> 0x00000000
Mark this race as intentional by using READ/WRITE_ONCE().
Cc: stable@vger.kernel.org
Fixes: e7096c131e ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Link: https://patch.msgid.link/20240704154517.1572127-4-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-05 17:21:10 -07:00
..
2024-07-03 19:36:02 -07:00
2024-05-22 08:31:17 -04:00
2024-07-01 08:55:16 +02:00
2024-07-04 19:19:21 -07:00
2024-07-05 17:13:57 -07:00
2024-05-22 20:14:47 -04:00
2024-05-22 20:14:47 -04:00
2024-05-30 12:05:52 +02:00
2024-06-10 11:51:04 +01:00
2024-05-13 16:37:18 -07:00
2024-07-02 18:17:33 -07:00
2024-05-07 11:14:50 +02:00
2024-06-21 11:29:52 +01:00
2024-05-07 16:19:14 -07:00
2024-05-07 16:19:14 -07:00
2024-06-26 07:27:27 -07:00
2024-06-03 18:49:33 -07:00
2024-06-21 17:34:15 -07:00
2024-07-05 17:21:10 -07:00
2024-07-03 16:06:54 +02:00
2024-06-06 10:15:14 +02:00
2024-05-07 16:19:14 -07:00
2024-06-10 13:18:08 +01:00
2024-05-07 01:36:02 +02:00
2024-05-07 16:19:14 -07:00
2024-05-07 16:19:14 -07:00
2024-05-20 11:04:29 +01:00
2024-05-07 16:19:14 -07:00
2024-05-25 10:48:57 -07:00
2024-07-02 18:56:46 -07:00
2024-05-13 12:48:06 -07:00
2024-05-03 16:05:53 -07:00
2024-06-19 10:52:44 +01:00
2024-05-07 16:19:14 -07:00
2024-05-07 16:19:14 -07:00