[v6.1] KASAN: use-after-free Read in usb_anchor_resume_wakeups

2 views
Skip to first unread message

syzbot

unread,
Apr 3, 2025, 8:59:20 AM4/3/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8e60a714ba3b Linux 6.1.132
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1140e178580000
kernel config: https://syzkaller.appspot.com/x/.config?x=14036d226c9c97a0
dashboard link: https://syzkaller.appspot.com/bug?extid=b65b84204d69227e3952
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/015af6f03147/disk-8e60a714.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4dd00fc87c24/vmlinux-8e60a714.xz
kernel image: https://storage.googleapis.com/syzbot-assets/318920d71f18/Image-8e60a714.gz.xz

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

xpad 1-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 1-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: use-after-free in register_lock_class+0x614/0x6a8 kernel/locking/lockdep.c:1331
Read of size 1 at addr ffff0000dd903891 by task kworker/u4:11/4457

CPU: 1 PID: 4457 Comm: kworker/u4:11 Not tainted 6.1.132-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Workqueue: netns cleanup_net
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0x174/0x4c0 mm/kasan/report.c:427
kasan_report+0xd4/0x130 mm/kasan/report.c:531
__asan_report_load1_noabort+0x2c/0x38 mm/kasan/report_generic.c:348
register_lock_class+0x614/0x6a8 kernel/locking/lockdep.c:1331
__lock_acquire+0x184/0x7680 kernel/locking/lockdep.c:4928
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x6c/0xb4 kernel/locking/spinlock.c:162
__wake_up_common_lock kernel/sched/wait.c:137 [inline]
__wake_up+0xec/0x1a8 kernel/sched/wait.c:160
usb_anchor_resume_wakeups+0xc4/0x118 drivers/usb/core/urb.c:960
__usb_hcd_giveback_urb+0x314/0x504 drivers/usb/core/hcd.c:1678
usb_hcd_giveback_urb+0x108/0x3f8 drivers/usb/core/hcd.c:1758
dummy_timer+0x6a4/0x2770 drivers/usb/gadget/udc/dummy_hcd.c:1994
__run_hrtimer kernel/time/hrtimer.c:1691 [inline]
__hrtimer_run_queues+0x4b0/0xdc0 kernel/time/hrtimer.c:1755
hrtimer_run_softirq+0x158/0x21c kernel/time/hrtimer.c:1772
handle_softirqs+0x318/0xd58 kernel/softirq.c:578
__do_softirq+0x14/0x20 kernel/softirq.c:612
____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80
call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:893
do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:85
invoke_softirq kernel/softirq.c:459 [inline]
__irq_exit_rcu+0x264/0x4d4 kernel/softirq.c:661
irq_exit_rcu+0x14/0x84 kernel/softirq.c:673
__el1_irq arch/arm64/kernel/entry-common.c:472 [inline]
el1_interrupt+0x38/0x68 arch/arm64/kernel/entry-common.c:486
el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:491
el1h_64_irq+0x64/0x68 arch/arm64/kernel/entry.S:581
arch_local_irq_restore arch/arm64/include/asm/irqflags.h:122 [inline]
lock_acquire+0x2ac/0x7cc kernel/locking/lockdep.c:5665
__raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
_raw_spin_lock+0x54/0x6c kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:351 [inline]
proc_entry_rundown+0x120/0x208 fs/proc/inode.c:271
remove_proc_entry+0x378/0x4cc fs/proc/generic.c:724
ip_proc_exit_net+0x4c/0xa0 net/ipv4/proc.c:546
ops_exit_list net/core/net_namespace.c:172 [inline]
cleanup_net+0x640/0xaec net/core/net_namespace.c:640
process_one_work+0x804/0x1484 kernel/workqueue.c:2292
worker_thread+0x8e4/0xfec kernel/workqueue.c:2439
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864

