================================================================== BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652 Read of size 1 at addr ffff88815ea13fc5 by task syz-executor.4/8012 CPU: 0 PID: 8012 Comm: syz-executor.4 Not tainted 6.1.82-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline] tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652 tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:665 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x155/0x240 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 RIP: 0010:__sanitizer_cov_trace_pc+0x58/0x60 kernel/kcov.c:225 Code: f8 15 00 00 83 fa 02 75 21 48 8b 91 00 16 00 00 48 8b 32 48 8d 7e 01 8b 89 fc 15 00 00 48 39 cf 73 08 48 89 3a 48 89 44 f2 08 0f 1f 80 00 00 00 00 4c 8b 04 24 65 48 8b 15 44 eb 77 7e 65 8b RSP: 0018:ffffc900062cf4b8 EFLAGS: 00000293 RAX: ffffffff81cbf175 RBX: 0000000000000000 RCX: ffff88807f579dc0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900062cf870 R08: ffffffff81cbf166 R09: fffff94000b3e787 R10: 0000000000000000 R11: dffffc0000000001 R12: ffff8880993c61e0 R13: 0000000000000000 R14: ffffea00059f3c08 R15: ffff888165fb73d8 mm_counter include/linux/mm.h:2132 [inline] copy_present_pte mm/memory.c:976 [inline] copy_pte_range mm/memory.c:1091 [inline] copy_pmd_range mm/memory.c:1177 [inline] copy_pud_range mm/memory.c:1214 [inline] copy_p4d_range mm/memory.c:1238 [inline] copy_page_range+0x1685/0x4660 mm/memory.c:1336 dup_mmap kernel/fork.c:696 [inline] dup_mm kernel/fork.c:1540 [inline] copy_mm+0xf42/0x1990 kernel/fork.c:1589 copy_process+0x19d5/0x4060 kernel/fork.c:2267 kernel_clone+0x222/0x920 kernel/fork.c:2682 __do_sys_clone kernel/fork.c:2823 [inline] __se_sys_clone kernel/fork.c:2807 [inline] __x64_sys_clone+0x231/0x280 kernel/fork.c:2807 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f28d767add3 Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 89 c2 85 c0 75 2c 64 48 8b 04 25 10 00 00 RSP: 002b:00007ffefc2d4258 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f28d767add3 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 00005555556d0750 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001 Allocated by task 3584: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:682 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465 create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226 ksys_unshare+0x580/0xb20 kernel/fork.c:3203 __do_sys_unshare kernel/fork.c:3274 [inline] __se_sys_unshare kernel/fork.c:3272 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3272 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486 insert_work+0x54/0x3d0 kernel/workqueue.c:1361 __queue_work+0xb4b/0xf90 kernel/workqueue.c:1520 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers+0x6a8/0x890 kernel/time/timer.c:1790 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486 insert_work+0x54/0x3d0 kernel/workqueue.c:1361 __queue_work+0xb4b/0xf90 kernel/workqueue.c:1520 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers+0x6a8/0x890 kernel/time/timer.c:1790 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571 The buggy address belongs to the object at ffff88815ea13880 which belongs to the cache net_namespace of size 6976 The buggy address is located 1861 bytes inside of 6976-byte region [ffff88815ea13880, ffff88815ea153c0) The buggy address belongs to the physical page: page:ffffea00057a8400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88815ea11c40 pfn:0x15ea10 head:ffffea00057a8400 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff888162783201 flags: 0x57ff00000010200(slab|head|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000010200 0000000000000000 dead000000000001 ffff888140009500 raw: ffff88815ea11c40 0000000080040002 00000001ffffffff ffff888162783201 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3579, tgid 3579 (syz-executor.0), ts 156580877772, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513 prep_new_page mm/page_alloc.c:2520 [inline] get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5545 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x1a5/0x2d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:682 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465 create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226 ksys_unshare+0x580/0xb20 kernel/fork.c:3203 __do_sys_unshare kernel/fork.c:3274 [inline] __se_sys_unshare kernel/fork.c:3272 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3272 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd page_owner free stack trace missing Memory state around the buggy address: ffff88815ea13e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88815ea13f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88815ea13f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88815ea14000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88815ea14080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: f8 clc 1: 15 00 00 83 fa adc $0xfa830000,%eax 6: 02 75 21 add 0x21(%rbp),%dh 9: 48 8b 91 00 16 00 00 mov 0x1600(%rcx),%rdx 10: 48 8b 32 mov (%rdx),%rsi 13: 48 8d 7e 01 lea 0x1(%rsi),%rdi 17: 8b 89 fc 15 00 00 mov 0x15fc(%rcx),%ecx 1d: 48 39 cf cmp %rcx,%rdi 20: 73 08 jae 0x2a 22: 48 89 3a mov %rdi,(%rdx) 25: 48 89 44 f2 08 mov %rax,0x8(%rdx,%rsi,8) * 2a: c3 ret <-- trapping instruction 2b: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 32: 4c 8b 04 24 mov (%rsp),%r8 36: 65 48 8b 15 44 eb 77 mov %gs:0x7e77eb44(%rip),%rdx # 0x7e77eb82 3d: 7e 3e: 65 gs 3f: 8b .byte 0x8b