================================================================== BUG: KASAN: use-after-free in tcp_retransmit_timer+0x2b80/0x2f20 net/ipv4/tcp_timer.c:480 Read of size 8 at addr ffff8880971982b8 by task ps/18651 CPU: 1 PID: 18651 Comm: ps Not tainted 5.2.0-rc1+ #7 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:188 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 tcp_retransmit_timer+0x2b80/0x2f20 net/ipv4/tcp_timer.c:480 tcp_write_timer_handler+0x591/0x8a0 net/ipv4/tcp_timer.c:591 tcp_write_timer+0x10e/0x1d0 net/ipv4/tcp_timer.c:611 call_timer_fn+0x193/0x720 kernel/time/timer.c:1322 expire_timers kernel/time/timer.c:1366 [inline] __run_timers kernel/time/timer.c:1685 [inline] __run_timers kernel/time/timer.c:1653 [inline] run_timer_softirq+0x66f/0x1740 kernel/time/timer.c:1698 __do_softirq+0x25c/0x94c 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+0x13b/0x550 arch/x86/kernel/apic/apic.c:1068 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:806 RIP: 0010:generic_fillattr+0xc/0x5d0 fs/stat.c:34 Code: 49 c7 c6 ea ff ff ff e8 b6 7b a7 ff e9 b8 f2 ff ff 90 90 90 90 90 90 90 90 90 90 90 90 90 55 48 89 e5 41 55 41 54 49 89 f4 53 <48> 89 fb 48 83 ec 08 e8 68 6a bd ff 48 8d 7b 28 48 b8 00 00 00 00 RSP: 0018:ffff8880971efc18 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: dffffc0000000000 RBX: ffff8880971efde8 RCX: 0000000000000000 RDX: 1ffff1101530c252 RSI: ffff8880971efde8 RDI: ffff8880884a9998 RBP: ffff8880971efc30 R08: ffff88808bec6100 R09: ffff8880971efde8 R10: ffffed1012e3dfcd R11: ffff8880971efe6f R12: ffff8880971efde8 R13: ffffffff88b749e0 R14: ffff8880971efd40 R15: 0000000000000800 pid_getattr+0xbf/0x4f0 fs/proc/base.c:1773 vfs_getattr_nosec+0x1f7/0x290 fs/stat.c:81 vfs_getattr+0x4b/0x70 fs/stat.c:118 vfs_statx+0x157/0x200 fs/stat.c:191 vfs_stat include/linux/fs.h:3193 [inline] __do_sys_newstat+0xa4/0x130 fs/stat.c:341 __se_sys_newstat fs/stat.c:337 [inline] __x64_sys_newstat+0x54/0x80 fs/stat.c:337 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f9e2d344c65 Code: 00 00 00 e8 5d 01 00 00 48 83 c4 18 c3 90 90 90 90 90 90 90 90 83 ff 01 48 89 f0 77 18 48 89 c7 48 89 d6 b8 04 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 17 f3 c3 90 48 8b 05 a1 51 2b 00 64 c7 00 16 RSP: 002b:00007ffdbe130e48 EFLAGS: 00000246 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000616760 RCX: 00007f9e2d344c65 RDX: 00007f9e2d812c60 RSI: 00007f9e2d812c60 RDI: 000000000182a240 RBP: 0000000000020062 R08: 00007f9e2d5fa5a0 R09: 0000000000000000 R10: 1999999999999999 R11: 0000000000000246 R12: 000000000182a240 R13: 000000000182a1e0 R14: 0000000000000005 R15: 0000000000000000 Allocated by task 8959: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc mm/kasan/common.c:489 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:497 slab_post_alloc_hook mm/slab.h:437 [inline] slab_alloc mm/slab.c:3326 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3488 kmem_cache_zalloc include/linux/slab.h:732 [inline] net_alloc net/core/net_namespace.c:386 [inline] copy_net_ns+0xed/0x340 net/core/net_namespace.c:426 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:2692 __do_sys_unshare kernel/fork.c:2760 [inline] __se_sys_unshare kernel/fork.c:2758 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2758 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 2544: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3432 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3698 net_free net/core/net_namespace.c:402 [inline] net_drop_ns.part.0+0x70/0x90 net/core/net_namespace.c:409 net_drop_ns net/core/net_namespace.c:408 [inline] cleanup_net+0x538/0x960 net/core/net_namespace.c:571 process_one_work+0x989/0x1790 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x354/0x420 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff888097198080 which belongs to the cache net_namespace of size 8640 The buggy address is located 568 bytes inside of 8640-byte region [ffff888097198080, ffff88809719a240) The buggy address belongs to the page: page:ffffea00025c6600 refcount:1 mapcount:0 mapping:ffff88821b6f60c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00021a5508 ffffea00022a3008 ffff88821b6f60c0 raw: 0000000000000000 ffff888097198080 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888097198180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097198200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888097198280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888097198300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097198380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================