================================================================== 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 ffff88806aca8710 by task syz-executor.4/1481 CPU: 1 PID: 1481 Comm: syz-executor.4 Not tainted 5.2.0+ #97 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:lock_acquire+0x20b/0x410 kernel/locking/lockdep.c:4416 Code: 8c 08 00 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 0f 85 d3 01 00 00 48 83 3d 21 19 7a 07 00 0f 84 53 01 00 00 48 8b 7d c8 57 9d <0f> 1f 44 00 00 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 65 8b RSP: 0018:ffff888063df7b48 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff11a5e02 RBX: ffff888087ab4300 RCX: ffffffff815879c2 RDX: dffffc0000000000 RSI: 0000000000000008 RDI: 0000000000000286 RBP: ffff888063df7b90 R08: 1ffffffff14a7740 R09: fffffbfff14a7741 R10: ffff888087ab4bb8 R11: ffff888087ab4300 R12: ffffffff88dabf80 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000002 rcu_lock_acquire include/linux/rcupdate.h:208 [inline] rcu_read_lock include/linux/rcupdate.h:592 [inline] inet_twsk_purge+0xc0/0x5e8 net/ipv4/inet_timewait_sock.c:268 dccp_v6_exit_batch+0x1a/0x20 net/dccp/ipv6.c:1113 ops_exit_list.isra.0+0xfc/0x150 net/core/net_namespace.c:175 setup_net+0x527/0x890 net/core/net_namespace.c:357 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 RIP: 0033:0x459829 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007efe2c4fec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000459829 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000060000000 RBP: 000000000075c070 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007efe2c4ff6d4 R13: 00000000004c8f0a R14: 00000000004dff80 R15: 00000000ffffffff Allocated by task 1051: 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 __do_kmalloc mm/slab.c:3655 [inline] __kmalloc+0x163/0x770 mm/slab.c:3664 kmalloc include/linux/slab.h:557 [inline] tomoyo_realpath_from_path+0xcd/0x7b0 security/tomoyo/realpath.c:277 tomoyo_scan_exec_realpath security/tomoyo/condition.c:243 [inline] tomoyo_condition+0xd51/0x2a90 security/tomoyo/condition.c:827 tomoyo_check_acl+0x1b7/0x3e0 security/tomoyo/domain.c:174 tomoyo_execute_permission+0x188/0x4a0 security/tomoyo/file.c:615 tomoyo_find_next_domain+0x348/0x1f6c security/tomoyo/domain.c:749 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:107 [inline] tomoyo_bprm_check_security+0x124/0x1b0 security/tomoyo/tomoyo.c:97 security_bprm_check+0x63/0xb0 security/security.c:750 search_binary_handler+0x71/0x570 fs/exec.c:1645 exec_binprm fs/exec.c:1701 [inline] __do_execve_file.isra.0+0x1333/0x2340 fs/exec.c:1821 do_execveat_common fs/exec.c:1868 [inline] do_execve fs/exec.c:1885 [inline] __do_sys_execve fs/exec.c:1961 [inline] __se_sys_execve fs/exec.c:1956 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1956 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 1051: 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 tomoyo_realpath_from_path+0x1de/0x7b0 security/tomoyo/realpath.c:319 tomoyo_scan_exec_realpath security/tomoyo/condition.c:243 [inline] tomoyo_condition+0xd51/0x2a90 security/tomoyo/condition.c:827 tomoyo_check_acl+0x1b7/0x3e0 security/tomoyo/domain.c:174 tomoyo_execute_permission+0x188/0x4a0 security/tomoyo/file.c:615 tomoyo_find_next_domain+0x348/0x1f6c security/tomoyo/domain.c:749 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:107 [inline] tomoyo_bprm_check_security+0x124/0x1b0 security/tomoyo/tomoyo.c:97 security_bprm_check+0x63/0xb0 security/security.c:750 search_binary_handler+0x71/0x570 fs/exec.c:1645 exec_binprm fs/exec.c:1701 [inline] __do_execve_file.isra.0+0x1333/0x2340 fs/exec.c:1821 do_execveat_common fs/exec.c:1868 [inline] do_execve fs/exec.c:1885 [inline] __do_sys_execve fs/exec.c:1961 [inline] __se_sys_execve fs/exec.c:1956 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1956 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 ffff88806aca8540 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 464 bytes inside of 4096-byte region [ffff88806aca8540, ffff88806aca9540) The buggy address belongs to the page: page:ffffea0001ab2a00 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0002606b08 ffffea00026d4b88 ffff8880aa402000 raw: 0000000000000000 ffff88806aca8540 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88806aca8600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806aca8680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806aca8700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806aca8780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806aca8800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================