====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc4-next-20240418-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/14330 is trying to acquire lock: ffff8880205a0870 (&newdev->mutex){+.+.}-{3:3}, at: uinput_request_send drivers/input/misc/uinput.c:151 [inline] ffff8880205a0870 (&newdev->mutex){+.+.}-{3:3}, at: uinput_request_submit+0x19c/0x740 drivers/input/misc/uinput.c:182 but task is already holding lock: ffff8880205a18b0 (&ff->mutex){+.+.}-{3:3}, at: input_ff_upload+0x3e4/0xb00 drivers/input/ff-core.c:120 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 ( &ff->mutex ){+.+.}-{3:3} : lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __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:240 input_flush_device+0x9c/0xc0 drivers/input/input.c:686 evdev_release+0xf9/0x7d0 drivers/input/evdev.c:444 __fput+0x406/0x8b0 fs/file_table.c:422 __do_sys_close fs/open.c:1555 [inline] __se_sys_close fs/open.c:1540 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1540 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 ( &dev->mutex #2 ){+.+.}-{3:3} : lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 input_disconnect_device drivers/input/input.c:761 [inline] __input_unregister_device+0x31/0x630 drivers/input/input.c:2217 input_unregister_device+0xa3/0x100 drivers/input/input.c:2440 uinput_destroy_device+0x6d1/0x8f0 drivers/input/misc/uinput.c:299 uinput_ioctl_handler+0xb0c/0x1770 drivers/input/misc/uinput.c:908 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 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:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __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:150 evdev_do_ioctl drivers/input/evdev.c:1183 [inline] evdev_ioctl_handler+0x17d0/0x21b0 drivers/input/evdev.c:1272 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 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.4/14330: #0: ffff88804cf8f110 (&evdev->mutex ){+.+.}-{3:3} , at: evdev_ioctl_handler+0x125/0x21b0 drivers/input/evdev.c:1263 #1: ffff8880205a18b0 (&ff->mutex ){+.+.}-{3:3} , at: input_ff_upload+0x3e4/0xb00 drivers/input/ff-core.c:120 stack backtrace: CPU: 0 PID: 14330 Comm: syz-executor.4 Tainted: G D 6.9.0-rc4-next-20240418-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114