Eric Dumazet
d95d6320ba
ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt
...
Because fib6_info_hw_flags_set() is called without any synchronization,
all accesses to gi6->offload, fi->trap and fi->offload_failed
need some basic protection like READ_ONCE()/WRITE_ONCE().
BUG: KCSAN: data-race in fib6_info_hw_flags_set / fib6_purge_rt
read to 0xffff8881087d5886 of 1 bytes by task 13953 on cpu 0:
fib6_drop_pcpu_from net/ipv6/ip6_fib.c:1007 [inline]
fib6_purge_rt+0x4f/0x580 net/ipv6/ip6_fib.c:1033
fib6_del_route net/ipv6/ip6_fib.c:1983 [inline]
fib6_del+0x696/0x890 net/ipv6/ip6_fib.c:2028
__ip6_del_rt net/ipv6/route.c:3876 [inline]
ip6_del_rt+0x83/0x140 net/ipv6/route.c:3891
__ipv6_dev_ac_dec+0x2b5/0x370 net/ipv6/anycast.c:374
ipv6_dev_ac_dec net/ipv6/anycast.c:387 [inline]
__ipv6_sock_ac_close+0x141/0x200 net/ipv6/anycast.c:207
ipv6_sock_ac_close+0x79/0x90 net/ipv6/anycast.c:220
inet6_release+0x32/0x50 net/ipv6/af_inet6.c:476
__sock_release net/socket.c:650 [inline]
sock_close+0x6c/0x150 net/socket.c:1318
__fput+0x295/0x520 fs/file_table.c:280
____fput+0x11/0x20 fs/file_table.c:313
task_work_run+0x8e/0x110 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop kernel/entry/common.c:175 [inline]
exit_to_user_mode_prepare+0x160/0x190 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x20/0x40 kernel/entry/common.c:300
do_syscall_64+0x50/0xd0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x44/0xae
write to 0xffff8881087d5886 of 1 bytes by task 1912 on cpu 1:
fib6_info_hw_flags_set+0x155/0x3b0 net/ipv6/route.c:6230
nsim_fib6_rt_hw_flags_set drivers/net/netdevsim/fib.c:668 [inline]
nsim_fib6_rt_add drivers/net/netdevsim/fib.c:691 [inline]
nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:756 [inline]
nsim_fib6_event drivers/net/netdevsim/fib.c:853 [inline]
nsim_fib_event drivers/net/netdevsim/fib.c:886 [inline]
nsim_fib_event_work+0x284f/0x2cf0 drivers/net/netdevsim/fib.c:1477
process_one_work+0x3f6/0x960 kernel/workqueue.c:2307
worker_thread+0x616/0xa70 kernel/workqueue.c:2454
kthread+0x2c7/0x2e0 kernel/kthread.c:327
ret_from_fork+0x1f/0x30
value changed: 0x22 -> 0x2a
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 1912 Comm: kworker/1:3 Not tainted 5.16.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events nsim_fib_event_work
Fixes: 0c5fcf9e249e ("IPv6: Add "offload failed" indication to routes")
Fixes: bb3c4ab93e44 ("ipv6: Add "offload" and "trap" indications to routes")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Amit Cohen <amcohen@nvidia.com>
Cc: Ido Schimmel <idosch@nvidia.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Link: https://lore.kernel.org/r/20220216173217.3792411-2-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-02-17 09:48:24 -08:00
..
2022-01-10 10:00:09 +09:00
2022-01-06 14:57:09 +01:00
2021-07-01 13:19:48 -07:00
2021-11-19 11:52:25 +00:00
2022-01-09 15:59:23 -08:00
2022-02-16 20:37:47 -08:00
2021-11-17 20:17:05 -08:00
2019-06-05 17:37:07 +02:00
2022-01-05 14:36:10 -08:00
2021-12-19 14:08:47 +00:00
2020-02-28 14:51:30 +01:00
2021-12-19 14:08:48 +00:00
2022-02-14 13:30:37 +00:00
2019-05-30 11:26:41 -07:00
2021-04-23 10:17:26 +01:00
2021-11-26 18:01:58 -08:00
2021-06-11 13:32:46 -07:00
2021-11-01 13:36:09 +00:00
2021-11-23 11:51:37 +00:00
2022-02-03 14:20:36 -08:00
2021-08-03 13:05:25 +01:00
2021-12-13 12:34:09 +00:00
2022-02-15 14:35:18 +00:00
2021-12-03 14:16:48 +00:00
2021-11-30 12:15:58 +00:00
2022-01-24 11:57:38 +00:00
2021-03-26 17:43:55 +01:00
2021-12-03 14:15:49 +00:00
2019-05-21 11:28:45 +02:00
2019-06-19 17:09:55 +02:00
2021-12-20 10:41:26 +01:00
2020-02-29 14:39:08 +01:00
2021-12-06 16:26:46 -08:00
2020-07-15 07:45:24 -07:00
2020-03-27 19:40:38 -07:00
2021-12-22 15:03:47 -08:00
2021-12-22 15:03:51 -08:00
2021-12-22 15:03:51 -08:00
2021-08-05 11:46:42 +01:00
2021-10-13 09:40:46 -07:00
2019-05-30 11:29:52 -07:00
2019-05-30 11:29:52 -07:00
2021-12-21 19:08:54 -08:00
2021-07-30 15:33:24 +02:00
2019-05-21 11:52:39 +02:00
2019-05-21 11:52:39 +02:00
2021-10-13 09:40:46 -07:00
2022-02-14 13:31:12 +00:00
2019-12-16 16:09:44 -08:00
2021-11-29 19:50:45 -08:00
2022-02-09 11:41:47 +00:00
2020-05-08 21:33:33 -07:00
2021-12-06 16:05:10 -08:00
2020-05-05 13:23:29 -07:00
2020-02-19 13:52:32 +01:00
2020-04-20 07:34:16 +02:00
2019-06-19 17:09:55 +02:00
2021-12-06 16:06:02 -08:00
2019-12-24 22:37:30 -08:00
2021-12-16 07:18:35 -08:00
2021-10-29 14:03:22 +01:00
2021-12-19 14:08:48 +00:00
2021-09-02 11:44:19 +01:00
2021-01-21 13:33:45 +01:00
2021-01-21 13:33:45 +01:00
2019-12-09 10:36:44 -08:00
2021-10-18 12:54:41 +01:00
2021-02-12 16:31:46 -08:00
2019-03-22 12:09:31 -07:00
2021-01-29 20:39:14 -08:00
2021-12-06 16:26:46 -08:00
2020-06-22 21:12:44 -07:00
2019-10-25 16:24:32 -07:00
2021-06-28 14:29:45 -07:00
2021-08-13 09:58:25 +02:00
2019-05-30 11:26:41 -07:00
2021-12-06 16:05:11 -08:00
2019-04-22 21:50:53 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-03-30 13:45:04 -07:00
2021-01-27 18:18:15 -08:00
2021-11-23 20:16:18 -08:00
2021-10-15 11:33:08 +01:00
2022-01-13 13:06:05 +00:00
2021-07-23 16:44:57 -07:00
2021-11-17 20:21:52 -08:00
2019-09-27 12:05:02 +02:00
2019-02-08 21:50:15 -08:00
2021-10-04 12:53:35 +01:00
2021-11-16 13:16:54 +00:00
2022-02-17 09:48:24 -08:00
2021-11-19 20:09:55 -08:00
2021-12-06 16:05:11 -08:00
2021-12-07 20:44:59 -08:00
2021-12-06 16:05:11 -08:00
2021-10-07 19:52:58 +02:00
2022-01-27 08:37:02 -08:00
2022-01-13 13:06:05 +00:00
2021-11-22 15:44:49 +00:00
2022-02-16 20:37:47 -08:00
2019-06-19 17:09:55 +02:00
2020-06-20 17:22:22 -07:00
2021-03-23 14:14:50 -07:00
2021-12-07 20:44:59 -08:00
2021-10-13 09:40:46 -07:00
2021-07-27 13:05:56 +01:00
2021-11-07 19:25:29 +00:00
2021-08-30 01:51:36 +02:00
2022-01-04 15:47:15 +01:00
2019-05-30 11:26:41 -07:00
2021-06-24 12:41:12 -07:00
2021-10-29 13:23:51 +01:00
2021-10-29 13:23:51 +01:00
2020-03-02 11:16:27 -08:00
2021-03-26 15:14:56 -07:00
2020-02-28 12:08:37 -08:00
2020-05-29 21:20:20 -07:00
2021-10-28 10:43:58 -07:00
2019-12-09 10:36:44 -08:00
2021-11-23 11:51:37 +00:00
2022-02-02 20:30:18 -08:00
2021-12-10 06:38:26 -08:00
2021-12-10 06:38:26 -08:00
2019-05-21 11:28:45 +02:00
2021-07-27 11:43:50 +01:00
2019-11-12 08:18:03 -08:00
2019-04-11 13:59:49 -07:00
2021-09-24 14:07:10 +01:00
2021-11-16 18:02:46 +01:00
2022-01-05 19:46:32 -08:00
2020-03-04 13:25:55 -08:00
2019-05-30 11:26:32 -07:00
2022-01-11 20:40:16 -08:00
2022-01-09 16:24:12 -08:00
2021-05-17 15:29:35 -07:00
2021-08-09 15:34:21 -07:00
2019-05-30 11:26:32 -07:00
2021-03-25 17:40:43 -07:00
2020-07-31 09:24:23 +02:00
2020-08-24 14:35:00 -07:00
2021-10-13 09:40:45 -07:00
2022-01-27 08:38:33 -08:00
2020-06-23 20:27:09 -07:00
2021-08-04 10:01:26 +01:00
2019-04-22 21:47:25 -07:00
2022-01-13 11:06:42 -08:00
2020-07-13 11:03:44 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2022-01-04 12:17:35 +00:00
2021-04-28 14:06:45 -07:00
2020-09-28 15:19:03 -07:00
2019-10-05 16:29:00 -07:00
2021-06-15 18:01:05 +02:00
2022-01-06 17:08:35 -08:00
2021-08-03 13:05:26 +01:00
2021-11-09 01:05:34 +01:00
2021-10-27 14:54:02 +01:00
2019-05-30 11:26:32 -07:00
2022-01-20 20:17:32 -08:00
2019-05-30 11:26:32 -07:00
2019-10-04 14:07:07 -07:00
2021-10-28 10:43:58 -07:00
2020-06-23 20:10:15 -07:00
2020-06-18 20:46:23 -07:00
2021-02-04 18:37:14 -08:00
2021-11-16 13:16:54 +00:00
2019-11-14 18:12:17 -08:00
2021-11-29 12:19:53 +00:00
2019-12-09 10:28:43 -08:00
2021-12-14 00:24:24 +01:00
2021-09-28 00:18:34 +02:00
2021-12-29 08:48:14 -08:00
2022-01-05 19:46:32 -08:00
2022-01-09 17:00:17 -08:00
2021-09-28 00:18:35 +02:00