==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x2dd6/0x3b30 kernel/locking/lockdep.c:5005
Read of size 8 at addr ffff88801fac2018 by task syz-executor.1/5884
CPU: 0 PID: 5884 Comm: syz-executor.1 Not tainted 6.9.0-rc3-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
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+0x2dd6/0x3b30 kernel/locking/lockdep.c:5005
lock_acquire kernel/locking/lockdep.c:5754 [inline]
lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719
__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:394 [inline]
p9_req_put net/9p/client.c:402 [inline]
p9_req_put+0xca/0x250 net/9p/client.c:399
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:161 [inline]
handle_irq arch/x86/kernel/irq.c:238 [inline]
__common_interrupt+0xde/0x250 arch/x86/kernel/irq.c:257
common_interrupt+0xab/0xd0 arch/x86/kernel/irq.c:247
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x60 kernel/kcov.c:200
Code: be b0 01 00 00 e8 a0 ff ff ff 31 c0 c3 cc cc cc cc 66 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1e fa 65 48 8b 15 b4 c1 75 7e 65 8b 05 b5 c1 75 7e a9 00 01
RSP: 0018:ffffc90003407808 EFLAGS: 00000202
RAX: 0000000000000000 RBX: 0000000000000001 RCX: ffffffff81f577a3
RDX: ffff88804b698000 RSI: 0000000000000000 RDI: 0000000000000001
RBP: 0000000000049813 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000003 R12: 0000000080000001
R13: 0000000000000008 R14: 0000000000000001 R15: ffff88801d23e8b8
rcu_read_unlock include/linux/rcupdate.h:813 [inline]
page_ext_put+0x30/0xd0 mm/page_ext.c:533
page_table_check_clear mm/page_table_check.c:68 [inline]
__page_table_check_pte_clear+0x31c/0x570 mm/page_table_check.c:158
page_table_check_pte_clear include/linux/page_table_check.h:49 [inline]
ptep_get_and_clear_full arch/x86/include/asm/pgtable.h:1295 [inline]
get_and_clear_full_ptes include/linux/pgtable.h:634 [inline]
zap_present_folio_ptes mm/memory.c:1479 [inline]
zap_present_ptes mm/memory.c:1563 [inline]
zap_pte_range mm/memory.c:1605 [inline]
zap_pmd_range mm/memory.c:1722 [inline]
zap_pud_range mm/memory.c:1751 [inline]
zap_p4d_range mm/memory.c:1772 [inline]
unmap_page_range+0x1efc/0x3c10 mm/memory.c:1793
unmap_single_vma+0x194/0x2b0 mm/memory.c:1839
unmap_vmas+0x22f/0x490 mm/memory.c:1883
exit_mmap+0x1c1/0xb90 mm/mmap.c:3267
__mmput+0x12a/0x4d0 kernel/fork.c:1345
mmput+0x62/0x70 kernel/fork.c:1367
exit_mm kernel/exit.c:569 [inline]
do_exit+0x999/0x2c10 kernel/exit.c:865
do_group_exit+0xd3/0x2a0 kernel/exit.c:1027
__do_sys_exit_group kernel/exit.c:1038 [inline]
__se_sys_exit_group kernel/exit.c:1036 [inline]
__ia32_sys_exit_group+0x3e/0x50 kernel/exit.c:1036
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346
entry_SYSENTER_compat_after_hwframe+0x7f/0x89
RIP: 0023:0xf725f579
Code: Unable to access opcode bytes at 0xf725f54f.
RSP: 002b:00000000ff9eee0c EFLAGS: 00000282 ORIG_RAX: 00000000000000fc
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000000000
RDX: 00000000ffffffff RSI: 00000000ffffff9c RDI: 00000000f73b6ff4
RBP: 000000000000001e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Allocated by task 5883:
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 include/linux/slab.h:628 [inline]
p9_client_create+0xcf/0x11b0 net/9p/client.c:980
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xa90 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8f/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x6e1/0x1f10 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__ia32_sys_mount+0x295/0x320 fs/namespace.c:3875
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346
entry_SYSENTER_compat_after_hwframe+0x7f/0x89
Freed by task 5883:
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 mm/kasan/common.c:240 [inline]
__kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2106 [inline]
slab_free mm/slub.c:4280 [inline]
kfree+0x129/0x390 mm/slub.c:4390
p9_client_create+0x9ca/0x11b0 net/9p/client.c:1051
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xa90 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8f/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x6e1/0x1f10 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__ia32_sys_mount+0x295/0x320 fs/namespace.c:3875
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346
entry_SYSENTER_compat_after_hwframe+0x7f/0x89
The buggy address belongs to the object at ffff88801fac2000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
freed 512-byte region [ffff88801fac2000, ffff88801fac2200)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801fac0000 pfn:0x1fac0
head: order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0
ksm flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff)
page_type: 0xffffffff()
raw: 00fff80000000840 ffff888014c42c80 ffffea00012d6500 dead000000000003
raw: ffff88801fac0000 000000008010000f 00000001ffffffff 0000000000000000
head: 00fff80000000840 ffff888014c42c80 ffffea00012d6500 dead000000000003
head: ffff88801fac0000 000000008010000f 00000001ffffffff 0000000000000000
head: 00fff80000000002 ffffea00007eb001 dead000000000122 00000000ffffffff
head: 0000000400000000 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 5210, tgid 5210 (syz-executor.2), ts 60371364974, free_ts 59451463128
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x670/0x16d0 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__slab_alloc_node mm/slub.c:3663 [inline]
slab_alloc_node mm/slub.c:3835 [inline]
__do_kmalloc_node mm/slub.c:3965 [inline]
__kmalloc+0x3b4/0x440 mm/slub.c:3979
kmalloc include/linux/slab.h:632 [inline]
kzalloc include/linux/slab.h:749 [inline]
new_dir fs/proc/proc_sysctl.c:956 [inline]
get_subdir fs/proc/proc_sysctl.c:1000 [inline]
sysctl_mkdir_p fs/proc/proc_sysctl.c:1295 [inline]
__register_sysctl_table+0xda8/0x16f0 fs/proc/proc_sysctl.c:1376
neigh_sysctl_register+0x32d/0x660 net/core/neighbour.c:3859
addrconf_sysctl_register+0xb9/0x1f0 net/ipv6/addrconf.c:7259
addrconf_notify+0x11e/0x19e0 net/ipv6/addrconf.c:3783
notifier_call_chain+0xb9/0x410 kernel/notifier.c:93
call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950
call_netdevice_notifiers_extack net/core/dev.c:1988 [inline]
call_netdevice_notifiers net/core/dev.c:2002 [inline]
dev_change_name+0x42b/0x8e0 net/core/dev.c:1224
do_setlink+0x2f04/0x3ea0 net/core/rtnetlink.c:2864
__rtnl_newlink+0xc3a/0x1960 net/core/rtnetlink.c:3680
page last free pid 5219 tgid 5219 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1141 [inline]
free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3798 [inline]
slab_alloc_node mm/slub.c:3845 [inline]
kmalloc_trace+0x147/0x330 mm/slub.c:3992
kmalloc include/linux/slab.h:628 [inline]
rtnl_newlink+0x49/0xa0 net/core/rtnetlink.c:3723
rtnetlink_rcv_msg+0x3c7/0xe60 net/core/rtnetlink.c:6595
netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2559
netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline]
netlink_unicast+0x542/0x820 net/netlink/af_netlink.c:1361
netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1905
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
__sys_sendto+0x47f/0x4e0 net/socket.c:2191
__do_compat_sys_socketcall+0x5e2/0x700 net/compat.c:475
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346
entry_SYSENTER_compat_after_hwframe+0x7f/0x89
Memory state around the buggy address:
ffff88801fac1f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88801fac1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88801fac2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801fac2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801fac2100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: be b0 01 00 00 mov $0x1b0,%esi
5: e8 a0 ff ff ff call 0xffffffaa
a: 31 c0 xor %eax,%eax
c: c3 ret
d: cc int3
e: cc int3
f: cc int3
10: cc int3
11: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
18: 00 00
1a: 90 nop
1b: 90 nop
1c: 90 nop
1d: 90 nop
1e: 90 nop
1f: 90 nop
20: 90 nop
21: 90 nop
22: 90 nop
23: 90 nop
24: 90 nop
25: 90 nop
26: 90 nop
27: 90 nop
28: 90 nop
29: 90 nop
* 2a: f3 0f 1e fa endbr64 <-- trapping instruction
2e: 65 48 8b 15 b4 c1 75 mov %gs:0x7e75c1b4(%rip),%rdx # 0x7e75c1ea
35: 7e
36: 65 8b 05 b5 c1 75 7e mov %gs:0x7e75c1b5(%rip),%eax # 0x7e75c1f2
3d: a9 .byte 0xa9
3e: 00 01 add %al,(%rcx)