================================================================== BUG: KASAN: use-after-free in tcp_orphan_retries net/ipv4/tcp_timer.c:127 [inline] BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:369 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0xa4b/0xa60 net/ipv4/tcp_timer.c:597 Read of size 4 at addr ffff8880954548e8 by task syz-executor.5/29322 CPU: 0 PID: 29322 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0 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+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load4_noabort+0x88/0x90 mm/kasan/report.c:432 tcp_orphan_retries net/ipv4/tcp_timer.c:127 [inline] tcp_probe_timer net/ipv4/tcp_timer.c:369 [inline] tcp_write_timer_handler+0xa4b/0xa60 net/ipv4/tcp_timer.c:597 tcp_write_timer+0x103/0x1b0 net/ipv4/tcp_timer.c:613 call_timer_fn+0x177/0x700 kernel/time/timer.c:1338 expire_timers+0x243/0x4e0 kernel/time/timer.c:1375 __run_timers kernel/time/timer.c:1696 [inline] run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1709 __do_softirq+0x265/0x980 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1098 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894 RIP: 0010:get_current arch/x86/include/asm/current.h:15 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x4/0x50 kernel/kcov.c:100 Code: e8 11 dd 35 00 e9 ab fe ff ff 4c 89 ef e8 04 dd 35 00 e9 23 fe ff ff 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 48 8b 34 24 <65> 48 8b 04 25 c0 df 01 00 65 8b 15 cc 59 9f 7e 81 e2 00 01 1f 00 RSP: 0018:ffff8880551dfe80 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 1ffff110157d1601 RBX: ffff8880abe8b000 RCX: ffffc90007e15000 RDX: 000000000000078c RSI: ffffffff81a329d9 RDI: ffff8880abe8b000 RBP: ffff8880abe8b000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000007 R11: 0000000000000000 R12: ffff888050e86d18 R13: dffffc0000000000 R14: ffff888050e865c0 R15: 0000000000000000 ____fput+0x9/0x20 fs/file_table.c:309 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f77140c10e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7712a36168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: fffffffffffffff7 RBX: 00007f77141d3f60 RCX: 00007f77140c10e9 RDX: 0000000000000800 RSI: 0000000020000100 RDI: ffffffffffffffff RBP: 00007f771411b08d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcab11b12f R14: 00007f7712a36300 R15: 0000000000022000 Allocated by task 8115: kmem_cache_alloc+0x122/0x370 mm/slab.c:3559 kmem_cache_zalloc include/linux/slab.h:699 [inline] net_alloc net/core/net_namespace.c:386 [inline] copy_net_ns+0x106/0x340 net/core/net_namespace.c:426 create_new_namespaces+0x3f6/0x7b0 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:206 ksys_unshare+0x36c/0x9a0 kernel/fork.c:2542 __do_sys_unshare kernel/fork.c:2610 [inline] __se_sys_unshare kernel/fork.c:2608 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:2608 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9443: __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x7f/0x260 mm/slab.c:3765 net_free net/core/net_namespace.c:402 [inline] net_drop_ns+0x73/0x90 net/core/net_namespace.c:409 cleanup_net+0x64c/0x8b0 net/core/net_namespace.c:572 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 The buggy address belongs to the object at ffff888095454180 which belongs to the cache net_namespace of size 8704 The buggy address is located 1896 bytes inside of 8704-byte region [ffff888095454180, ffff888095456380) The buggy address belongs to the page: page:ffffea0002551500 count:1 mapcount:0 mapping:ffff88823b843e00 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002482b08 ffffea000287c308 ffff88823b843e00 raw: 0000000000000000 ffff888095454180 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888095454780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888095454800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888095454880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888095454900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888095454980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: e8 11 dd 35 00 callq 0x35dd16 5: e9 ab fe ff ff jmpq 0xfffffeb5 a: 4c 89 ef mov %r13,%rdi d: e8 04 dd 35 00 callq 0x35dd16 12: e9 23 fe ff ff jmpq 0xfffffe3a 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 90 nop 1f: 90 nop 20: 90 nop 21: 90 nop 22: 90 nop 23: 90 nop 24: 90 nop 25: 90 nop 26: 48 8b 34 24 mov (%rsp),%rsi * 2a: 65 48 8b 04 25 c0 df mov %gs:0x1dfc0,%rax <-- trapping instruction 31: 01 00 33: 65 8b 15 cc 59 9f 7e mov %gs:0x7e9f59cc(%rip),%edx # 0x7e9f5a06 3a: 81 e2 00 01 1f 00 and $0x1f0100,%edx