====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc4-syzkaller-g6a71d2909427 #0 Not tainted ------------------------------------------------------ syz-executor561/6290 is trying to acquire lock: ffff0000da061870 (&newdev->mutex ){+.+.}-{3:3} , at: uinput_request_send drivers/input/misc/uinput.c:151 [inline] , at: uinput_request_submit+0x188/0x654 drivers/input/misc/uinput.c:182 but task is already holding lock: ffff0000da0610b0 ( &ff->mutex ){+.+.}-{3:3} , at: input_ff_upload+0x31c/0x834 drivers/input/ff-core.c:120 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 ( &ff->mutex ){+.+.}-{3:3} : __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 input_ff_flush+0x64/0x150 drivers/input/ff-core.c:240 uinput_dev_flush+0x30/0x4c drivers/input/misc/uinput.c:283 input_flush_device+0xa4/0xd4 drivers/input/input.c:686 evdev_release+0xec/0x2ec drivers/input/evdev.c:444 __fput+0x30c/0x738 fs/file_table.c:422 __fput_sync+0x60/0x9c fs/file_table.c:507 __do_sys_close fs/open.c:1556 [inline] __se_sys_close fs/open.c:1541 [inline] __arm64_sys_close+0x150/0x1e0 fs/open.c:1541 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 -> #2 ( &dev->mutex #2 ){+.+.}-{3:3} : __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_interruptible_nested+0x2c/0x38 kernel/locking/mutex.c:826 input_register_handle+0x74/0x2d0 drivers/input/input.c:2555 kbd_connect+0xc4/0x13c drivers/tty/vt/keyboard.c:1589 input_attach_handler drivers/input/input.c:1064 [inline] input_register_device+0xac0/0xde8 drivers/input/input.c:2396 acpi_button_add+0x5bc/0x9e4 drivers/acpi/button.c:604 acpi_device_probe+0xa8/0x284 drivers/acpi/bus.c:1057 really_probe+0x394/0x904 drivers/base/dd.c:656 __driver_probe_device+0x194/0x374 drivers/base/dd.c:798 driver_probe_device+0x78/0x330 drivers/base/dd.c:828 __driver_attach+0x3dc/0x648 drivers/base/dd.c:1214 bus_for_each_dev+0x20c/0x298 drivers/base/bus.c:368 driver_attach+0x4c/0x5c drivers/base/dd.c:1231 bus_add_driver+0x2f0/0x58c drivers/base/bus.c:673 driver_register+0x220/0x30c drivers/base/driver.c:246 acpi_bus_register_driver+0xf8/0x11c drivers/acpi/bus.c:1008 acpi_button_register_driver drivers/acpi/button.c:734 [inline] acpi_button_driver_init+0xd4/0x10c drivers/acpi/button.c:743 do_one_initcall+0x254/0x9e4 init/main.c:1243 do_initcall_level+0x154/0x214 init/main.c:1305 do_initcalls+0x58/0xac init/main.c:1321 do_basic_setup+0x8c/0xa0 init/main.c:1340 kernel_init_freeable+0x324/0x478 init/main.c:1553 kernel_init+0x24/0x29c init/main.c:1442 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 -> #1 ( input_mutex ){+.+.}-{3:3} : __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_interruptible_nested+0x2c/0x38 kernel/locking/mutex.c:826 input_register_device+0x8dc/0xde8 drivers/input/input.c:2389 uinput_create_device+0x360/0x528 drivers/input/misc/uinput.c:365 uinput_ioctl_handler+0x8b0/0x16c0 drivers/input/misc/uinput.c:904 uinput_ioctl+0x38/0x4c drivers/input/misc/uinput.c:1075 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl fs/ioctl.c:890 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:890 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 -> #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 kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x3384/0x763c kernel/locking/lockdep.c:5137 lock_acquire+0x248/0x73c kernel/locking/lockdep.c:5754 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_interruptible_nested+0x2c/0x38 kernel/locking/mutex.c:826 uinput_request_send drivers/input/misc/uinput.c:151 [inline] uinput_request_submit+0x188/0x654 drivers/input/misc/uinput.c:182 uinput_dev_upload_effect+0x170/0x218 drivers/input/misc/uinput.c:257 input_ff_upload+0x49c/0x834 drivers/input/ff-core.c:150 evdev_do_ioctl drivers/input/evdev.c:1183 [inline] evdev_ioctl_handler+0x1fd0/0x2d58 drivers/input/evdev.c:1272 evdev_ioctl+0x38/0x4c drivers/input/evdev.c:1281 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl fs/ioctl.c:890 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:890 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 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-executor561/6290: #0: ffff0000c6a54110 (&evdev->mutex){+.+.}-{3:3}, at: evdev_ioctl_handler+0x11c/0x2d58 drivers/input/evdev.c:1263 #1: ffff0000da0610b0 (&ff->mutex){+.+.}-{3:3}, at: input_ff_upload+0x31c/0x834 drivers/input/ff-core.c:120 stack backtrace: CPU: 0 PID: 6290 Comm: syz-executor561 Tainted: G D 6.9.0-rc4-syzkaller-g6a71d2909427 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 dump_stack+0x1c/0x28 lib/dump_stack.c:123 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2060 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x3384/0x763c kernel/locking/lockdep.c:5137 lock_acquire+0x248/0x73c kernel/locking/lockdep.c:5754 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_interruptible_nested+0x2c/0x38 kernel/locking/mutex.c:826 uinput_request_send drivers/input/misc/uinput.c:151 [inline] uinput_request_submit+0x188/0x654 drivers/input/misc/uinput.c:182 uinput_dev_upload_effect+0x170/0x218 drivers/input/misc/uinput.c:257 input_ff_upload+0x49c/0x834 drivers/input/ff-core.c:150 evdev_do_ioctl drivers/input/evdev.c:1183 [inline] evdev_ioctl_handler+0x1fd0/0x2d58 drivers/input/evdev.c:1272 evdev_ioctl+0x38/0x4c drivers/input/evdev.c:1281 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl fs/ioctl.c:890 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:890 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598