==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4925
Read of size 8 at addr ffff88801c38d018 by task syz-executor.0/5191
CPU: 0 PID: 5191 Comm: syz-executor.0 Not tainted 6.1.0-rc7-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15e/0x461 mm/kasan/report.c:395
kasan_report+0xbf/0x1f0 mm/kasan/report.c:495
__lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4925
lock_acquire kernel/locking/lockdep.c:5668 [inline]
lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162
p9_tag_remove net/9p/client.c:385 [inline]
p9_req_put net/9p/client.c:393 [inline]
p9_req_put+0xca/0x250 net/9p/client.c:390
req_done+0x1e2/0x2e0 net/9p/trans_virtio.c:148
vring_interrupt drivers/virtio/virtio_ring.c:2470 [inline]
vring_interrupt+0x2a1/0x3d0 drivers/virtio/virtio_ring.c:2445
__handle_irq_event_percpu+0x264/0x970 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/0xd00 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xa1/0x210 arch/x86/kernel/irq.c:250
common_interrupt+0xa8/0xd0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:640
RIP: 0010:on_stack arch/x86/include/asm/stacktrace.h:56 [inline]
RIP: 0010:stack_access_ok+0x74/0x1d0 arch/x86/kernel/unwind_orc.c:347
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 2c 01 00 00 48 8d 7b 10 4c 8b 6b 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 13 01 00 00 49 39 ed 48 8b 43 10 77 1a 48 39 e8
RSP: 0000:ffffc900076a76e8 EFLAGS: 00000a02
RAX: dffffc0000000000 RBX: ffffc900076a7790 RCX: 0000000000000001
RDX: 1ffff92000ed4ef4 RSI: ffffc900076a7c88 RDI: ffffc900076a77a0
RBP: ffffc900076a7c88 R08: ffffffff8eded88a R09: ffffc900076a77c4
R10: fffff52000ed4efd R11: ffffc900076a7cb0 R12: 0000000000000008
R13: ffffc900076a0000 R14: ffffc900076a7c88 R15: ffffffff8eded88e
deref_stack_reg arch/x86/kernel/unwind_orc.c:357 [inline]
unwind_next_frame+0x136f/0x1d00 arch/x86/kernel/unwind_orc.c:605
arch_stack_walk+0x81/0xf0 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x90/0xc0 kernel/stacktrace.c:122
save_stack+0x151/0x1e0 mm/page_owner.c:127
__set_page_owner+0x1f/0x60 mm/page_owner.c:190
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4291
__alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5558
__folio_alloc+0x16/0x40 mm/page_alloc.c:5590
vma_alloc_folio+0xfd/0x780 mm/mempolicy.c:2246
alloc_page_vma include/linux/gfp.h:270 [inline]
do_anonymous_page mm/memory.c:4114 [inline]
handle_pte_fault mm/memory.c:4953 [inline]
__handle_mm_fault+0x178c/0x3a40 mm/memory.c:5097
handle_mm_fault+0x1cc/0x780 mm/memory.c:5218
do_user_addr_fault+0x475/0x1210 arch/x86/mm/fault.c:1428
handle_page_fault arch/x86/mm/fault.c:1519 [inline]
exc_page_fault+0x98/0x170 arch/x86/mm/fault.c:1575
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0033:0x7f5e7e63e0e1
Code: 3d 00 f0 ff ff 77 72 c3 90 55 48 83 ec 30 44 89 4c 24 2c 4c 89 44 24 20 48 89 54 24 18 48 89 74 24 10 89 7c 24 08 89 4c 24 28 fa fa ff ff 44 8b 4c 24 2c 4c 8b 44 24 20 89 c5 44 8b 54 24 28
RSP: 002b:00007f5e7f493000 EFLAGS: 00010206
RAX: 0000000000000001 RBX: 00007f5e7f4930f0 RCX: 0000000000000000
RDX: 0000000000000020 RSI: 00007f5e7f493140 RDI: 0000000000000004
RBP: 0000000000000000 R08: 00007f5e7f493054 R09: 000000000000000c
R10: 0000000000000000 R11: 00000000200000cf R12: 00007f5e7f4930a8
R13: 00007f5e7f493140 R14: 0000000000000004 R15: 0000000000000000
Allocated by task 5190:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:371 [inline]
____kasan_kmalloc mm/kasan/common.c:330 [inline]
__kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:380
kmalloc include/linux/slab.h:553 [inline]
p9_client_create+0xb3/0x1070 net/9p/client.c:964
v9fs_session_init+0x1e6/0x18b0 fs/9p/v9fs.c:408
v9fs_mount+0xbe/0xca0 fs/9p/vfs_super.c:126
legacy_get_tree+0x109/0x220 fs/fs_context.c:610
vfs_get_tree+0x8d/0x2f0 fs/super.c:1531
do_new_mount fs/namespace.c:3040 [inline]
path_mount+0x132a/0x1e20 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__x64_sys_mount+0x283/0x300 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Freed by task 5190:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:511
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x13b/0x1a0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:177 [inline]
__cache_free mm/slab.c:3389 [inline]
__do_kmem_cache_free mm/slab.c:3585 [inline]
__kmem_cache_free+0xcd/0x3b0 mm/slab.c:3592
p9_client_create+0x7aa/0x1070 net/9p/client.c:1035
v9fs_session_init+0x1e6/0x18b0 fs/9p/v9fs.c:408
v9fs_mount+0xbe/0xca0 fs/9p/vfs_super.c:126
legacy_get_tree+0x109/0x220 fs/fs_context.c:610
vfs_get_tree+0x8d/0x2f0 fs/super.c:1531
do_new_mount fs/namespace.c:3040 [inline]
path_mount+0x132a/0x1e20 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__x64_sys_mount+0x283/0x300 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Last potentially related work creation:
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
__kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:481
insert_work+0x48/0x350 kernel/workqueue.c:1358
__queue_work+0x693/0x13b0 kernel/workqueue.c:1517
call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0xb7/0x1d0 kernel/time/timer.c:1803
__do_softirq+0x1fb/0xadc kernel/softirq.c:571
The buggy address belongs to the object at ffff88801c38d000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
512-byte region [ffff88801c38d000, ffff88801c38d200)
The buggy address belongs to the physical page:
page:ffffea000070e340 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c38d
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0000950708 ffffea0000794688 ffff888012040600
raw: 0000000000000000 ffff88801c38d000 0000000100000004 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2c20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 3740, tgid 3740 (syz-executor.3), ts 147035499888, free_ts 142419193218
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4291
__alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5558
__alloc_pages_node include/linux/gfp.h:223 [inline]
kmem_getpages mm/slab.c:1363 [inline]
cache_grow_begin+0x75/0x360 mm/slab.c:2570
cache_alloc_refill+0x27f/0x380 mm/slab.c:2943
____cache_alloc mm/slab.c:3019 [inline]
____cache_alloc mm/slab.c:3002 [inline]
__do_cache_alloc mm/slab.c:3202 [inline]
slab_alloc_node mm/slab.c:3250 [inline]
__kmem_cache_alloc_node+0x44a/0x510 mm/slab.c:3549
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc_node_track_caller+0x4b/0xc0 mm/slab_common.c:975
kmalloc_reserve net/core/skbuff.c:437 [inline]
__alloc_skb+0xdd/0x300 net/core/skbuff.c:509
alloc_skb include/linux/skbuff.h:1267 [inline]
nlmsg_new include/net/netlink.h:970 [inline]
netlink_ack+0x38d/0xd60 net/netlink/af_netlink.c:2490
netlink_rcv_skb+0x341/0x430 net/netlink/af_netlink.c:2546
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1345
netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1921
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg+0xd3/0x120 net/socket.c:734
__sys_sendto+0x23a/0x340 net/socket.c:2117
__do_sys_sendto net/socket.c:2129 [inline]
__se_sys_sendto net/socket.c:2125 [inline]
__x64_sys_sendto+0xe1/0x1b0 net/socket.c:2125
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1459 [inline]
free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509
free_unref_page_prepare mm/page_alloc.c:3387 [inline]
free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3483
slab_destroy mm/slab.c:1615 [inline]
slabs_destroy+0x85/0xc0 mm/slab.c:1635
cache_flusharray mm/slab.c:3360 [inline]
___cache_free+0x2ac/0x3d0 mm/slab.c:3423
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x4f/0x1a0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x184/0x210 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:302
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slab.h:737 [inline]
slab_alloc_node mm/slab.c:3257 [inline]
__kmem_cache_alloc_node+0x266/0x510 mm/slab.c:3549
kmalloc_trace+0x26/0x60 mm/slab_common.c:1045
kmalloc include/linux/slab.h:553 [inline]
kzalloc include/linux/slab.h:689 [inline]
kobject_uevent_env+0x234/0x1620 lib/kobject_uevent.c:524
__kobject_del+0x160/0x1f0 lib/kobject.c:585
kobject_cleanup lib/kobject.c:664 [inline]
kobject_release lib/kobject.c:704 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x2f1/0x4d0 lib/kobject.c:721
netdev_queue_update_kobjects+0x36b/0x4f0 net/core/net-sysfs.c:1733
netif_set_real_num_tx_queues+0x1ba/0x770 net/core/dev.c:2893
veth_init_queues+0xdd/0x190 drivers/net/veth.c:1687
veth_newlink+0x526/0x990 drivers/net/veth.c:1807
Memory state around the buggy address:
ffff88801c38cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88801c38cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88801c38d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801c38d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801c38d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 48 89 fa mov %rdi,%rdx
3: 48 c1 ea 03 shr $0x3,%rdx
7: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
b: 0f 85 2c 01 00 00 jne 0x13d
11: 48 8d 7b 10 lea 0x10(%rbx),%rdi
15: 4c 8b 6b 08 mov 0x8(%rbx),%r13
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 13 01 00 00 jne 0x147
34: 49 39 ed cmp %rbp,%r13
37: 48 8b 43 10 mov 0x10(%rbx),%rax
3b: 77 1a ja 0x57
3d: 48 39 e8 cmp %rbp,%rax