[v5.15] possible deadlock in input_register_device (4)

0 views
Skip to first unread message

syzbot

unread,
May 14, 2026, 11:22:28 AM (2 days ago) May 14
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: de8dfb3f0278 Linux 5.15.206
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11e557ba580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=84d01e7883b798244618
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/a3b00346a7a2/disk-de8dfb3f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/cd8ff348788e/vmlinux-de8dfb3f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6d03a73b9540/bzImage-de8dfb3f.xz

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

input: Steam Controller as /devices/platform/dummy_hcd.0/usb1/1-1/1-1:0.0/0003:28DE:1102.0005/input/input10
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.601/6819 is trying to acquire lock:
ffffffff8cf465e8 (input_mutex){+.+.}-{3:3}, at: input_register_device+0xb66/0x1140 drivers/input/input.c:2422

but task is already holding lock:
ffff88807b78dee0 (&hdev->ll_open_lock){+.+.}-{3:3}, at: hid_hw_close+0x2c/0xd0 drivers/hid/hid-core.c:2158

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&hdev->ll_open_lock){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_killable_nested+0x17/0x20 kernel/locking/mutex.c:758
hid_hw_open+0x23/0x160 drivers/hid/hid-core.c:2132
input_open_device+0x16c/0x2e0 drivers/input/input.c:640
kbd_connect+0xe9/0x130 drivers/tty/vt/keyboard.c:1581
input_attach_handler drivers/input/input.c:1046 [inline]
input_register_device+0xda7/0x1140 drivers/input/input.c:2429
hidinput_connect+0x2440/0x2d90 drivers/hid/hid-input.c:2046
hid_connect+0x46a/0xe10 drivers/hid/hid-core.c:1988
hid_hw_start+0x99/0x100 drivers/hid/hid-core.c:2095
hid_device_probe+0x2ea/0x360 drivers/hid/hid-core.c:2327
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x284/0xc80 drivers/base/dd.c:595
__driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
__device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429
__device_attach+0x2a8/0x480 drivers/base/dd.c:979
bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
device_add+0xa00/0xfb0 drivers/base/core.c:3412
hid_add_device+0x389/0x530 drivers/hid/hid-core.c:2475
usbhid_probe+0xb92/0xf40 drivers/hid/usbhid/hid-core.c:1442
usb_probe_interface+0x5c5/0xb20 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x284/0xc80 drivers/base/dd.c:595
__driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
__device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429
__device_attach+0x2a8/0x480 drivers/base/dd.c:979
bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
device_add+0xa00/0xfb0 drivers/base/core.c:3412
usb_set_configuration+0x1991/0x1fd0 drivers/usb/core/message.c:2223
usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238
usb_probe_device+0x139/0x270 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x284/0xc80 drivers/base/dd.c:595
__driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
__device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429
__device_attach+0x2a8/0x480 drivers/base/dd.c:979
bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
device_add+0xa00/0xfb0 drivers/base/core.c:3412
usb_new_device+0xd65/0x1660 drivers/usb/core/hub.c:2632
hub_port_connect drivers/usb/core/hub.c:5497 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5637 [inline]
port_event drivers/usb/core/hub.c:5799 [inline]
hub_event+0x2e4a/0x55e0 drivers/usb/core/hub.c:5881
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #1 (&dev->mutex#2){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_interruptible_nested+0x17/0x20 kernel/locking/mutex.c:765
input_register_handle+0x67/0x3a0 drivers/input/input.c:2588
kbd_connect+0xbf/0x130 drivers/tty/vt/keyboard.c:1577
input_attach_handler drivers/input/input.c:1046 [inline]
input_register_device+0xda7/0x1140 drivers/input/input.c:2429
acpi_button_add+0x6ba/0xae0 drivers/acpi/button.c:579
acpi_device_probe+0xa3/0x300 drivers/acpi/bus.c:1013
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x284/0xc80 drivers/base/dd.c:595
__driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
__driver_attach+0x46b/0x670 drivers/base/dd.c:1164
bus_for_each_dev+0x182/0x1f0 drivers/base/bus.c:303
bus_add_driver+0x30a/0x5a0 drivers/base/bus.c:620
driver_register+0x32d/0x430 drivers/base/driver.c:240
do_one_initcall+0x272/0x730 init/main.c:1316
do_initcall_level+0x137/0x1f0 init/main.c:1389
do_initcalls+0x4b/0x90 init/main.c:1405
kernel_init_freeable+0x3e9/0x570 init/main.c:1629
kernel_init+0x19/0x1b0 init/main.c:1520
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #0 (input_mutex){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_interruptible_nested+0x17/0x20 kernel/locking/mutex.c:765
input_register_device+0xb66/0x1140 drivers/input/input.c:2422
steam_input_register+0x9b1/0xc80 drivers/hid/hid-steam.c:469
hid_hw_close+0xa5/0xd0 drivers/hid/hid-core.c:2160
drop_ref drivers/hid/hidraw.c:338 [inline]
hidraw_release+0x39d/0x5d0 drivers/hid/hidraw.c:360
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
input_mutex --> &dev->mutex#2 --> &hdev->ll_open_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&hdev->ll_open_lock);
lock(&dev->mutex#2);
lock(&hdev->ll_open_lock);
lock(input_mutex);

*** DEADLOCK ***

2 locks held by syz.0.601/6819:
#0: ffffffff8d2b6f48 (minors_lock){+.+.}-{3:3}, at: hidraw_release+0x71/0x5d0 drivers/hid/hidraw.c:351
#1: ffff88807b78dee0 (&hdev->ll_open_lock){+.+.}-{3:3}, at: hid_hw_close+0x2c/0xd0 drivers/hid/hid-core.c:2158

stack backtrace:
CPU: 0 PID: 6819 Comm: syz.0.601 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_interruptible_nested+0x17/0x20 kernel/locking/mutex.c:765
input_register_device+0xb66/0x1140 drivers/input/input.c:2422
steam_input_register+0x9b1/0xc80 drivers/hid/hid-steam.c:469
hid_hw_close+0xa5/0xd0 drivers/hid/hid-core.c:2160
drop_ref drivers/hid/hidraw.c:338 [inline]
hidraw_release+0x39d/0x5d0 drivers/hid/hidraw.c:360
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fad473f8e59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff810a65c8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007fad47673da0 RCX: 00007fad473f8e59
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007fad47673da0 R08: 0000000000000006 R09: 0000000000000000
R10: 00000000005edc0c R11: 0000000000000246 R12: 0000000000047aab
R13: 00007fad47671fac R14: 0000000000046ef1 R15: 00007fff810a66d0
</TASK>


---
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