Allocated by task 24:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
kmalloc_trace+0x7c/0x94 mm/slab_common.c:1031
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
xpad_probe+0x34c/0x17a4 drivers/input/joystick/xpad.c:1967
usb_probe_interface+0x500/0x984 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x394/0xacc drivers/base/dd.c:639
__driver_probe_device+0x194/0x3b4 drivers/base/dd.c:785
driver_probe_device+0x78/0x330 drivers/base/dd.c:815
__device_attach_driver+0x2a8/0x4f4 drivers/base/dd.c:943
bus_for_each_drv+0x158/0x1e0 drivers/base/bus.c:429
__device_attach+0x2f0/0x480 drivers/base/dd.c:1015
device_initial_probe+0x24/0x34 drivers/base/dd.c:1064
bus_probe_device+0xbc/0x1c8 drivers/base/bus.c:489
device_add+0xae0/0xef4 drivers/base/core.c:3697
usb_set_configuration+0x15c0/0x1b40 drivers/usb/core/message.c:2165
usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:238
usb_probe_device+0x120/0x25c drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x394/0xacc drivers/base/dd.c:639
__driver_probe_device+0x194/0x3b4 drivers/base/dd.c:785
driver_probe_device+0x78/0x330 drivers/base/dd.c:815
__device_attach_driver+0x2a8/0x4f4 drivers/base/dd.c:943
bus_for_each_drv+0x158/0x1e0 drivers/base/bus.c:429
__device_attach+0x2f0/0x480 drivers/base/dd.c:1015
device_initial_probe+0x24/0x34 drivers/base/dd.c:1064
bus_probe_device+0xbc/0x1c8 drivers/base/bus.c:489
device_add+0xae0/0xef4 drivers/base/core.c:3697
usb_new_device+0x908/0x144c drivers/usb/core/hub.c:2631
hub_port_connect drivers/usb/core/hub.c:5489 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5629 [inline]
port_event drivers/usb/core/hub.c:5785 [inline]
hub_event+0x243c/0x42e4 drivers/usb/core/hub.c:5867
process_one_work+0x804/0x1484 kernel/workqueue.c:2292
worker_thread+0x8e4/0xfec kernel/workqueue.c:2439
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864

Freed by task 4379:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516
____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x2c0/0x4b4 mm/slub.c:3674
kfree+0xcc/0x1b8 mm/slab_common.c:988
xpad_disconnect+0x2d4/0x3d8 drivers/input/joystick/xpad.c:2148
usb_unbind_interface+0x1a4/0x758 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:550 [inline]
__device_release_driver drivers/base/dd.c:1260 [inline]
device_release_driver_internal+0x474/0x724 drivers/base/dd.c:1286
device_release_driver+0x28/0x38 drivers/base/dd.c:1309
bus_remove_device+0x298/0x38c drivers/base/bus.c:531
device_del+0x57c/0x9bc drivers/base/core.c:3885
usb_disable_device+0x354/0x760 drivers/usb/core/message.c:1414
usb_disconnect+0x290/0x7b0 drivers/usb/core/hub.c:2286
hub_port_connect drivers/usb/core/hub.c:5333 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5629 [inline]
port_event drivers/usb/core/hub.c:5785 [inline]
hub_event+0x1804/0x42e4 drivers/usb/core/hub.c:5867
process_one_work+0x804/0x1484 kernel/workqueue.c:2292
worker_thread+0x8e4/0xfec kernel/workqueue.c:2439
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864

The buggy address belongs to the object at ffff0000dd903800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
1024-byte region [ffff0000dd903800, ffff0000dd903c00)

The buggy address belongs to the physical page:
page:0000000032f67b79 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000dd905000 pfn:0x11d900
head:0000000032f67b79 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc00036be008 fffffc00033d9608 ffff0000c0002780
raw: ffff0000dd905000 0000000000100009 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000dd903780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff0000dd903800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff0000dd903880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000dd903900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000dd903980: 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

syzbot

unread,
Jul 12, 2025, 8:59:19 AM7/12/25
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages