================================================================== BUG: KASAN: slab-use-after-free in nsproxy_free+0x572/0x5a0 Read of size 8 at addr ffff888013813e30 by task syz-executor.7/8462 CPU: 0 UID: 0 PID: 8462 Comm: syz-executor.7 Not tainted 6.18.0-rc5-next-20251112 #1 PREEMPT(voluntary) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0xca/0x120 print_report+0xcb/0x610 kasan_report+0xca/0x100 nsproxy_free+0x572/0x5a0 create_new_namespaces+0x585/0x750 copy_namespaces+0x45c/0x580 copy_process+0x26e4/0x72a0 kernel_clone+0xea/0x7f0 __do_sys_clone3+0x1f5/0x280 do_syscall_64+0xbf/0x430 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc713082b19 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc7105d7188 EFLAGS: 00000246 ORIG_RAX: 00000000000001b3 RAX: ffffffffffffffda RBX: 00007fc713196020 RCX: 00007fc713082b19 RDX: 0000000000000000 RSI: 0000000000000058 RDI: 0000000020000240 RBP: 00007fc7130dcf6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcf3f2ad6f R14: 00007fc7105d7300 R15: 0000000000022000 Allocated by task 7610: kasan_save_stack+0x24/0x50 kasan_save_track+0x14/0x30 __kasan_kmalloc+0x7f/0x90 copy_time_ns+0xf6/0x5f0 create_new_namespaces+0x466/0x750 unshare_nsproxy_namespaces+0xc0/0x200 ksys_unshare+0x468/0xa10 __x64_sys_unshare+0x31/0x40 do_syscall_64+0xbf/0x430 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 351: kasan_save_stack+0x24/0x50 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3a/0x60 __kasan_slab_free+0x43/0x70 kmem_cache_free_bulk+0x2ad/0x660 kvfree_rcu_bulk+0x13b/0x2f0 kfree_rcu_work+0xe8/0x160 process_one_work+0x8e1/0x19c0 worker_thread+0x67e/0xe90 kthread+0x3c8/0x740 ret_from_fork+0x67a/0x7a0 ret_from_fork_asm+0x1a/0x30 Last potentially related work creation: kasan_save_stack+0x24/0x50 kasan_record_aux_stack+0x89/0xa0 kvfree_call_rcu+0x39/0x3e0 free_time_ns+0x10e/0x1c0 nsproxy_free+0x3e3/0x5a0 switch_task_namespaces+0x102/0x120 do_exit+0x849/0x2970 do_group_exit+0xd3/0x2a0 get_signal+0x2311/0x2340 arch_do_signal_or_restart+0x80/0x7a0 exit_to_user_mode_loop+0x92/0x4d0 do_syscall_64+0x3c7/0x430 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888013813e00 which belongs to the cache kmalloc-cg-256 of size 256 The buggy address is located 48 bytes inside of freed 256-byte region [ffff888013813e00, ffff888013813f00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888013813000 pfn:0x13812 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88800a592201 flags: 0x100000000000040(head|node=0|zone=1) page_type: f5(slab) raw: 0100000000000040 ffff888008c4b000 ffffea00014a2d00 0000000000000002 raw: ffff888013813000 000000000010000e 00000000f5000000 ffff88800a592201 head: 0100000000000040 ffff888008c4b000 ffffea00014a2d00 0000000000000002 head: ffff888013813000 000000000010000e 00000000f5000000 ffff88800a592201 head: 0100000000000001 ffffea00004e0481 00000000ffffffff 00000000ffffffff head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888013813d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888013813d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888013813e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888013813e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888013813f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: lib/refcount.c:28 at refcount_warn_saturate+0x10d/0x210, CPU#0: syz-executor.7/8462 Modules linked in: CPU: 0 UID: 0 PID: 8462 Comm: syz-executor.7 Tainted: G B 6.18.0-rc5-next-20251112 #1 PREEMPT(voluntary) Tainted: [B]=BAD_PAGE Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 RIP: 0010:refcount_warn_saturate+0x10d/0x210 Code: c6 0c 04 31 ff 89 de e8 91 84 1f ff 84 db 75 9f e8 b8 89 1f ff c6 05 fe c5 0c 04 01 90 48 c7 c7 80 07 03 85 e8 b4 b5 e4 fe 90 <0f> 0b 90 90 e9 7c ff ff ff e8 95 89 1f ff 0f b6 1d d9 c5 0c 04 31 RSP: 0018:ffff88800a2f79e0 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffc90002ca0000 RDX: 0000000000040000 RSI: ffffffff8139f03e RDI: 0000000000000001 RBP: ffff888013813e2c R08: 0000000000000001 R09: ffffed100145eef3 R10: 0000000000000001 R11: 0000000000000001 R12: ffff888013813e00 R13: ffff888013813e2c R14: ffffffff85cfbf20 R15: ffff88801b875bb8 FS: 00007fc7105d7700(0000) GS:ffff8880e5397000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffeb1a88f98 CR3: 0000000017e7f000 CR4: 0000000000350ef0 Call Trace: nsproxy_free+0x4ea/0x5a0 create_new_namespaces+0x585/0x750 copy_namespaces+0x45c/0x580 copy_process+0x26e4/0x72a0 kernel_clone+0xea/0x7f0 __do_sys_clone3+0x1f5/0x280 do_syscall_64+0xbf/0x430 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc713082b19 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc7105d7188 EFLAGS: 00000246 ORIG_RAX: 00000000000001b3 RAX: ffffffffffffffda RBX: 00007fc713196020 RCX: 00007fc713082b19 RDX: 0000000000000000 RSI: 0000000000000058 RDI: 0000000020000240 RBP: 00007fc7130dcf6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcf3f2ad6f R14: 00007fc7105d7300 R15: 0000000000022000 irq event stamp: 10841 hardirqs last enabled at (10841): [] irqentry_exit+0x17b/0x650 hardirqs last disabled at (10840): [] handle_softirqs+0x633/0x770 softirqs last enabled at (10046): [] netlink_release+0xfbc/0x1fa0 softirqs last disabled at (10044): [] netlink_release+0xf19/0x1fa0 ---[ end trace 0000000000000000 ]--- Oops: general protection fault, probably for non-canonical address 0xdffffc000000002e: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000170-0x0000000000000177] CPU: 0 UID: 0 PID: 8462 Comm: syz-executor.7 Tainted: G B W 6.18.0-rc5-next-20251112 #1 PREEMPT(voluntary) Tainted: [B]=BAD_PAGE, [W]=WARN Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 RIP: 0010:nsproxy_free+0x28a/0x5a0 Code: 02 00 00 4c 8b 65 28 4d 85 e4 74 43 e8 4f 47 30 00 49 8d bc 24 78 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 f7 02 00 00 49 8b 9c 24 78 01 00 00 bf 08 00 00 RSP: 0018:ffff88800a2f79f8 EFLAGS: 00010217 RAX: dffffc0000000000 RBX: 0000000000000002 RCX: ffffc90002ca0000 RDX: 000000000000002e RSI: ffffffff81447b61 RDI: 0000000000000174 RBP: ffff88800d19c7b8 R08: 0000000000000001 R09: ffffed100130e4c3 R10: 0000000000000002 R11: 0000000000000001 R12: fffffffffffffffc R13: ffff88800987261c R14: ffffffff85cfbf20 R15: ffff88801b875bb8 FS: 00007fc7105d7700(0000) GS:ffff8880e5397000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffeb1a88f98 CR3: 0000000017e7f000 CR4: 0000000000350ef0 Call Trace: create_new_namespaces+0x585/0x750 copy_namespaces+0x45c/0x580 copy_process+0x26e4/0x72a0 kernel_clone+0xea/0x7f0 __do_sys_clone3+0x1f5/0x280 do_syscall_64+0xbf/0x430 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc713082b19 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc7105d7188 EFLAGS: 00000246 ORIG_RAX: 00000000000001b3 RAX: ffffffffffffffda RBX: 00007fc713196020 RCX: 00007fc713082b19 RDX: 0000000000000000 RSI: 0000000000000058 RDI: 0000000020000240 RBP: 00007fc7130dcf6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcf3f2ad6f R14: 00007fc7105d7300 R15: 0000000000022000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:nsproxy_free+0x28a/0x5a0 Code: 02 00 00 4c 8b 65 28 4d 85 e4 74 43 e8 4f 47 30 00 49 8d bc 24 78 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 f7 02 00 00 49 8b 9c 24 78 01 00 00 bf 08 00 00 RSP: 0018:ffff88800a2f79f8 EFLAGS: 00010217 RAX: dffffc0000000000 RBX: 0000000000000002 RCX: ffffc90002ca0000 RDX: 000000000000002e RSI: ffffffff81447b61 RDI: 0000000000000174 RBP: ffff88800d19c7b8 R08: 0000000000000001 R09: ffffed100130e4c3 R10: 0000000000000002 R11: 0000000000000001 R12: fffffffffffffffc R13: ffff88800987261c R14: ffffffff85cfbf20 R15: ffff88801b875bb8 FS: 00007fc7105d7700(0000) GS:ffff8880e5397000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffeb1a88f98 CR3: 0000000017e7f000 CR4: 0000000000350ef0 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium sr 1:0:0:0: [sr0] tag#0 unaligned transfer I/O error, dev sr0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev sr0, logical block 0, async page read sr 1:0:0:0: [sr0] tag#0 unaligned transfer I/O error, dev sr0, sector 1 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev sr0, logical block 1, async page read sr 1:0:0:0: [sr0] tag#0 unaligned transfer I/O error, dev sr0, sector 2 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev sr0, logical block 2, async page read sr 1:0:0:0: [sr0] tag#0 unaligned transfer I/O error, dev sr0, sector 3 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2 Buffer I/O error on dev sr0, logical block 3, async page read ---------------- Code disassembly (best guess): 0: 02 00 add (%rax),%al 2: 00 4c 8b 65 add %cl,0x65(%rbx,%rcx,4) 6: 28 4d 85 sub %cl,-0x7b(%rbp) 9: e4 74 in $0x74,%al b: 43 e8 4f 47 30 00 rex.XB callq 0x304760 11: 49 8d bc 24 78 01 00 lea 0x178(%r12),%rdi 18: 00 19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 20: fc ff df 23: 48 89 fa mov %rdi,%rdx 26: 48 c1 ea 03 shr $0x3,%rdx * 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction 2e: 0f 85 f7 02 00 00 jne 0x32b 34: 49 8b 9c 24 78 01 00 mov 0x178(%r12),%rbx 3b: 00 3c: bf .byte 0xbf 3d: 08 00 or %al,(%rax)