==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x2a26/0x2ec0 net/ipv4/tcp_timer.c:476
Read of size 8 at addr ffff88806b2f43b0 by task swapper/0/0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.0.0+ #98
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x172/0x1f0 lib/dump_stack.c:113
print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187
kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
__asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
tcp_retransmit_timer+0x2a26/0x2ec0 net/ipv4/tcp_timer.c:476
tcp_write_timer_handler+0x591/0x8a0 net/ipv4/tcp_timer.c:587
tcp_write_timer+0x10e/0x1d0 net/ipv4/tcp_timer.c:607
call_timer_fn+0x190/0x720 kernel/time/timer.c:1325
expire_timers kernel/time/timer.c:1362 [inline]
__run_timers kernel/time/timer.c:1681 [inline]
__run_timers kernel/time/timer.c:1649 [inline]
run_timer_softirq+0x652/0x1700 kernel/time/timer.c:1694
__do_softirq+0x266/0x95a kernel/softirq.c:293
invoke_softirq kernel/softirq.c:374 [inline]
irq_exit+0x180/0x1d0 kernel/softirq.c:414
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x14a/0x570 arch/x86/kernel/apic/apic.c:1062
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
RIP: 0010:native_safe_halt+0x2/0x10 arch/x86/include/asm/irqflags.h:58
Code: ff ff ff 48 89 c7 48 89 45 d8 e8 89 7e 99 fa 48 8b 45 d8 e9 ce fe ff ff 48 89 df e8 78 7e 99 fa eb 82 90 90 90 90 90 90 fb f4 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 f4 c3 90 90 90 90 90 90
RSP: 0018:ffffffff88807d08 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff1125331 RBX: ffffffff8887e080 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000006 RDI: ffffffff8887e8fc
RBP: ffffffff88807d38 R08: ffffffff8887e080 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffffffff88929978 R14: 0000000000000000 R15: 0000000000000000
arch_cpu_idle+0x10/0x20 arch/x86/kernel/process.c:567
default_idle_call+0x36/0x90 kernel/sched/idle.c:93
cpuidle_idle_call kernel/sched/idle.c:153 [inline]
do_idle+0x386/0x570 kernel/sched/idle.c:262
cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:353
rest_init+0x245/0x37b init/main.c:450
arch_call_rest_init+0xe/0x1b
start_kernel+0x816/0x84f init/main.c:747
x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:470
x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:451
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243
Allocated by task 7763:
save_stack+0x45/0xd0 mm/kasan/common.c:75
set_track mm/kasan/common.c:87 [inline]
__kasan_kmalloc mm/kasan/common.c:497 [inline]
__kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470
kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:505
slab_post_alloc_hook mm/slab.h:436 [inline]
slab_alloc mm/slab.c:3392 [inline]
kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3554
kmem_cache_zalloc include/linux/slab.h:730 [inline]
net_alloc net/core/net_namespace.c:384 [inline]
copy_net_ns+0xed/0x340 net/core/net_namespace.c:424
create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:107
unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:206
ksys_unshare+0x440/0x980 kernel/fork.c:2549
__do_sys_unshare kernel/fork.c:2617 [inline]
__se_sys_unshare kernel/fork.c:2615 [inline]
__x64_sys_unshare+0x31/0x40 kernel/fork.c:2615
do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Freed by task 16321:
save_stack+0x45/0xd0 mm/kasan/common.c:75
set_track mm/kasan/common.c:87 [inline]
__kasan_slab_free+0x102/0x150 mm/kasan/common.c:459
kasan_slab_free+0xe/0x10 mm/kasan/common.c:467
__cache_free mm/slab.c:3498 [inline]
kmem_cache_free+0x86/0x260 mm/slab.c:3764
net_free net/core/net_namespace.c:400 [inline]
net_drop_ns.part.0+0x70/0x90 net/core/net_namespace.c:407
net_drop_ns net/core/net_namespace.c:406 [inline]
cleanup_net+0x538/0x960 net/core/net_namespace.c:569
process_one_work+0x98e/0x1790 kernel/workqueue.c:2269
worker_thread+0x98/0xe40 kernel/workqueue.c:2415
kthread+0x357/0x430 kernel/kthread.c:253
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
The buggy address belongs to the object at ffff88806b2f4180
which belongs to the cache net_namespace of size 8512
The buggy address is located 560 bytes inside of
8512-byte region [ffff88806b2f4180, ffff88806b2f62c0)
The buggy address belongs to the page:
page:ffffea0001acbd00 count:1 mapcount:0 mapping:ffff88821bc45e00 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea0001b95208 ffffea0002a57f08 ffff88821bc45e00
raw: 0000000000000000 ffff88806b2f4180 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88806b2f4280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88806b2f4300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88806b2f4380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88806b2f4400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88806b2f4480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================