================================================================== BUG: KASAN: use-after-free in tw_timer_handler+0x8f/0xf0 include/net/net_namespace.h:-1 Read of size 8 at addr ffff888126392810 by task syz.0.1154/5094 CPU: 0 PID: 5094 Comm: syz.0.1154 Tainted: G W 5.10.238-syzkaller-00282-gd76d4cd0623a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/29/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0xe2/0x130 mm/kasan/report.c:452 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309 tw_timer_handler+0x8f/0xf0 include/net/net_namespace.h:-1 call_timer_fn+0x38/0x290 kernel/time/timer.c:1450 expire_timers kernel/time/timer.c:1495 [inline] __run_timers+0x639/0x9a0 kernel/time/timer.c:1789 run_timer_softirq+0x6a/0xf0 kernel/time/timer.c:1802 __do_softirq+0x255/0x563 kernel/softirq.c:309 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0x60/0x80 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:405 [inline] __irq_exit_rcu+0x128/0x150 kernel/softirq.c:435 irq_exit_rcu+0x9/0x10 kernel/softirq.c:447 sysvec_apic_timer_interrupt+0xbf/0xe0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:635 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x51/0x80 kernel/locking/spinlock.c:191 Code: 89 fe 48 c7 c7 f0 64 2c 86 e8 ab cf 28 fd 4c 89 f7 48 83 3d 20 b0 b7 01 00 74 34 e8 1d 51 d6 fc 66 90 48 89 5d e8 ff 75 e8 9d 01 00 00 00 e8 a5 50 cf fc 65 8b 05 9a b8 8d 7b 85 c0 74 09 48 RSP: 0018:ffffc900013bf638 EFLAGS: 00000a06 RAX: 0000000000000001 RBX: 0000000000000a06 RCX: dffffc0000000000 RDX: ffffc90000c276d8 RSI: 0000000000000a06 RDI: ffff888127026c00 RBP: ffffc900013bf650 R08: dffffc0000000000 R09: ffffed102251a769 R10: ffffed102251a769 R11: 1ffff1102251a768 R12: ffff888127026c00 R13: 0000000000000001 R14: 0000000000000001 R15: 0000000000000000 spin_unlock_irqrestore include/linux/spinlock.h:409 [inline] __wake_up_common_lock kernel/sched/wait.c:126 [inline] __wake_up_sync_key+0x166/0x280 kernel/sched/wait.c:194 unix_dgram_recvmsg+0x498/0xd40 net/unix/af_unix.c:2180 ____sys_recvmsg+0x291/0x580 net/socket.c:-1 ___sys_recvmsg+0x1af/0x4f0 net/socket.c:2637 do_recvmmsg+0x347/0x790 net/socket.c:2731 __sys_recvmmsg net/socket.c:2810 [inline] __do_sys_recvmmsg net/socket.c:2833 [inline] __se_sys_recvmmsg net/socket.c:2826 [inline] __x64_sys_recvmmsg+0x18d/0x240 net/socket.c:2826 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7faa49788929 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007faa47dd0038 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 00007faa499b0080 RCX: 00007faa49788929 RDX: 03fffffffffffeda RSI: 00002000000000c0 RDI: 0000000000000006 RBP: 00007faa4980ab39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007faa499b0080 R15: 00007ffdd495b328 Allocated by task 281: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] __kasan_slab_alloc+0xbd/0xf0 mm/kasan/common.c:463 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x5d/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x165/0x2e0 mm/slub.c:2960 kmem_cache_zalloc include/linux/slab.h:654 [inline] net_alloc net/core/net_namespace.c:421 [inline] copy_net_ns+0x13f/0x520 net/core/net_namespace.c:473 create_new_namespaces+0x3a2/0x650 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:231 ksys_unshare+0x4ac/0x7d0 kernel/fork.c:3156 __do_sys_unshare kernel/fork.c:3224 [inline] __se_sys_unshare kernel/fork.c:3222 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3222 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff888126392680 which belongs to the cache net_namespace of size 4672 The buggy address is located 400 bytes inside of 4672-byte region [ffff888126392680, ffff8881263938c0) The buggy address belongs to the page: page:ffffea000498e400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x126390 head:ffffea000498e400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888107fddb00 raw: 0000000000000000 0000000080060006 00000001ffffffff 0000000000000000 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 281, ts 21840149484, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x179/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5357 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1808 [inline] new_slab+0x84/0x3f0 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x2a6/0x450 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x1af/0x2e0 mm/slub.c:2960 kmem_cache_zalloc include/linux/slab.h:654 [inline] net_alloc net/core/net_namespace.c:421 [inline] copy_net_ns+0x13f/0x520 net/core/net_namespace.c:473 create_new_namespaces+0x3a2/0x650 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:231 ksys_unshare+0x4ac/0x7d0 kernel/fork.c:3156 __do_sys_unshare kernel/fork.c:3224 [inline] __se_sys_unshare kernel/fork.c:3222 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3222 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb page_owner free stack trace missing Memory state around the buggy address: ffff888126392700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888126392780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888126392800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888126392880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888126392900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 89 fe mov %edi,%esi 2: 48 c7 c7 f0 64 2c 86 mov $0xffffffff862c64f0,%rdi 9: e8 ab cf 28 fd call 0xfd28cfb9 e: 4c 89 f7 mov %r14,%rdi 11: 48 83 3d 20 b0 b7 01 cmpq $0x0,0x1b7b020(%rip) # 0x1b7b039 18: 00 19: 74 34 je 0x4f 1b: e8 1d 51 d6 fc call 0xfcd6513d 20: 66 90 xchg %ax,%ax 22: 48 89 5d e8 mov %rbx,-0x18(%rbp) 26: ff 75 e8 push -0x18(%rbp) 29: 9d popf * 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction 2f: e8 a5 50 cf fc call 0xfccf50d9 34: 65 8b 05 9a b8 8d 7b mov %gs:0x7b8db89a(%rip),%eax # 0x7b8db8d5 3b: 85 c0 test %eax,%eax 3d: 74 09 je 0x48 3f: 48 rex.W