syzbot


possible deadlock in __input_unregister_device

Status: upstream: reported on 2024/08/11 15:16
Subsystems: input
[Documentation on labels]
Reported-by: syzbot+3f4bf5c599ee9b16d704@syzkaller.appspotmail.com
First crash: 128d, last: 19h44m
Discussions (5)
Title Replies (including bot) Last reply
[syzbot] Monthly input report (Dec 2024) 0 (1) 2024/12/05 09:04
[syzbot] Monthly input report (Nov 2024) 0 (1) 2024/11/04 08:58
[syzbot] Monthly input report (Oct 2024) 0 (1) 2024/10/03 09:03
[syzbot] Monthly input report (Sep 2024) 0 (1) 2024/09/02 08:17
[syzbot] [input?] possible deadlock in __input_unregister_device 0 (1) 2024/08/11 15:16

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.13.0-rc2-syzkaller-00018-g7cb1b4663150 #0 Not tainted
------------------------------------------------------
syz.1.119/6271 is trying to acquire lock:
ffff88805a65f2c0 (&dev->mutex#2){+.+.}-{4:4}, at: input_disconnect_device drivers/input/input.c:729 [inline]
ffff88805a65f2c0 (&dev->mutex#2){+.+.}-{4:4}, at: __input_unregister_device+0x31/0x620 drivers/input/input.c:2275

but task is already holding lock:
ffff88806b8b5e20 (&hdev->ll_open_lock){+.+.}-{4:4}, at: hid_hw_open+0x28/0x170 drivers/hid/hid-core.c:2392

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&hdev->ll_open_lock){+.+.}-{4:4}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
       __mutex_lock_common kernel/locking/mutex.c:585 [inline]
       __mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735
       hid_hw_open+0x28/0x170 drivers/hid/hid-core.c:2392
       input_open_device+0x1d2/0x340 drivers/input/input.c:620
       mousedev_open_device+0xc7/0x160 drivers/input/mousedev.c:430
       mousedev_open+0x2cf/0x470 drivers/input/mousedev.c:556
       chrdev_open+0x521/0x600 fs/char_dev.c:414
       do_dentry_open+0xbe1/0x1b70 fs/open.c:945
       vfs_open+0x3e/0x330 fs/open.c:1075
       do_open fs/namei.c:3828 [inline]
       path_openat+0x2c84/0x3590 fs/namei.c:3987
       do_filp_open+0x27f/0x4e0 fs/namei.c:4014
       do_sys_openat2+0x13e/0x1d0 fs/open.c:1402
       do_sys_open fs/open.c:1417 [inline]
       __do_sys_openat fs/open.c:1433 [inline]
       __se_sys_openat fs/open.c:1428 [inline]
       __x64_sys_openat+0x247/0x2a0 fs/open.c:1428
       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 (&dev->mutex#2){+.+.}-{4:4}:
       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+0x1397/0x2100 kernel/locking/lockdep.c:5226
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
       __mutex_lock_common kernel/locking/mutex.c:585 [inline]
       __mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735
       input_disconnect_device drivers/input/input.c:729 [inline]
       __input_unregister_device+0x31/0x620 drivers/input/input.c:2275
       input_unregister_device+0xa3/0x100 drivers/input/input.c:2516
       steam_client_ll_open+0x80/0xa0 drivers/hid/hid-steam.c:1120
       hid_hw_open+0xe3/0x170 drivers/hid/hid-core.c:2397
       hidraw_open+0x298/0x8e0 drivers/hid/hidraw.c:308
       chrdev_open+0x521/0x600 fs/char_dev.c:414
       do_dentry_open+0xbe1/0x1b70 fs/open.c:945
       vfs_open+0x3e/0x330 fs/open.c:1075
       do_open fs/namei.c:3828 [inline]
       path_openat+0x2c84/0x3590 fs/namei.c:3987
       do_filp_open+0x27f/0x4e0 fs/namei.c:4014
       do_sys_openat2+0x13e/0x1d0 fs/open.c:1402
       do_sys_open fs/open.c:1417 [inline]
       __do_sys_openat fs/open.c:1433 [inline]
       __se_sys_openat fs/open.c:1428 [inline]
       __x64_sys_openat+0x247/0x2a0 fs/open.c:1428
       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:

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

2 locks held by syz.1.119/6271:
 #0: ffffffff8faf8850 (minors_rwsem){+.+.}-{4:4}, at: hidraw_open+0x93/0x8e0 drivers/hid/hidraw.c:294
 #1: ffff88806b8b5e20 (&hdev->ll_open_lock){+.+.}-{4:4}, at: hid_hw_open+0x28/0x170 drivers/hid/hid-core.c:2392

stack backtrace:
CPU: 1 UID: 0 PID: 6271 Comm: syz.1.119 Not tainted 6.13.0-rc2-syzkaller-00018-g7cb1b4663150 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __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+0x1397/0x2100 kernel/locking/lockdep.c:5226
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
 __mutex_lock_common kernel/locking/mutex.c:585 [inline]
 __mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735
 input_disconnect_device drivers/input/input.c:729 [inline]
 __input_unregister_device+0x31/0x620 drivers/input/input.c:2275
 input_unregister_device+0xa3/0x100 drivers/input/input.c:2516
 steam_client_ll_open+0x80/0xa0 drivers/hid/hid-steam.c:1120
 hid_hw_open+0xe3/0x170 drivers/hid/hid-core.c:2397
 hidraw_open+0x298/0x8e0 drivers/hid/hidraw.c:308
 chrdev_open+0x521/0x600 fs/char_dev.c:414
 do_dentry_open+0xbe1/0x1b70 fs/open.c:945
 vfs_open+0x3e/0x330 fs/open.c:1075
 do_open fs/namei.c:3828 [inline]
 path_openat+0x2c84/0x3590 fs/namei.c:3987
 do_filp_open+0x27f/0x4e0 fs/namei.c:4014
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1402
 do_sys_open fs/open.c:1417 [inline]
 __do_sys_openat fs/open.c:1433 [inline]
 __se_sys_openat fs/open.c:1428 [inline]
 __x64_sys_openat+0x247/0x2a0 fs/open.c:1428
 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:0x7ff507d7e880
Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 49 94 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 9c 94 02 00 8b 44
RSP: 002b:00007ff508c25b90 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff507d7e880
RDX: 0000000000000000 RSI: 00007ff508c25c30 RDI: 00000000ffffff9c
RBP: 00007ff508c25c30 R08: 0000000000000000 R09: 0023776172646968
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff507f45fa0 R15: 00007ff50806fa38
 </TASK>
syz_tun (unregistering): left promiscuous mode

Crashes (202):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/10 09:31 upstream 7cb1b4663150 cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce possible deadlock in __input_unregister_device
2024/11/22 05:25 upstream fcc79e1714e8 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in __input_unregister_device
2024/11/21 00:57 upstream bf9aa14fc523 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce possible deadlock in __input_unregister_device
2024/11/19 02:27 upstream c6d64479d609 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in __input_unregister_device
2024/11/08 07:19 upstream 906bd684e4b1 179b040e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in __input_unregister_device
2024/12/13 15:55 upstream f932fb9b4074 b1b5e51a .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in __input_unregister_device
2024/12/12 03:41 upstream 231825b2e1ff 6f1b0fa8 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in __input_unregister_device
2024/12/10 02:27 upstream 7cb1b4663150 deb72877 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in __input_unregister_device
2024/12/08 04:13 upstream 7503345ac5f5 9ac0fdc6 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in __input_unregister_device
2024/12/03 23:05 upstream ceb8bf2ceaa7 b50eb251 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in __input_unregister_device
2024/11/25 15:23 upstream 9f16d5e6f220 36dfdd05 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in __input_unregister_device
2024/12/04 16:30 upstream feffde684ac2 b50eb251 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __input_unregister_device
2024/12/12 20:32 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 530e80f8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/11 21:52 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 ff949d25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/11 13:09 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 ff949d25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/11 09:18 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/10 10:59 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/09 01:33 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/08 11:24 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/08 01:33 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/07 18:35 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/06 16:50 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 946d28f0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/06 15:17 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8d936c51388 946d28f0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/05 00:27 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 3b56774fa25d b50eb251 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/04 04:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing cdd30ebb1b9f b50eb251 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/02 21:30 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing e70140ba0d2b b499ea68 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/02 11:00 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing e70140ba0d2b 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/01 19:17 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing bcc8eda6d349 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/01 15:47 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing bcc8eda6d349 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/12/01 04:32 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/30 23:54 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/30 12:58 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/29 10:22 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/29 05:52 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/28 18:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/28 11:54 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/27 20:56 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/27 06:33 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 52b38cc1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/26 05:02 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 11dbc254 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/25 10:54 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/25 01:27 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/24 18:45 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/24 07:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/23 17:16 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/23 02:09 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/22 13:35 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/21 12:56 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/21 10:37 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/11/21 09:16 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 237d4e0f4113 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/08/10 08:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 25f51b76f90f 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
2024/08/07 15:06 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 25f51b76f90f 109d2082 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb possible deadlock in __input_unregister_device
* Struck through repros no longer work on HEAD.