================================================================== 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 ffff88808c366710 by task udevd/13358 CPU: 1 PID: 13358 Comm: udevd Not tainted 5.3.0-rc5+ #169 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:830 RIP: 0010:__sanitizer_cov_trace_const_cmp1+0x1a/0x20 kernel/kcov.c:177 Code: 8b 4d 08 e8 18 ff ff ff 5d c3 66 0f 1f 44 00 00 55 40 0f b6 d6 40 0f b6 f7 bf 01 00 00 00 48 89 e5 48 8b 4d 08 e8 f6 fe ff ff <5d> c3 0f 1f 40 00 55 0f b7 d6 0f b7 f7 bf 03 00 00 00 48 89 e5 48 RSP: 0018:ffff888097f77390 EFLAGS: 00000293 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 0000000000000004 RCX: ffffffff8305f6a5 RDX: 0000000000000004 RSI: 0000000000000010 RDI: 0000000000000001 RBP: ffff888097f77390 R08: ffff8880a58ac300 R09: ffffed1012feee89 R10: ffffed1012feee88 R11: 0000000000000000 R12: ffff8880a99db980 R13: 0000000000000022 R14: 0000000000000147 R15: 0000000000000000 tomoyo_domain_quota_is_ok+0x335/0x540 security/tomoyo/util.c:1068 tomoyo_supervisor+0x2e8/0xef0 security/tomoyo/common.c:2087 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x42f/0x520 security/tomoyo/file.c:734 tomoyo_path_mknod+0x12d/0x1b0 security/tomoyo/tomoyo.c:246 security_path_mknod+0x119/0x180 security/security.c:981 may_o_create fs/namei.c:3024 [inline] lookup_open+0x86b/0x1a50 fs/namei.c:3185 do_last fs/namei.c:3322 [inline] path_openat+0x14ac/0x4630 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1089 __do_sys_open fs/open.c:1107 [inline] __se_sys_open fs/open.c:1102 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1102 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7faea4fe2120 Code: 48 8b 15 1b 4d 2b 00 f7 d8 64 89 02 83 c8 ff c3 90 90 90 90 90 90 90 90 90 90 83 3d d5 a4 2b 00 00 75 10 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 5e 8c 01 00 48 89 04 24 RSP: 002b:00007fffaa105b48 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 0000000000665cb0 RCX: 00007faea4fe2120 RDX: 00000000000001b6 RSI: 0000000000080241 RDI: 00007fffaa106030 RBP: 00007fffaa105bc0 R08: 0000000000000004 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000004 R13: 0000000000420721 R14: 00007fffaa105c30 R15: 0000000000000000 Allocated by task 17742: 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_kmalloc+0x9/0x10 mm/kasan/common.c:501 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3550 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:748 [inline] kobject_uevent_env+0x387/0x101d lib/kobject_uevent.c:523 kobject_uevent+0x20/0x26 lib/kobject_uevent.c:641 rx_queue_add_kobject net/core/net-sysfs.c:938 [inline] net_rx_queue_update_kobjects+0x132/0x470 net/core/net-sysfs.c:956 register_queue_kobjects net/core/net-sysfs.c:1527 [inline] netdev_register_kobject+0x278/0x3b0 net/core/net-sysfs.c:1750 register_netdevice+0x875/0xff0 net/core/dev.c:8728 __ip_tunnel_create+0x36b/0x530 net/ipv4/ip_tunnel.c:269 ip_tunnel_init_net+0x375/0x9e0 net/ipv4/ip_tunnel.c:1060 vti_init_net+0x2f/0x370 net/ipv4/ip_vti.c:463 ops_init+0xb3/0x420 net/core/net_namespace.c:137 setup_net+0x2cc/0x880 net/core/net_namespace.c:334 copy_net_ns+0x290/0x41f net/core/net_namespace.c:475 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 17742: 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] kfree+0x10a/0x2c0 mm/slab.c:3756 kobject_uevent_env+0xfbc/0x101d lib/kobject_uevent.c:625 kobject_uevent+0x20/0x26 lib/kobject_uevent.c:641 rx_queue_add_kobject net/core/net-sysfs.c:938 [inline] net_rx_queue_update_kobjects+0x132/0x470 net/core/net-sysfs.c:956 register_queue_kobjects net/core/net-sysfs.c:1527 [inline] netdev_register_kobject+0x278/0x3b0 net/core/net-sysfs.c:1750 register_netdevice+0x875/0xff0 net/core/dev.c:8728 __ip_tunnel_create+0x36b/0x530 net/ipv4/ip_tunnel.c:269 ip_tunnel_init_net+0x375/0x9e0 net/ipv4/ip_tunnel.c:1060 vti_init_net+0x2f/0x370 net/ipv4/ip_vti.c:463 ops_init+0xb3/0x420 net/core/net_namespace.c:137 setup_net+0x2cc/0x880 net/core/net_namespace.c:334 copy_net_ns+0x290/0x41f net/core/net_namespace.c:475 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 The buggy address belongs to the object at ffff88808c3660c0 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1616 bytes inside of 4096-byte region [ffff88808c3660c0, ffff88808c3670c0) The buggy address belongs to the page: page:ffffea000230d980 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000230d908 ffffea0000dcea08 ffff8880aa402000 raw: 0000000000000000 ffff88808c3660c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808c366600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808c366680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808c366700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808c366780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808c366800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================