input: syz1 as /devices/virtual/input/input5 ====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc3-syzkaller-g715ca9dd687f #0 Not tainted ------------------------------------------------------ syz-executor.0/5606 is trying to acquire lock: ffff88807c929870 (&newdev->mutex){+.+.}-{3:3}, at: uinput_request_send drivers/input/misc/uinput.c:151 [inline] ffff88807c929870 (&newdev->mutex){+.+.}-{3:3}, at: uinput_request_submit+0x19c/0x740 drivers/input/misc/uinput.c:182 but task is already holding lock: ffff88807c92a0b0 (&ff->mutex){+.+.}-{3:3}, at: input_ff_upload+0x3e4/0xb00 drivers/input/ff-core.c:122 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&ff->mutex){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 input_ff_flush+0x5e/0x140 drivers/input/ff-core.c:242 input_flush_device+0x9c/0xc0 drivers/input/input.c:649 evdev_release+0xf6/0x7d0 drivers/input/evdev.c:435 __fput+0x23f/0x880 fs/file_table.c:431 __do_sys_close fs/open.c:1565 [inline] __se_sys_close fs/open.c:1550 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1550 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&dev->mutex#2){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 input_register_handle+0x6d/0x3b0 drivers/input/input.c:2708 kbd_connect+0xbf/0x130 drivers/tty/vt/keyboard.c:1587 input_attach_handler drivers/input/input.c:1027 [inline] input_register_device+0xd3b/0x1110 drivers/input/input.c:2470 acpi_button_add+0x6c6/0xb90 drivers/acpi/button.c:604 acpi_device_probe+0xa5/0x2b0 drivers/acpi/bus.c:1076 really_probe+0x2b8/0xad0 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800 driver_probe_device+0x50/0x430 drivers/base/dd.c:830 __driver_attach+0x45f/0x710 drivers/base/dd.c:1216 bus_for_each_dev+0x239/0x2b0 drivers/base/bus.c:370 bus_add_driver+0x346/0x670 drivers/base/bus.c:675 driver_register+0x23a/0x320 drivers/base/driver.c:246 do_one_initcall+0x248/0x880 init/main.c:1269 do_initcall_level+0x157/0x210 init/main.c:1331 do_initcalls+0x3f/0x80 init/main.c:1347 kernel_init_freeable+0x435/0x5d0 init/main.c:1580 kernel_init+0x1d/0x2b0 init/main.c:1469 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #1 (input_mutex){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 input_register_device+0xaee/0x1110 drivers/input/input.c:2463 uinput_create_device+0x40e/0x630 drivers/input/misc/uinput.c:365 uinput_ioctl_handler+0x488/0x1770 drivers/input/misc/uinput.c:918 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&newdev->mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 uinput_request_send drivers/input/misc/uinput.c:151 [inline] uinput_request_submit+0x19c/0x740 drivers/input/misc/uinput.c:182 uinput_dev_upload_effect+0x199/0x240 drivers/input/misc/uinput.c:257 input_ff_upload+0x5df/0xb00 drivers/input/ff-core.c:152 evdev_do_ioctl drivers/input/evdev.c:1181 [inline] evdev_ioctl_handler+0x17cd/0x21a0 drivers/input/evdev.c:1270 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &newdev->mutex --> &dev->mutex#2 --> &ff->mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ff->mutex); lock(&dev->mutex#2); lock(&ff->mutex); lock(&newdev->mutex); *** DEADLOCK *** 2 locks held by syz-executor.0/5606: #0: ffff888022683110 (&evdev->mutex){+.+.}-{3:3}, at: evdev_ioctl_handler+0x122/0x21a0 drivers/input/evdev.c:1261 #1: ffff88807c92a0b0 (&ff->mutex){+.+.}-{3:3}, at: input_ff_upload+0x3e4/0xb00 drivers/input/ff-core.c:122 stack backtrace: CPU: 0 UID: 0 PID: 5606 Comm: syz-executor.0 Not tainted 6.12.0-rc3-syzkaller-g715ca9dd687f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 uinput_request_send drivers/input/misc/uinput.c:151 [inline] uinput_request_submit+0x19c/0x740 drivers/input/misc/uinput.c:182 uinput_dev_upload_effect+0x199/0x240 drivers/input/misc/uinput.c:257 input_ff_upload+0x5df/0xb00 drivers/input/ff-core.c:152 evdev_do_ioctl drivers/input/evdev.c:1181 [inline] evdev_ioctl_handler+0x17cd/0x21a0 drivers/input/evdev.c:1270 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa849c7dca9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa8497ff0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fa849dabf80 RCX: 00007fa849c7dca9 RDX: 0000000020000300 RSI: 0000000040304580 RDI: 0000000000000004 RBP: 00007fa849cc947e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fa849dabf80 R15: 00007ffe27907dd8