==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x2dfe/0x3ce0 kernel/locking/lockdep.c:5062
Read of size 8 at addr ffff8880254f0c18 by task vivid-000-vid-c/5916
CPU: 3 UID: 0 PID: 5916 Comm: vivid-000-vid-c Not tainted 6.11.0-syzkaller-11993-g3efc57369a0c #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
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:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
__lock_acquire+0x2dfe/0x3ce0 kernel/locking/lockdep.c:5062
lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5822
__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: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+0xba/0xe0 arch/x86/kernel/irq.c:278
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
RIP: 0010:__schedule+0xefd/0x5750 kernel/sched/core.c:6533
Code: fa 48 c1 ea 03 80 3c 02 00 0f 85 29 45 00 00 48 8b bd 10 ff ff ff 4d 89 67 10 4c 89 e6 e8 bb d5 dd f5 48 89 c7 e8 63 4b 3a f6 <48> 8b b5 98 fe ff ff 48 b8 00 00 00 00 00 fc ff df 48 01 c6 48 c7
RSP: 0018:ffffc90003ccfc40 EFLAGS: 00000202
RAX: 000000000009abbf RBX: ffff888026f54880 RCX: 1ffffffff20bdcc9
RDX: 0000000000000000 RSI: ffffffff8b6cd040 RDI: ffffffff8bd19b00
RBP: ffffc90003ccfdd8 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff905f288f R11: 0000000000000001 R12: ffff88806a93fa08
R13: 0000000000000000 R14: 0000000000000000 R15: ffff88806a93ee80
__schedule_loop kernel/sched/core.c:6752 [inline]
schedule+0xe7/0x350 kernel/sched/core.c:6767
vivid_thread_vid_cap+0x6c9/0xb90 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:794
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 5937:
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:878 [inline]
p9_client_create+0xc8/0x11b0 net/9p/client.c:983
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xa50 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8f/0x380 fs/super.c:1800
do_new_mount fs/namespace.c:3507 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3834
do_mount fs/namespace.c:3847 [inline]
__do_sys_mount fs/namespace.c:4055 [inline]
__se_sys_mount fs/namespace.c:4032 [inline]
__x64_sys_mount+0x294/0x320 fs/namespace.c:4032
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 5937:
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:247 [inline]
__kasan_slab_free+0x51/0x70 mm/kasan/common.c:264
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:2343 [inline]
slab_free mm/slub.c:4580 [inline]
kfree+0x14f/0x4b0 mm/slub.c:4728
p9_client_create+0xa58/0x11b0 net/9p/client.c:1054
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xa50 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8f/0x380 fs/super.c:1800
do_new_mount fs/namespace.c:3507 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3834
do_mount fs/namespace.c:3847 [inline]
__do_sys_mount fs/namespace.c:4055 [inline]
__se_sys_mount fs/namespace.c:4032 [inline]
__x64_sys_mount+0x294/0x320 fs/namespace.c:4032
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff8880254f0c00
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
freed 512-byte region [ffff8880254f0c00, ffff8880254f0e00)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x254f0
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 0000000080100010 00000001f5000000 0000000000000000
head: 00fff00000000040 ffff88801b042c80 dead000000000100 dead000000000122
head: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
head: 00fff00000000002 ffffea0000953c01 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 82, tgid 82 (kworker/u32:4), ts 40087288758, free_ts 40049606636
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1537
prep_new_page mm/page_alloc.c:1545 [inline]
get_page_from_freelist+0x101e/0x3070 mm/page_alloc.c:3457
__alloc_pages_noprof+0x223/0x25c0 mm/page_alloc.c:4733
alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265
alloc_slab_page mm/slub.c:2413 [inline]
allocate_slab mm/slub.c:2579 [inline]
new_slab+0x2ba/0x3f0 mm/slub.c:2632
___slab_alloc+0xdac/0x1880 mm/slub.c:3819
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3909
__slab_alloc_node mm/slub.c:3962 [inline]
slab_alloc_node mm/slub.c:4123 [inline]
__kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4291
kmalloc_noprof include/linux/slab.h:878 [inline]
kzalloc_noprof include/linux/slab.h:1014 [inline]
mca_alloc net/ipv6/mcast.c:881 [inline]
__ipv6_dev_mc_inc+0x2b7/0xc10 net/ipv6/mcast.c:937
addrconf_join_solict net/ipv6/addrconf.c:2241 [inline]
addrconf_dad_begin net/ipv6/addrconf.c:4104 [inline]
addrconf_dad_work+0x232/0x14d0 net/ipv6/addrconf.c:4229
process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229
process_scheduled_works kernel/workqueue.c:3310 [inline]
worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391
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
page last free pid 5335 tgid 5335 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1108 [inline]
free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2638
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329
kasan_slab_alloc include/linux/kasan.h:247 [inline]
slab_post_alloc_hook mm/slub.c:4086 [inline]
slab_alloc_node mm/slub.c:4135 [inline]
__do_kmalloc_node mm/slub.c:4264 [inline]
__kmalloc_noprof+0x199/0x400 mm/slub.c:4277
kmalloc_noprof include/linux/slab.h:882 [inline]
kzalloc_noprof include/linux/slab.h:1014 [inline]
fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155
ip6_route_info_create+0x337/0x1910 net/ipv6/route.c:3761
ip6_route_add+0x26/0x1c0 net/ipv6/route.c:3853
addrconf_add_mroute+0x1de/0x350 net/ipv6/addrconf.c:2550
addrconf_add_dev+0x14e/0x1c0 net/ipv6/addrconf.c:2568
addrconf_dev_config net/ipv6/addrconf.c:3484 [inline]
addrconf_init_auto_addrs+0x380/0x820 net/ipv6/addrconf.c:3572
addrconf_notify+0x6e2/0x19c0 net/ipv6/addrconf.c:3745
notifier_call_chain+0xb9/0x410 kernel/notifier.c:93
call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1996
netdev_state_change net/core/dev.c:1378 [inline]
netdev_state_change+0x115/0x150 net/core/dev.c:1371
netdev_set_operstate+0x104/0x150 net/core/rtnetlink.c:854
Memory state around the buggy address:
ffff8880254f0b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880254f0b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880254f0c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880254f0c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880254f0d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: fa cli
1: 48 c1 ea 03 shr $0x3,%rdx
5: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
9: 0f 85 29 45 00 00 jne 0x4538
f: 48 8b bd 10 ff ff ff mov -0xf0(%rbp),%rdi
16: 4d 89 67 10 mov %r12,0x10(%r15)
1a: 4c 89 e6 mov %r12,%rsi
1d: e8 bb d5 dd f5 call 0xf5ddd5dd
22: 48 89 c7 mov %rax,%rdi
25: e8 63 4b 3a f6 call 0xf63a4b8d
* 2a: 48 8b b5 98 fe ff ff mov -0x168(%rbp),%rsi <-- trapping instruction
31: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
38: fc ff df
3b: 48 01 c6 add %rax,%rsi
3e: 48 rex.W
3f: c7 .byte 0xc7