==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x2d90/0x3c40 kernel/locking/lockdep.c:5091
Read of size 8 at addr ffff888021c37818 by task kworker/u32:7/1140
CPU: 0 UID: 0 PID: 1140 Comm: kworker/u32:7 Not tainted 6.13.0-syzkaller-08291-g805ba04cb7cc #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: events_unbound toggle_allocation_gate
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:489
kasan_report+0xd9/0x110 mm/kasan/report.c:602
__lock_acquire+0x2d90/0x3c40 kernel/locking/lockdep.c:5091
lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
p9_tag_remove net/9p/client.c:397 [inline]
p9_req_put net/9p/client.c:405 [inline]
p9_req_put+0xaf/0x250 net/9p/client.c:402
req_done+0x1e7/0x2f0 net/9p/trans_virtio.c:147
vring_interrupt drivers/virtio/virtio_ring.c:2715 [inline]
vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2690
__handle_irq_event_percpu+0x229/0x7d0 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x263/0xd10 kernel/irq/chip.c:831
generic_handle_irq_desc include/linux/irqdesc.h:173 [inline]
handle_irq arch/x86/kernel/irq.c:247 [inline]
call_irq_handler arch/x86/kernel/irq.c:259 [inline]
__common_interrupt+0xdf/0x250 arch/x86/kernel/irq.c:285
common_interrupt+0xba/0xe0 arch/x86/kernel/irq.c:278
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
RIP: 0010:kvm_hypercall1 arch/x86/include/asm/kvm_para.h:59 [inline]
RIP: 0010:kvm_smp_send_call_func_ipi+0x1e5/0x250 arch/x86/kernel/kvm.c:644
Code: 00 fc ff df 48 89 da 48 c1 ea 03 0f b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 5d 8b 1b b8 0b 00 00 00 0f 01 c1 3a ff ff ff e8 81 b2 50 00 90 0f 0b 48 89 df e8 a6 91 b3 00 e9
RSP: 0018:ffffc90006b078f8 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 0000000000000003 RCX: ffffffff8168285f
RDX: 0000000000000000 RSI: ffffffff8168286d RDI: ffffffff8da66cf8
RBP: 0000000000000001 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000006 R12: fffffbfff1c042ac
R13: dffffc0000000000 R14: 0000000000000003 R15: 0000000000000003
arch_send_call_function_ipi_mask arch/x86/include/asm/smp.h:99 [inline]
send_call_function_ipi_mask kernel/smp.c:127 [inline]
smp_call_function_many_cond+0xc7b/0x12c0 kernel/smp.c:869
on_each_cpu_cond_mask+0x40/0x90 kernel/smp.c:1052
on_each_cpu include/linux/smp.h:71 [inline]
text_poke_sync arch/x86/kernel/alternative.c:2114 [inline]
text_poke_bp_batch+0x561/0x760 arch/x86/kernel/alternative.c:2407
text_poke_flush arch/x86/kernel/alternative.c:2515 [inline]
text_poke_flush arch/x86/kernel/alternative.c:2512 [inline]
text_poke_finish+0x30/0x40 arch/x86/kernel/alternative.c:2522
arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146
jump_label_update+0x1d7/0x400 kernel/jump_label.c:920
static_key_enable_cpuslocked+0x1b7/0x270 kernel/jump_label.c:210
static_key_enable+0x1a/0x20 kernel/jump_label.c:223
toggle_allocation_gate mm/kfence/core.c:849 [inline]
toggle_allocation_gate+0xfc/0x260 mm/kfence/core.c:841
process_one_work+0x958/0x1b30 kernel/workqueue.c:3236
process_scheduled_works kernel/workqueue.c:3317 [inline]
worker_thread+0x6c8/0xf00 kernel/workqueue.c:3398
kthread+0x3af/0x750 kernel/kthread.c:464
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Allocated by task 13438:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
kmalloc_noprof include/linux/slab.h:901 [inline]
p9_client_create+0xc8/0x11a0 net/9p/client.c:985
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xa30 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8b/0x340 fs/super.c:1814
do_new_mount fs/namespace.c:3560 [inline]
path_mount+0x6e1/0x1f00 fs/namespace.c:3887
do_mount fs/namespace.c:3900 [inline]
__do_sys_mount fs/namespace.c:4111 [inline]
__se_sys_mount fs/namespace.c:4088 [inline]
__ia32_sys_mount+0x28d/0x310 fs/namespace.c:4088
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
Freed by task 13438:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576
poison_slab_object mm/kasan/common.c:247 [inline]
__kasan_slab_free+0x51/0x70 mm/kasan/common.c:264
kasan_slab_free include/linux/kasan.h:233 [inline]
slab_free_hook mm/slub.c:2353 [inline]
slab_free mm/slub.c:4609 [inline]
kfree+0x2c4/0x4d0 mm/slub.c:4757
p9_client_create+0x97d/0x11a0 net/9p/client.c:1064
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xa30 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8b/0x340 fs/super.c:1814
do_new_mount fs/namespace.c:3560 [inline]
path_mount+0x6e1/0x1f00 fs/namespace.c:3887
do_mount fs/namespace.c:3900 [inline]
__do_sys_mount fs/namespace.c:4111 [inline]
__se_sys_mount fs/namespace.c:4088 [inline]
__ia32_sys_mount+0x28d/0x310 fs/namespace.c:4088
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
The buggy address belongs to the object at ffff888021c37800
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
freed 512-byte region [ffff888021c37800, ffff888021c37a00)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x21c34
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801b042c80 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b042c80 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0000870d01 ffffffffffffffff 0000000000000000
head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5659, tgid 5659 (dhcpcd), ts 380757740085, free_ts 375444261620
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1551
prep_new_page mm/page_alloc.c:1559 [inline]
get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477
__alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4739
alloc_slab_page mm/slub.c:2425 [inline]
allocate_slab mm/slub.c:2587 [inline]
new_slab+0x94/0x330 mm/slub.c:2640
___slab_alloc+0xbfa/0x1600 mm/slub.c:3826
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916
__slab_alloc_node mm/slub.c:3991 [inline]
slab_alloc_node mm/slub.c:4152 [inline]
__do_kmalloc_node mm/slub.c:4293 [inline]
__kmalloc_node_noprof+0x2f0/0x520 mm/slub.c:4300
kmalloc_array_node_noprof include/linux/slab.h:1018 [inline]
alloc_slab_obj_exts+0x41/0xa0 mm/slub.c:1964
account_slab mm/slub.c:2550 [inline]
allocate_slab mm/slub.c:2605 [inline]
new_slab+0x285/0x330 mm/slub.c:2640
___slab_alloc+0xbfa/0x1600 mm/slub.c:3826
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916
__slab_alloc_node mm/slub.c:3991 [inline]
slab_alloc_node mm/slub.c:4152 [inline]
kmem_cache_alloc_noprof+0xeb/0x3b0 mm/slub.c:4171
anon_vma_chain_alloc mm/rmap.c:142 [inline]
anon_vma_fork+0x200/0x620 mm/rmap.c:364
dup_mmap kernel/fork.c:711 [inline]
dup_mm kernel/fork.c:1689 [inline]
copy_mm+0x1b10/0x2690 kernel/fork.c:1741
copy_process+0x3e6d/0x6f20 kernel/fork.c:2392
kernel_clone+0xfd/0x960 kernel/fork.c:2804
page last free pid 64 tgid 64 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1127 [inline]
free_frozen_pages+0x6db/0xfb0 mm/page_alloc.c:2660
__folio_put+0x32a/0x450 mm/swap.c:112
kvfree+0x47/0x50 mm/util.c:705
io_ring_ctx_free io_uring/io_uring.c:2734 [inline]
io_ring_exit_work+0xe96/0x1ba0 io_uring/io_uring.c:2937
process_one_work+0x958/0x1b30 kernel/workqueue.c:3236
process_scheduled_works kernel/workqueue.c:3317 [inline]
worker_thread+0x6c8/0xf00 kernel/workqueue.c:3398
kthread+0x3af/0x750 kernel/kthread.c:464
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Memory state around the buggy address:
ffff888021c37700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888021c37780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888021c37800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888021c37880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888021c37900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 4 bytes skipped:
0: 48 89 da mov %rbx,%rdx
3: 48 c1 ea 03 shr $0x3,%rdx
7: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx
b: 48 89 d8 mov %rbx,%rax
e: 83 e0 07 and $0x7,%eax
11: 83 c0 03 add $0x3,%eax
14: 38 d0 cmp %dl,%al
16: 7c 04 jl 0x1c
18: 84 d2 test %dl,%dl
1a: 75 5d jne 0x79
1c: 8b 1b mov (%rbx),%ebx
1e: b8 0b 00 00 00 mov $0xb,%eax
23: 0f 01 c1 vmcall
* 26: e9 3a ff ff ff jmp 0xffffff65 <-- trapping instruction
2b: e8 81 b2 50 00 call 0x50b2b1
30: 90 nop
31: 0f 0b ud2
33: 48 89 df mov %rbx,%rdi
36: e8 a6 91 b3 00 call 0xb391e1
3b: e9 .byte 0xe9