================================================================== 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 ffff888052b7d4e8 by task syz-executor.1/1410 CPU: 1 PID: 1410 Comm: syz-executor.1 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 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:arch_local_irq_disable arch/x86/include/asm/paravirt.h:794 [inline] RIP: 0010:preempt_schedule_irq+0xb7/0x140 kernel/sched/core.c:3745 Code: e8 03 80 3c 18 00 75 69 48 83 3d 9b 18 d9 01 00 74 5b fb 66 0f 1f 44 00 00 bf 01 00 00 00 e8 40 d1 ff ff 48 c7 c0 90 82 f1 89 <48> c1 e8 03 80 3c 18 00 75 4b 48 83 3d 67 18 d9 01 00 74 31 fa 66 RSP: 0018:ffff88805413f800 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: ffffffff89f18290 RBX: dffffc0000000000 RCX: 0000000000000000 RDX: 1ffff11017425769 RSI: 1ffff1100a827eed RDI: ffff8880b0d4b9e0 RBP: ffffed10161a94d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880b0d4a680 R13: ffffffff89f18298 R14: 0000000000000000 R15: 0000000000000000 retint_kernel+0x1b/0x2d RIP: 0010:memset_erms+0x9/0x10 arch/x86/lib/memset_64.S:66 Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 aa 4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01 RSP: 0018:ffff88805413f8d8 EFLAGS: 00010206 ORIG_RAX: ffffffffffffff02 RAX: dffffc00000000ff RBX: 0000000000000200 RCX: 0000000000035a00 RDX: 0000000000040000 RSI: 00000000000000ff RDI: ffffed100250a600 RBP: ffff888012800000 R08: ffffed1002500000 R09: ffffed1002500000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000009 R13: 0000000000000002 R14: ffffea00004a0000 R15: 0000000000012800 free_pages_prepare mm/page_alloc.c:1062 [inline] __free_pages_ok+0x24d/0xd30 mm/page_alloc.c:1279 release_pages+0xab5/0x15a0 mm/swap.c:768 tlb_flush_mmu_free mm/memory.c:261 [inline] zap_pte_range mm/memory.c:1417 [inline] zap_pmd_range mm/memory.c:1463 [inline] zap_pud_range mm/memory.c:1492 [inline] zap_p4d_range mm/memory.c:1513 [inline] unmap_page_range+0x221f/0x2c50 mm/memory.c:1534 unmap_single_vma+0x198/0x300 mm/memory.c:1579 unmap_vmas+0xa9/0x180 mm/memory.c:1609 exit_mmap+0x2b9/0x530 mm/mmap.c:3093 __mmput kernel/fork.c:1016 [inline] mmput+0x14e/0x4a0 kernel/fork.c:1037 exit_mm kernel/exit.c:549 [inline] do_exit+0xaec/0x2be0 kernel/exit.c:857 do_group_exit+0x125/0x310 kernel/exit.c:967 __do_sys_exit_group kernel/exit.c:978 [inline] __se_sys_exit_group kernel/exit.c:976 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:976 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f347d907209 Code: Bad RIP value. RSP: 002b:00007ffc45c94618 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000001e RCX: 00007f347d907209 RDX: 00007f347d8b9e4b RSI: ffffffffffffffb8 RDI: 0000000000000000 RBP: 0000000000000000 R08: 00000000415d071b R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000001 R15: 00007ffc45c94700 Allocated by task 832: 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 33: __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 ffff888052b7cd80 which belongs to the cache net_namespace of size 8704 The buggy address is located 1896 bytes inside of 8704-byte region [ffff888052b7cd80, ffff888052b7ef80) The buggy address belongs to the page: page:ffffea00014adf00 count:1 mapcount:0 mapping:ffff88823b843e00 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea00013c7b08 ffffea0002734e08 ffff88823b843e00 raw: 0000000000000000 ffff888052b7cd80 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888052b7d380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888052b7d400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888052b7d480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888052b7d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888052b7d580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: e8 03 80 3c 18 callq 0x183c8008 5: 00 75 69 add %dh,0x69(%rbp) 8: 48 83 3d 9b 18 d9 01 cmpq $0x0,0x1d9189b(%rip) # 0x1d918ab f: 00 10: 74 5b je 0x6d 12: fb sti 13: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 19: bf 01 00 00 00 mov $0x1,%edi 1e: e8 40 d1 ff ff callq 0xffffd163 23: 48 c7 c0 90 82 f1 89 mov $0xffffffff89f18290,%rax * 2a: 48 c1 e8 03 shr $0x3,%rax <-- trapping instruction 2e: 80 3c 18 00 cmpb $0x0,(%rax,%rbx,1) 32: 75 4b jne 0x7f 34: 48 83 3d 67 18 d9 01 cmpq $0x0,0x1d91867(%rip) # 0x1d918a3 3b: 00 3c: 74 31 je 0x6f 3e: fa cli 3f: 66 data16