==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x2de0/0x3cb0 kernel/locking/lockdep.c:5007
Read of size 8 at addr ffff8880210b0818 by task kworker/u32:1/12
CPU: 0 PID: 12 Comm: kworker/u32:1 Not tainted 6.10.0-syzkaller-11185-g2c9b3512402e #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:88 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
__lock_acquire+0x2de0/0x3cb0 kernel/locking/lockdep.c:5007
lock_acquire kernel/locking/lockdep.c:5759 [inline]
lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5724
__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+0xca/0x250 net/9p/client.c:402
req_done+0x1e7/0x2f0 net/9p/trans_virtio.c:147
vring_interrupt drivers/virtio/virtio_ring.c:2595 [inline]
vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2570
__handle_irq_event_percpu+0x229/0x7c0 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+0xab/0xd0 arch/x86/kernel/irq.c:278
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
RIP: 0010:arch_static_branch arch/x86/include/asm/jump_label.h:27 [inline]
RIP: 0010:static_key_false include/linux/jump_label.h:207 [inline]
RIP: 0010:native_write_msr arch/x86/include/asm/msr.h:162 [inline]
RIP: 0010:wrmsrl arch/x86/include/asm/msr.h:277 [inline]
RIP: 0010:native_x2apic_icr_write arch/x86/include/asm/apic.h:230 [inline]
RIP: 0010:__x2apic_send_IPI_shorthand arch/x86/kernel/apic/x2apic_phys.c:92 [inline]
RIP: 0010:x2apic_send_IPI_allbutself+0x25/0x40 arch/x86/kernel/apic/x2apic_phys.c:97
Code: 90 90 90 90 90 f3 0f 1e fa 89 f8 ba 00 04 0c 00 0d 00 00 0c 00 83 ff 02 0f 44 c2 0f ae f0 0f ae e8 b9 30 08 00 00 31 d2 0f 30 <66> 90 c3 cc cc cc cc 89 c6 31 d2 bf 30 08 00 00 e9 d6 70 74 03 66
RSP: 0018:ffffc900003e78d0 EFLAGS: 00000246
RAX: 00000000000c00fc RBX: 0000000000000001 RCX: 0000000000000830
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 00000000000000fc
RBP: ffff88802c03fe90 R08: 0000000000000000 R09: ffffed1005807fd2
R10: ffff88802c03fe97 R11: 0000000000000000 R12: ffffffff817eca90
R13: 0000000000000000 R14: 0000000000000003 R15: ffff88802c03fe80
kvm_smp_send_call_func_ipi+0x1e/0x260 arch/x86/kernel/kvm.c:638
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+0xd01/0x1420 kernel/smp.c:840
on_each_cpu_cond_mask+0x40/0x90 kernel/smp.c:1023
on_each_cpu include/linux/smp.h:71 [inline]
text_poke_sync arch/x86/kernel/alternative.c:2085 [inline]
text_poke_bp_batch+0x659/0x760 arch/x86/kernel/alternative.c:2295
text_poke_flush arch/x86/kernel/alternative.c:2486 [inline]
text_poke_flush arch/x86/kernel/alternative.c:2483 [inline]
text_poke_finish+0x30/0x40 arch/x86/kernel/alternative.c:2493
arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146
jump_label_update+0x1d7/0x400 kernel/jump_label.c:900
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:826 [inline]
toggle_allocation_gate+0xf8/0x250 mm/kfence/core.c:818
process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390
kthread+0x2c1/0x3a0 kernel/kthread.c:389
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Allocated by task 6630:
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:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kmalloc_noprof include/linux/slab.h:681 [inline]
p9_client_create+0xcf/0x11b0 net/9p/client.c:983
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xaa0 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8f/0x380 fs/super.c:1789
do_new_mount fs/namespace.c:3472 [inline]
path_mount+0x6e1/0x1f10 fs/namespace.c:3799
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount fs/namespace.c:3997 [inline]
__ia32_sys_mount+0x292/0x310 fs/namespace.c:3997
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 6630:
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:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2235 [inline]
slab_free mm/slub.c:4464 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4585
p9_client_create+0x9ca/0x11b0 net/9p/client.c:1054
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xaa0 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8f/0x380 fs/super.c:1789
do_new_mount fs/namespace.c:3472 [inline]
path_mount+0x6e1/0x1f10 fs/namespace.c:3799
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount fs/namespace.c:3997 [inline]
__ia32_sys_mount+0x292/0x310 fs/namespace.c:3997
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 ffff8880210b0800
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
freed 512-byte region [ffff8880210b0800, ffff8880210b0a00)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x210b0
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: 0xffffefff(slab)
raw: 00fff00000000040 ffff888015442c80 ffffea000002ff00 dead000000000002
raw: 0000000000000000 0000000080100010 00000001ffffefff 0000000000000000
head: 00fff00000000040 ffff888015442c80 ffffea000002ff00 dead000000000002
head: 0000000000000000 0000000080100010 00000001ffffefff 0000000000000000
head: 00fff00000000002 ffffea0000842c01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5218, tgid 5218 (syz-executor), ts 58216036657, free_ts 57734510467
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1473
prep_new_page mm/page_alloc.c:1481 [inline]
get_page_from_freelist+0x1353/0x2e50 mm/page_alloc.c:3425
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4683
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x56/0x110 mm/slub.c:2304
allocate_slab mm/slub.c:2467 [inline]
new_slab+0x84/0x260 mm/slub.c:2520
___slab_alloc+0xdac/0x1870 mm/slub.c:3706
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3796
__slab_alloc_node mm/slub.c:3849 [inline]
slab_alloc_node mm/slub.c:4016 [inline]
__kmalloc_cache_noprof+0x2c5/0x310 mm/slub.c:4175
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
mca_alloc net/ipv6/mcast.c:880 [inline]
__ipv6_dev_mc_inc+0x2b7/0xc50 net/ipv6/mcast.c:936
ipv6_add_dev+0xa93/0x1400 net/ipv6/addrconf.c:468
addrconf_notify+0x546/0x19e0 net/ipv6/addrconf.c:3653
notifier_call_chain+0xb9/0x410 kernel/notifier.c:93
call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1994
call_netdevice_notifiers_extack net/core/dev.c:2032 [inline]
call_netdevice_notifiers net/core/dev.c:2046 [inline]
register_netdevice+0x1728/0x1e20 net/core/dev.c:10468
team_newlink+0x92/0x160 drivers/net/team/team_core.c:2217
rtnl_newlink_create net/core/rtnetlink.c:3510 [inline]
__rtnl_newlink+0x119c/0x1960 net/core/rtnetlink.c:3730
page last free pid 4648 tgid 4648 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1093 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2588
rcu_do_batch kernel/rcu/tree.c:2569 [inline]
rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2843
handle_softirqs+0x216/0x8f0 kernel/softirq.c:554
__do_softirq kernel/softirq.c:588 [inline]
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu kernel/softirq.c:637 [inline]
irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
Memory state around the buggy address:
ffff8880210b0700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880210b0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880210b0800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880210b0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880210b0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 90 nop
1: 90 nop
2: 90 nop
3: 90 nop
4: 90 nop
5: f3 0f 1e fa endbr64
9: 89 f8 mov %edi,%eax
b: ba 00 04 0c 00 mov $0xc0400,%edx
10: 0d 00 00 0c 00 or $0xc0000,%eax
15: 83 ff 02 cmp $0x2,%edi
18: 0f 44 c2 cmove %edx,%eax
1b: 0f ae f0 mfence
1e: 0f ae e8 lfence
21: b9 30 08 00 00 mov $0x830,%ecx
26: 31 d2 xor %edx,%edx
28: 0f 30 wrmsr
* 2a: 66 90 xchg %ax,%ax <-- trapping instruction
2c: c3 ret
2d: cc int3
2e: cc int3
2f: cc int3
30: cc int3
31: 89 c6 mov %eax,%esi
33: 31 d2 xor %edx,%edx
35: bf 30 08 00 00 mov $0x830,%edi
3a: e9 d6 70 74 03 jmp 0x3747115
3f: 66 data16