================================================================== 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 ffff88806c94c710 by task blkid/5541 CPU: 1 PID: 5541 Comm: blkid Not tainted 5.2.0+ #67 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+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:612 __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:1095 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:828 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:767 [inline] RIP: 0010:kfree+0x239/0x2c0 mm/slab.c:3757 Code: 55 7e 0f 85 20 fe ff ff e8 15 1c 54 ff e9 16 fe ff ff e8 0a b6 cb ff 48 83 3d 52 a5 26 07 00 0f 84 85 00 00 00 48 89 df 57 9d <0f> 1f 44 00 00 5b 41 5c 41 5d 41 5e 5d c3 e8 e4 b5 cb ff 48 83 3d RSP: 0018:ffff888086cd7a98 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000007 RBX: 0000000000000286 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff8880949e4b90 RDI: 0000000000000286 RBP: ffff888086cd7ab8 R08: ffff8880949e4300 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880a89dda80 R13: ffff8880aa400380 R14: ffffffff8304d3ce R15: ffff8880a89dda80 tomoyo_path_perm+0x24e/0x430 security/tomoyo/file.c:842 tomoyo_inode_getattr+0x1d/0x30 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xf2/0x150 security/security.c:1182 vfs_getattr+0x25/0x70 fs/stat.c:115 vfs_statx_fd+0x71/0xc0 fs/stat.c:145 vfs_fstat include/linux/fs.h:3198 [inline] __do_sys_newfstat+0x9b/0x120 fs/stat.c:378 __se_sys_newfstat fs/stat.c:375 [inline] __x64_sys_newfstat+0x54/0x80 fs/stat.c:375 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f430144c174 Code: b8 ff ff ff ff c3 f7 d8 89 05 2c b0 20 00 83 c8 ff c3 90 90 90 90 83 ff 01 89 f0 77 19 48 63 f8 48 89 d6 b8 05 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 14 f3 c3 66 90 c7 05 fa af 20 00 16 00 00 00 RSP: 002b:00007ffef9175db8 EFLAGS: 00000246 ORIG_RAX: 0000000000000005 RAX: ffffffffffffffda RBX: 00007f4301211c22 RCX: 00007f430144c174 RDX: 00007ffef9175e60 RSI: 00007ffef9175e60 RDI: 0000000000000003 RBP: 00007ffef9175f20 R08: 00007f43016544c8 R09: 0000000000000001 R10: 00007f4301650629 R11: 0000000000000246 R12: 00007ffef9175fc0 R13: 00007f43016544c8 R14: 0000000000000001 R15: 00007f4301654870 Allocated by task 9434: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:487 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:460 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:495 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 kmem_cache_zalloc include/linux/slab.h:738 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0xf1/0x41f net/core/net_namespace.c:462 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:202 ksys_unshare+0x444/0x980 kernel/fork.c:2831 __do_sys_unshare kernel/fork.c:2899 [inline] __se_sys_unshare kernel/fork.c:2897 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2897 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 21: 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:449 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3693 net_free net/core/net_namespace.c:438 [inline] net_drop_ns.part.0+0x70/0x90 net/core/net_namespace.c:445 net_drop_ns net/core/net_namespace.c:444 [inline] cleanup_net+0x77a/0xa70 net/core/net_namespace.c:613 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 The buggy address belongs to the object at ffff88806c94c140 which belongs to the cache net_namespace of size 6784 The buggy address is located 1488 bytes inside of 6784-byte region [ffff88806c94c140, ffff88806c94dbc0) The buggy address belongs to the page: page:ffffea0001b25300 refcount:1 mapcount:0 mapping:ffff88821b69e1c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000220ae88 ffffea0001a99b08 ffff88821b69e1c0 raw: 0000000000000000 ffff88806c94c140 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88806c94c600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806c94c680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806c94c700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806c94c780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806c94c800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================