Paul E. McKenney
60a4491705
rcu: Use WRITE_ONCE() for assignments to ->pprev for hlist_nulls
[ Upstream commit 860c8802ac ]
Eric Dumazet supplied a KCSAN report of a bug that forces use
of hlist_unhashed_lockless() from sk_unhashed():
------------------------------------------------------------------------
BUG: KCSAN: data-race in inet_unhash / inet_unhash
write to 0xffff8880a69a0170 of 8 bytes by interrupt on cpu 1:
__hlist_nulls_del include/linux/list_nulls.h:88 [inline]
hlist_nulls_del_init_rcu include/linux/rculist_nulls.h:36 [inline]
__sk_nulls_del_node_init_rcu include/net/sock.h:676 [inline]
inet_unhash+0x38f/0x4a0 net/ipv4/inet_hashtables.c:612
tcp_set_state+0xfa/0x3e0 net/ipv4/tcp.c:2249
tcp_done+0x93/0x1e0 net/ipv4/tcp.c:3854
tcp_write_err+0x7e/0xc0 net/ipv4/tcp_timer.c:56
tcp_retransmit_timer+0x9b8/0x16d0 net/ipv4/tcp_timer.c:479
tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:599
tcp_write_timer+0xd1/0xf0 net/ipv4/tcp_timer.c:619
call_timer_fn+0x5f/0x2f0 kernel/time/timer.c:1404
expire_timers kernel/time/timer.c:1449 [inline]
__run_timers kernel/time/timer.c:1773 [inline]
__run_timers kernel/time/timer.c:1740 [inline]
run_timer_softirq+0xc0c/0xcd0 kernel/time/timer.c:1786
__do_softirq+0x115/0x33f kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0xbb/0xe0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0xe6/0x280 arch/x86/kernel/apic/apic.c:1137
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830
native_safe_halt+0xe/0x10 arch/x86/kernel/paravirt.c:71
arch_cpu_idle+0x1f/0x30 arch/x86/kernel/process.c:571
default_idle_call+0x1e/0x40 kernel/sched/idle.c:94
cpuidle_idle_call kernel/sched/idle.c:154 [inline]
do_idle+0x1af/0x280 kernel/sched/idle.c:263
cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:355
start_secondary+0x208/0x260 arch/x86/kernel/smpboot.c:264
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241
read to 0xffff8880a69a0170 of 8 bytes by interrupt on cpu 0:
sk_unhashed include/net/sock.h:607 [inline]
inet_unhash+0x3d/0x4a0 net/ipv4/inet_hashtables.c:592
tcp_set_state+0xfa/0x3e0 net/ipv4/tcp.c:2249
tcp_done+0x93/0x1e0 net/ipv4/tcp.c:3854
tcp_write_err+0x7e/0xc0 net/ipv4/tcp_timer.c:56
tcp_retransmit_timer+0x9b8/0x16d0 net/ipv4/tcp_timer.c:479
tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:599
tcp_write_timer+0xd1/0xf0 net/ipv4/tcp_timer.c:619
call_timer_fn+0x5f/0x2f0 kernel/time/timer.c:1404
expire_timers kernel/time/timer.c:1449 [inline]
__run_timers kernel/time/timer.c:1773 [inline]
__run_timers kernel/time/timer.c:1740 [inline]
run_timer_softirq+0xc0c/0xcd0 kernel/time/timer.c:1786
__do_softirq+0x115/0x33f kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0xbb/0xe0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0xe6/0x280 arch/x86/kernel/apic/apic.c:1137
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830
native_safe_halt+0xe/0x10 arch/x86/kernel/paravirt.c:71
arch_cpu_idle+0x1f/0x30 arch/x86/kernel/process.c:571
default_idle_call+0x1e/0x40 kernel/sched/idle.c:94
cpuidle_idle_call kernel/sched/idle.c:154 [inline]
do_idle+0x1af/0x280 kernel/sched/idle.c:263
cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:355
rest_init+0xec/0xf6 init/main.c:452
arch_call_rest_init+0x17/0x37
start_kernel+0x838/0x85e init/main.c:786
x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:490
x86_64_start_kernel+0x72/0x76 arch/x86/kernel/head64.c:471
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.0-rc6+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine,
BIOS Google 01/01/2011
------------------------------------------------------------------------
This commit therefore replaces C-language assignments with WRITE_ONCE()
in include/linux/list_nulls.h and include/linux/rculist_nulls.h.
Reported-by: Eric Dumazet <edumazet@google.com> # For KCSAN
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-24 08:34:46 +01:00
..
2019-12-13 08:51:18 +01:00
2019-01-22 21:40:33 +01:00
2020-01-14 20:07:03 +01:00
2019-09-10 10:33:53 +01:00
2018-08-18 15:55:59 -07:00
2018-09-30 08:49:55 -07:00
2018-08-05 17:11:49 -07:00
2019-12-05 09:20:15 +01:00
2019-05-31 06:46:24 -07:00
2020-01-27 14:50:42 +01:00
2018-08-09 16:11:21 -04:00
2018-08-03 19:52:14 +05:30
2019-12-17 20:35:45 +01:00
2020-01-27 14:51:03 +01:00
2020-01-27 14:51:21 +01:00
2019-12-13 08:52:21 +01:00
2020-01-29 16:43:24 +01:00
2018-10-12 15:25:17 +01:00
2020-01-27 14:51:19 +01:00
2020-02-01 09:37:10 +00:00
2019-02-27 10:08:52 +01:00
2020-01-23 08:21:39 +01:00
2019-12-31 16:36:22 +01:00
2018-08-23 13:44:43 -07:00
2018-09-28 18:04:06 -07:00
2018-08-09 18:47:47 +03:00
2019-11-24 08:19:24 +01:00
2020-02-01 09:37:01 +00:00
2020-01-27 14:51:00 +01:00
2020-01-09 10:19:01 +01:00
2018-08-30 14:18:03 +01:00
2018-07-30 08:49:02 -04:00
2019-12-13 08:52:59 +01:00
2018-07-25 11:53:59 +02:00
2019-03-05 17:58:50 +01:00
2018-08-22 10:52:46 -07:00
2019-05-31 06:46:00 -07:00
2018-08-17 16:20:27 -07:00
2019-12-01 09:17:07 +01:00
2019-06-09 09:17:11 +02:00
2019-04-17 08:38:51 +02:00
2018-07-18 08:44:22 -06:00
2018-08-31 14:48:56 -06:00
2019-10-05 13:10:03 +02:00
2020-01-23 08:21:29 +01:00
2019-12-05 09:21:08 +01:00
2018-08-02 12:17:27 -06:00
2018-08-11 01:58:46 +02:00
2019-01-31 08:14:41 +01:00
2019-07-03 13:14:48 +02:00
2019-05-25 18:23:48 +02:00
2018-07-21 16:21:25 -07:00
2018-08-07 15:48:38 -07:00
2019-10-05 13:09:54 +02:00
2019-08-16 10:12:38 +02:00
2018-08-02 15:22:13 -06:00
2019-08-09 17:52:34 +02:00
2019-08-09 17:52:34 +02:00
2019-04-05 22:33:03 +02:00
2018-07-19 17:08:52 -07:00
2018-08-17 16:20:32 -07:00
2019-08-06 19:06:52 +02:00
2019-08-06 19:06:52 +02:00
2018-11-13 11:08:25 -08:00
2019-06-09 09:17:23 +02:00
2019-02-27 10:08:53 +01:00
2019-06-09 09:17:23 +02:00
2019-02-27 10:08:53 +01:00
2019-06-04 08:02:34 +02:00
2018-07-21 09:21:10 +02:00
2018-07-31 13:06:57 +02:00
2019-11-12 19:21:38 +01:00
2019-11-20 18:47:11 +01:00
2019-12-31 16:36:22 +01:00
2019-07-26 09:14:12 +02:00
2019-11-24 08:20:07 +01:00
2018-08-13 09:05:05 -07:00
2018-08-22 10:52:46 -07:00
2018-07-27 19:04:33 +08:00
2018-08-22 10:52:48 -07:00
2019-07-31 07:27:11 +02:00
2018-07-18 07:27:22 -04:00
2018-07-23 10:38:06 -07:00
2019-05-25 18:23:26 +02:00
2018-07-26 19:38:03 -07:00
2019-09-16 08:22:12 +02:00
2020-01-27 14:51:00 +01:00
2018-07-31 17:33:21 -04:00
2018-08-17 16:20:32 -07:00
2018-07-31 18:04:55 -05:00
2019-12-13 08:51:54 +01:00
2020-02-24 08:34:44 +01:00
2019-06-04 08:02:34 +02:00
2019-11-20 18:47:40 +01:00
2019-05-16 19:41:22 +02:00
2019-05-16 19:41:17 +02:00
2020-02-11 04:34:08 -08:00
2018-08-25 13:40:38 -07:00
2019-04-05 22:32:59 +02:00
2019-11-24 08:19:14 +01:00
2019-07-10 09:53:47 +02:00
2019-07-28 08:29:29 +02:00
2018-12-17 09:24:38 +01:00
2018-07-27 09:57:23 +10:00
2019-11-20 18:45:55 +01:00
2018-12-01 09:37:31 +01:00
2018-07-18 15:44:44 +02:00
2018-12-05 19:32:10 +01:00
2019-12-01 09:17:38 +01:00
2018-07-23 12:44:52 +02:00
2019-12-05 09:21:03 +01:00
2019-05-31 06:46:18 -07:00
2019-02-12 19:47:14 +01:00
2019-11-10 11:27:40 +01:00
2018-08-02 10:24:51 +02:00
2018-07-18 17:27:10 +00:00
2019-09-10 10:33:44 +01:00
2019-03-23 20:10:08 +01:00
2018-11-13 11:08:54 -08:00
2019-02-12 19:47:24 +01:00
2018-12-05 19:32:13 +01:00
2019-05-31 06:46:28 -07:00
2019-01-13 09:51:04 +01:00
2019-07-31 07:26:59 +02:00
2020-01-04 19:13:32 +01:00
2019-12-17 20:35:45 +01:00
2019-05-22 07:37:40 +02:00
2019-10-17 13:45:42 -07:00
2019-11-20 18:47:31 +01:00
2019-05-08 07:21:43 +02:00
2018-11-21 09:19:20 +01:00
2019-12-05 09:19:39 +01:00
2019-10-11 18:21:43 +02:00
2019-03-05 17:58:51 +01:00
2020-01-12 12:17:25 +01:00
2019-08-09 17:52:34 +02:00
2018-08-15 10:25:26 -07:00
2019-12-01 09:17:05 +01:00
2018-07-21 10:43:12 -05:00
2018-08-22 10:52:47 -07:00
2018-07-18 07:27:22 -04:00
2019-11-20 18:45:19 +01:00
2018-08-08 11:06:20 +02:00
2019-08-04 09:30:54 +02:00
2018-08-22 10:52:52 -07:00
2019-12-31 16:35:23 +01:00
2020-02-11 04:34:18 -08:00
2019-04-05 22:33:09 +02:00
2020-02-11 04:34:18 -08:00
2018-08-10 15:11:25 -04:00
2019-12-13 08:52:43 +01:00
2018-08-16 19:36:55 +02:00
2018-07-26 17:04:37 -07:00
2019-06-04 08:02:34 +02:00
2019-06-04 08:02:34 +02:00
2018-08-17 16:20:30 -07:00
2019-04-20 09:15:59 +02:00
2019-07-21 09:03:11 +02:00
2019-12-13 08:52:43 +01:00
2019-03-23 20:09:48 +01:00
2018-08-18 11:44:53 -07:00
2019-12-05 09:20:26 +01:00
2020-02-11 04:34:17 -08:00
2020-01-09 10:19:01 +01:00
2020-01-04 19:13:15 +01:00
2019-06-09 09:17:19 +02:00
2020-02-24 08:34:46 +01:00
2018-08-10 15:11:25 -04:00
2019-09-06 10:22:19 +02:00
2020-01-23 08:21:29 +01:00
2018-12-29 13:37:59 +01:00
2020-02-11 04:34:18 -08:00
2019-04-17 08:38:51 +02:00
2020-01-29 16:43:27 +01:00
2020-01-29 16:43:27 +01:00
2019-01-13 09:51:04 +01:00
2019-12-31 16:35:38 +01:00
2018-09-13 15:18:04 -10:00
2019-11-12 19:20:36 +01:00
2019-11-12 19:20:36 +01:00
2018-08-22 10:52:44 -07:00
2020-01-29 16:43:24 +01:00
2019-12-31 16:34:36 +01:00
2019-06-09 09:17:23 +02:00
2019-05-31 06:46:05 -07:00
2019-01-09 17:38:42 +01:00
2018-12-05 19:31:59 +01:00
2018-07-31 12:40:22 -07:00
2019-02-23 09:07:25 +01:00
2020-01-29 16:43:16 +01:00
2018-08-03 21:15:09 +02:00
2019-06-04 08:02:34 +02:00
2019-06-04 08:02:34 +02:00
2018-07-24 10:04:49 -07:00
2018-09-23 21:55:24 -07:00
2018-08-23 16:03:58 -07:00
2018-08-09 12:56:39 -04:00
2018-08-13 17:04:23 -04:00
2019-09-06 10:22:22 +02:00
2019-09-06 10:22:23 +02:00
2018-11-21 09:19:20 +01:00
2020-01-29 16:43:26 +01:00
2018-08-22 10:52:45 -07:00
2020-01-09 10:18:54 +01:00
2018-11-13 11:08:24 -08:00
2020-01-27 14:50:37 +01:00
2018-08-03 18:57:15 +05:30
2018-08-23 18:48:44 -07:00
2019-05-31 06:46:30 -07:00
2018-08-17 16:20:28 -07:00
2019-11-12 19:20:36 +01:00
2018-07-23 17:04:13 -05:00
2018-09-03 19:05:13 -07:00
2018-07-31 18:04:55 -05:00
2018-07-19 11:46:45 +01:00
2018-07-19 11:34:23 +01:00
2019-05-25 18:23:38 +02:00
2020-02-11 04:34:11 -08:00
2018-08-22 10:52:45 -07:00
2020-01-27 14:50:27 +01:00
2018-12-01 09:37:34 +01:00
2018-07-25 13:41:22 -07:00
2018-08-09 11:08:19 -07:00
2018-07-21 10:43:12 -05:00
2019-05-04 09:20:11 +02:00
2020-01-27 14:50:26 +01:00
2020-01-17 19:46:55 +01:00
2020-01-04 19:13:35 +01:00
2018-07-31 11:32:27 -04:00
2018-08-14 13:36:15 +02:00
2018-08-22 10:52:46 -07:00
2019-03-23 20:10:04 +01:00
2019-06-11 12:20:52 +02:00
2018-07-20 01:11:45 +02:00
2019-01-09 17:38:33 +01:00
2018-12-05 19:32:03 +01:00
2019-06-15 11:54:10 +02:00
2019-12-13 08:52:28 +01:00
2020-01-04 19:12:53 +01:00
2019-12-17 20:35:17 +01:00
2018-08-02 17:33:06 -04:00
2020-02-24 08:34:46 +01:00
2019-07-26 09:14:07 +02:00
2018-08-09 11:15:06 +01:00
2019-04-05 22:32:56 +02:00
2019-12-05 09:19:38 +01:00
2019-04-05 22:32:56 +02:00
2020-01-27 14:50:37 +01:00
2018-07-25 11:22:19 +02:00
2018-07-20 00:02:43 +02:00
2020-02-05 14:43:42 +00:00
2020-01-23 08:21:29 +01:00
2018-07-21 09:18:27 +02:00
2019-12-05 09:20:25 +01:00
2019-12-13 08:51:07 +01:00
2018-10-02 14:38:02 -07:00
2018-08-20 09:22:45 -07:00
2018-08-22 10:52:43 -07:00
2020-01-27 14:51:05 +01:00
2019-06-04 08:02:30 +02:00
2020-01-04 19:13:30 +01:00
2019-04-03 06:26:28 +02:00
2019-05-31 06:46:16 -07:00
2018-08-16 12:14:42 -07:00
2018-07-26 10:50:16 -04:00
2019-03-13 14:02:35 -07:00
2019-04-17 08:38:45 +02:00
2018-10-12 12:35:02 +02:00
2019-12-05 09:20:57 +01:00
2018-08-23 18:48:44 -07:00
2020-01-27 14:50:22 +01:00
2018-08-14 16:39:13 -07:00
2018-08-18 11:44:53 -07:00
2018-12-29 13:37:55 +01:00
2018-11-13 11:08:51 -08:00
2019-06-17 19:51:56 +02:00
2018-08-22 15:11:35 +02:00
2019-05-31 06:46:29 -07:00
2019-12-21 10:57:17 +01:00
2019-11-20 18:45:24 +01:00
2018-09-03 13:26:44 +02:00
2020-01-23 08:21:32 +01:00
2018-07-28 17:03:11 +03:00
2019-12-05 09:19:49 +01:00
2018-10-17 15:35:29 -04:00
2018-12-08 12:59:07 +01:00
2019-12-13 08:52:28 +01:00
2018-09-12 14:58:47 -07:00
2018-08-13 20:08:33 -04:00
2019-05-08 07:21:44 +02:00
2018-08-23 18:48:44 -07:00
2018-08-16 09:57:20 -07:00
2018-09-13 17:58:30 +02:00
2018-08-11 12:02:18 -07:00
2019-02-27 10:09:01 +01:00
2019-04-17 08:38:52 +02:00
2018-09-13 15:18:04 -10:00
2018-09-13 15:18:04 -10:00
2019-07-14 08:11:21 +02:00
2018-11-13 11:08:42 -08:00