[v6.6] KASAN: slab-use-after-free Read in event_handler

0 views
Skip to first unread message

syzbot

unread,
3:00 AM (13 hours ago) 3:00 AM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d27334b2888c Linux 6.6.151
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16cc5132580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0bc3d90c30838b5
dashboard link: https://syzkaller.appspot.com/bug?extid=317505b998716055821c
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/695139abd971/disk-d27334b2.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b11fc121442a/vmlinux-d27334b2.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e226f54f9286/bzImage-d27334b2.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+317505...@syzkaller.appspotmail.com

vhci_hcd: stop threads
vhci_hcd: release socket
vhci_hcd: disconnect device
==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x10c/0x7d80 kernel/locking/lockdep.c:5005
Read of size 8 at addr ffff888025da0440 by task kworker/u4:14/6382

CPU: 1 PID: 6382 Comm: kworker/u4:14 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Workqueue: usbip_event event_handler
Call Trace:
<TASK>
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:468
kasan_report+0x117/0x150 mm/kasan/report.c:581
__lock_acquire+0x10c/0x7d80 kernel/locking/lockdep.c:5005
lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb4/0x100 kernel/locking/spinlock.c:162
unset_event drivers/usb/usbip/usbip_event.c:35 [inline]
event_handler+0x2a9/0x460 drivers/usb/usbip/usbip_event.c:80
process_one_work kernel/workqueue.c:2657 [inline]
process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2734
worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
</TASK>

Allocated by task 1:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384
kasan_kmalloc include/linux/kasan.h:198 [inline]
__do_kmalloc_node mm/slab_common.c:1007 [inline]
__kmalloc+0xb7/0x240 mm/slab_common.c:1020
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:721 [inline]
__usb_create_hcd+0x67/0x8a0 drivers/usb/core/hcd.c:2556
vhci_hcd_probe+0x103/0x370 drivers/usb/usbip/vhci_hcd.c:1376
platform_probe+0x13b/0x1c0 drivers/base/platform.c:1376
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x247/0xae0 drivers/base/dd.c:717
__driver_probe_device+0x1f5/0x390 drivers/base/dd.c:879
driver_probe_device+0x4f/0x420 drivers/base/dd.c:909
__device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1037
bus_for_each_drv+0x252/0x2e0 drivers/base/bus.c:459
__device_attach+0x2c1/0x420 drivers/base/dd.c:1109
bus_probe_device+0x180/0x260 drivers/base/bus.c:580
device_add+0x87c/0xc40 drivers/base/core.c:3700
platform_device_add+0x4c3/0x830 drivers/base/platform.c:716
vhci_hcd_init+0x3cb/0x500 drivers/usb/usbip/vhci_hcd.c:1569
do_one_initcall+0x242/0x790 init/main.c:1210
do_initcall_level+0x13d/0x1f0 init/main.c:1272
do_initcalls+0x69/0xd0 init/main.c:1288
kernel_init_freeable+0x3d9/0x560 init/main.c:1525
kernel_init+0x1d/0x1c0 init/main.c:1415
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

Freed by task 13950:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1811 [inline]
slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837
slab_free mm/slub.c:3830 [inline]
__kmem_cache_free+0xba/0x1f0 mm/slub.c:3843
vhci_hcd_remove+0xe4/0x100 drivers/usb/usbip/vhci_hcd.c:1434
platform_remove+0x6d/0xe0 drivers/base/platform.c:1396
device_remove drivers/base/dd.c:626 [inline]
__device_release_driver drivers/base/dd.c:1351 [inline]
device_release_driver_internal+0x408/0x6f0 drivers/base/dd.c:1374
unbind_store+0x1a1/0x1d0 drivers/base/bus.c:244
kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
call_write_iter include/linux/fs.h:2018 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x474/0x9a0 fs/read_write.c:584
ksys_write+0x151/0x260 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff888025da0000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 1088 bytes inside of
freed 8192-byte region [ffff888025da0000, ffff888025da2000)

The buggy address belongs to the physical page:
page:ffffea0000976800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25da0
head:ffffea0000976800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888017c42280 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 14728234873, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582
prep_new_page mm/page_alloc.c:1589 [inline]
get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221
__alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501
alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2118
alloc_slab_page+0x5d/0x180 mm/slub.c:1881
allocate_slab mm/slub.c:2028 [inline]
new_slab+0x87/0x2d0 mm/slub.c:2081
___slab_alloc+0xc5c/0x12f0 mm/slub.c:3253
__slab_alloc mm/slub.c:3339 [inline]
__slab_alloc_node mm/slub.c:3392 [inline]
slab_alloc_node mm/slub.c:3485 [inline]
__kmem_cache_alloc_node+0x11f/0x250 mm/slub.c:3534
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc+0xa7/0x240 mm/slab_common.c:1020
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:721 [inline]
__usb_create_hcd+0x67/0x8a0 drivers/usb/core/hcd.c:2556
vhci_hcd_probe+0x103/0x370 drivers/usb/usbip/vhci_hcd.c:1376
platform_probe+0x13b/0x1c0 drivers/base/platform.c:1376
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x247/0xae0 drivers/base/dd.c:717
__driver_probe_device+0x1f5/0x390 drivers/base/dd.c:879
driver_probe_device+0x4f/0x420 drivers/base/dd.c:909
__device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1037
page_owner free stack trace missing

Memory state around the buggy address:
ffff888025da0300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888025da0380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888025da0400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888025da0480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888025da0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages