================================================================== BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:360 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0x8c6/0x8d0 net/ipv4/tcp_timer.c:596 Read of size 4 at addr ffff88806aa54750 by task kworker/u4:12/10471 CPU: 1 PID: 10471 Comm: kworker/u4:12 Not tainted 5.3.0-rc6+ #179 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:618 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 tcp_probe_timer net/ipv4/tcp_timer.c:360 [inline] tcp_write_timer_handler+0x8c6/0x8d0 net/ipv4/tcp_timer.c:596 tcp_write_timer+0xa8/0x1e0 net/ipv4/tcp_timer.c:612 call_timer_fn+0x1ac/0x780 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+0x697/0x17a0 kernel/time/timer.c:1698 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:537 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1133 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 RIP: 0010:___might_sleep+0x6/0x280 kernel/sched/core.c:6566 Code: 1f 44 00 00 5d c3 0f 0b 48 c7 c7 48 f4 d2 88 e8 c0 ad 5d 00 eb dd 0f 1f 40 00 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 57 <41> 56 41 55 41 89 f5 41 54 49 89 fc 53 89 d3 e8 66 22 10 00 85 c0 RSP: 0018:ffff888066e7fb58 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: ffff88806658e140 RBX: 000000000000ffff RCX: 0000000000000ae6 RDX: 0000000000000000 RSI: 000000000000010b RDI: ffffffff882f7020 RBP: ffff888066e7fb60 R08: ffff88806658e140 R09: fffffbfff134afe0 R10: fffffbfff134afdf R11: ffffffff89a57eff R12: 0000000000000002 R13: 0000000000000001 R14: 0000000000000ae6 R15: dffffc0000000000 inet_twsk_purge+0x96/0x5e8 net/ipv4/inet_timewait_sock.c:267 tcp_sk_exit_batch+0x22/0xa0 net/ipv4/tcp_ipv4.c:2722 ops_exit_list.isra.0+0xfc/0x150 net/core/net_namespace.c:175 cleanup_net+0x4e2/0xa60 net/core/net_namespace.c:594 process_one_work+0x9af/0x1740 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 1809: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:493 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:466 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:501 slab_post_alloc_hook mm/slab.h:520 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x710 mm/slab.c:3483 getname_flags fs/namei.c:138 [inline] getname_flags+0xd6/0x5b0 fs/namei.c:128 user_path_at_empty+0x2f/0x50 fs/namei.c:2606 user_path_at include/linux/namei.h:60 [inline] do_faccessat+0x262/0x7f0 fs/open.c:398 __do_sys_access fs/open.c:450 [inline] __se_sys_access fs/open.c:448 [inline] __x64_sys_access+0x59/0x80 fs/open.c:448 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 1809: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3693 putname+0xef/0x130 fs/namei.c:259 filename_lookup+0x28f/0x410 fs/namei.c:2355 user_path_at_empty+0x43/0x50 fs/namei.c:2606 user_path_at include/linux/namei.h:60 [inline] do_faccessat+0x262/0x7f0 fs/open.c:398 __do_sys_access fs/open.c:450 [inline] __se_sys_access fs/open.c:448 [inline] __x64_sys_access+0x59/0x80 fs/open.c:448 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88806aa54480 which belongs to the cache names_cache of size 4096 The buggy address is located 720 bytes inside of 4096-byte region [ffff88806aa54480, ffff88806aa55480) The buggy address belongs to the page: page:ffffea0001aa9500 refcount:1 mapcount:0 mapping:ffff88821bc46380 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00018f9508 ffffea00018f3c88 ffff88821bc46380 raw: 0000000000000000 ffff88806aa54480 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88806aa54600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806aa54680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806aa54700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806aa54780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806aa54800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================