Eric Dumazet
71685eb4ce
inetpeer: fix data-race in inet_putpeer / inet_putpeer
...
We need to explicitely forbid read/store tearing in inet_peer_gc()
and inet_putpeer().
The following syzbot report reminds us about inet_putpeer()
running without a lock held.
BUG: KCSAN: data-race in inet_putpeer / inet_putpeer
write to 0xffff888121fb2ed0 of 4 bytes by interrupt on cpu 0:
inet_putpeer+0x37/0xa0 net/ipv4/inetpeer.c:240
ip4_frag_free+0x3d/0x50 net/ipv4/ip_fragment.c:102
inet_frag_destroy_rcu+0x58/0x80 net/ipv4/inet_fragment.c:228
__rcu_reclaim kernel/rcu/rcu.h:222 [inline]
rcu_do_batch+0x256/0x5b0 kernel/rcu/tree.c:2157
rcu_core+0x369/0x4d0 kernel/rcu/tree.c:2377
rcu_core_si+0x12/0x20 kernel/rcu/tree.c:2386
__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
write to 0xffff888121fb2ed0 of 4 bytes by interrupt on cpu 1:
inet_putpeer+0x37/0xa0 net/ipv4/inetpeer.c:240
ip4_frag_free+0x3d/0x50 net/ipv4/ip_fragment.c:102
inet_frag_destroy_rcu+0x58/0x80 net/ipv4/inet_fragment.c:228
__rcu_reclaim kernel/rcu/rcu.h:222 [inline]
rcu_do_batch+0x256/0x5b0 kernel/rcu/tree.c:2157
rcu_core+0x369/0x4d0 kernel/rcu/tree.c:2377
rcu_core_si+0x12/0x20 kernel/rcu/tree.c:2386
__do_softirq+0x115/0x33f kernel/softirq.c:292
run_ksoftirqd+0x46/0x60 kernel/softirq.c:603
smpboot_thread_fn+0x37d/0x4a0 kernel/smpboot.c:165
kthread+0x1d4/0x200 drivers/block/aoe/aoecmd.c:1253
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 5.4.0-rc3+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Fixes: 4b9d9be839fd ("inetpeer: remove unused list")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-11-07 16:15:56 -08:00
..
2019-07-06 12:50:01 +02:00
2019-09-27 15:10:34 -07:00
2019-06-19 17:09:55 +02:00
2019-10-24 14:53:49 -07:00
2019-09-24 16:37:18 +02:00
2019-11-06 16:14:48 -08:00
2019-11-06 16:14:48 -08:00
2019-11-03 08:30:58 +01:00
2019-11-06 16:14:48 -08:00
2019-10-15 16:24:26 -07:00
2019-07-12 16:03:16 -07:00
2019-11-04 11:15:27 -08:00
2019-11-02 13:54:56 -07:00
2019-09-04 14:22:33 +02:00
2019-09-16 12:06:25 +02:00
2019-11-06 21:51:36 -08:00
2019-05-30 11:29:52 -07:00
2019-11-06 16:14:48 -08:00
2019-11-06 16:14:48 -08:00
2019-07-10 18:43:43 -07:00
2019-11-05 18:09:45 -08:00
2019-06-07 11:00:14 -07:00
2019-07-11 14:37:45 -07:00
2019-11-02 13:54:56 -07:00
2019-09-26 08:56:17 +02:00
2019-11-07 16:15:56 -08:00
2019-11-06 16:14:48 -08:00
2019-07-29 10:26:14 -07:00
2019-09-27 10:27:14 +02:00
2019-07-08 19:48:57 -07:00
2019-10-24 14:53:48 -07:00
2019-06-23 13:24:17 -07:00
2019-06-17 20:20:36 -07:00
2019-11-06 21:35:34 -08:00
2019-10-20 10:43:00 -07:00
2019-05-30 11:26:41 -07:00
2019-08-25 14:34:08 -07:00
2019-09-19 18:04:40 -07:00
2019-11-05 14:03:11 -08:00
2019-09-01 11:45:02 -07:00
2019-10-13 11:20:03 -07:00
2019-10-24 14:53:48 -07:00
2019-11-02 13:54:56 -07:00
2019-06-19 17:09:55 +02:00
2019-11-06 21:25:19 -08:00
2019-10-01 18:42:15 +02:00
2019-10-28 13:33:41 -07:00
2019-09-16 09:18:03 +02:00
2019-10-30 17:58:23 -07:00
2019-10-17 15:23:03 -04:00
2019-06-19 17:09:55 +02:00
2019-11-06 16:14:48 -08:00
2019-11-02 13:54:56 -07:00
2019-11-06 16:14:48 -08:00
2019-11-06 16:14:48 -08:00
2019-11-02 13:54:56 -07:00
2019-06-22 08:59:24 -04:00
2019-10-30 12:04:35 -04:00
2019-05-30 11:26:32 -07:00
2019-11-06 21:16:02 -08:00
2019-10-07 09:58:28 -04:00
2019-11-02 13:54:56 -07:00
2019-11-06 16:14:48 -08:00
2019-08-10 15:25:47 -07:00
2019-11-02 13:54:56 -07:00
2019-11-06 16:14:48 -08:00
2019-11-02 15:29:58 -07:00
2019-10-01 18:42:15 +02:00
2019-05-31 15:30:03 -06:00
2019-08-17 12:40:08 -07:00
2019-07-19 10:42:02 -07:00
2019-05-21 10:50:45 +02:00