bisecting cause commit starting from 36bbbd0e234d817938bdc52121a0f5473b3e58f5 building syzkaller on a0234d980eccaa87f5821ac8e95ed9c94a104acf testing commit 36bbbd0e234d817938bdc52121a0f5473b3e58f5 with gcc (GCC) 8.1.0 kernel signature: 43517a3bd3bd9b20a8d051297c85caf2fdbb46ca306724947576fe830fbe8ced all runs: crashed: possible deadlock in input_event testing release v5.10 testing commit 2c85ebc57b3e1817b6ce1a6b703928e113a90442 with gcc (GCC) 8.1.0 kernel signature: 395a614079c9030036488f72c030c4708fae86b9aba956ca15d15003efd3a593 all runs: crashed: possible deadlock in input_event testing release v5.9 testing commit bbf5c979011a099af5dc76498918ed7df445635b with gcc (GCC) 8.1.0 kernel signature: 267e4e72ea6151d6ca484a7d3cc70be89ff7365b860f2a296ca76a677664b0bf all runs: OK # git bisect start 2c85ebc57b3e1817b6ce1a6b703928e113a90442 bbf5c979011a099af5dc76498918ed7df445635b Bisecting: 9594 revisions left to test after this (roughly 13 steps) [4d0e9df5e43dba52d38b251e3b909df8fa1110be] lib, uaccess: add failure injection to usercopy functions testing commit 4d0e9df5e43dba52d38b251e3b909df8fa1110be with gcc (GCC) 8.1.0 kernel signature: adf5c405dd67b7187b8c7a52cca0fc6cc5133c6871aaec8f932c63715200b76f all runs: crashed: possible deadlock in input_event # git bisect bad 4d0e9df5e43dba52d38b251e3b909df8fa1110be Bisecting: 3935 revisions left to test after this (roughly 12 steps) [f888bdf9823c85fe945c4eb3ba353f749dec3856] Merge tag 'devicetree-for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux testing commit f888bdf9823c85fe945c4eb3ba353f749dec3856 with gcc (GCC) 8.1.0 kernel signature: dbea0b188e0196df194a1ca51eddaa9916732a69851abb9911722d46c9148a74 all runs: crashed: possible deadlock in input_event # git bisect bad f888bdf9823c85fe945c4eb3ba353f749dec3856 Bisecting: 1997 revisions left to test after this (roughly 11 steps) [57218d7f2e87069f73c7a841b6ed6c1cc7acf616] Merge tag 'regmap-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap testing commit 57218d7f2e87069f73c7a841b6ed6c1cc7acf616 with gcc (GCC) 8.1.0 kernel signature: f8b59d24f7ecc5eb8f31b5fd08ef45eabe3dd0742e8860a39e4c937b486046ff all runs: crashed: possible deadlock in input_event # git bisect bad 57218d7f2e87069f73c7a841b6ed6c1cc7acf616 Bisecting: 873 revisions left to test after this (roughly 10 steps) [39a5101f989e8d2be557136704d53990f9b402c8] Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 testing commit 39a5101f989e8d2be557136704d53990f9b402c8 with gcc (GCC) 8.1.0 kernel signature: 245a51c8e6539f5140dd0dc141ca0ddc83535fc3ffaadc104994fdd016acbcf3 all runs: crashed: possible deadlock in input_event # git bisect bad 39a5101f989e8d2be557136704d53990f9b402c8 Bisecting: 521 revisions left to test after this (roughly 9 steps) [ed016af52ee3035b4799ebd7d53f9ae59d5782c4] Merge tag 'locking-core-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip testing commit ed016af52ee3035b4799ebd7d53f9ae59d5782c4 with gcc (GCC) 8.1.0 kernel signature: 7cb4b879cad4dc6a0e7bb23f70d7e11f3e82732feb1c9f4a79329e6b09eba6f2 all runs: crashed: possible deadlock in input_event # git bisect bad ed016af52ee3035b4799ebd7d53f9ae59d5782c4 Bisecting: 274 revisions left to test after this (roughly 8 steps) [f94ab231136c53ee26b1ddda76b29218018834ff] Merge tag 'x86_cleanups_for_v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip testing commit f94ab231136c53ee26b1ddda76b29218018834ff with gcc (GCC) 8.1.0 kernel signature: 375ac5c6f79993d0916ad1f6f2b54e3837ba1b519ca39359fd40a5edc414bceb all runs: OK # git bisect good f94ab231136c53ee26b1ddda76b29218018834ff Bisecting: 125 revisions left to test after this (roughly 7 steps) [cc7343724eb77ce0752b1097a275f22f6fe47057] Merge tag 'x86-irq-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip testing commit cc7343724eb77ce0752b1097a275f22f6fe47057 with gcc (GCC) 8.1.0 kernel signature: f9ea5356418feb04bf0ec8c5aa52201768553c0f7c34f432a156d8f85d035ec7 all runs: OK # git bisect good cc7343724eb77ce0752b1097a275f22f6fe47057 Bisecting: 61 revisions left to test after this (roughly 6 steps) [d6c4c11348816fb4d16e33bf47d559d7aa59350a] Merge branch 'kcsan' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into locking/core testing commit d6c4c11348816fb4d16e33bf47d559d7aa59350a with gcc (GCC) 8.1.0 kernel signature: 000cfd8647086879aafa66b2b3141af589d747d1a76ee9d07ef7c8b6618ce16d all runs: crashed: possible deadlock in input_event # git bisect bad d6c4c11348816fb4d16e33bf47d559d7aa59350a Bisecting: 31 revisions left to test after this (roughly 5 steps) [6dd699b13d53f26a7603702d8bada3482312df74] seqlock: seqcount_LOCKNAME_t: Standardize naming convention testing commit 6dd699b13d53f26a7603702d8bada3482312df74 with gcc (GCC) 8.1.0 kernel signature: c700483aa18b56539777ae40b37738bc402a3932661545fa7fb91d0418baa01a all runs: crashed: possible deadlock in input_event # git bisect bad 6dd699b13d53f26a7603702d8bada3482312df74 Bisecting: 15 revisions left to test after this (roughly 4 steps) [621c9dac0eea7607cb9a57cc9ba47fbcd4e644c9] lockdep: Add recursive read locks into dependency graph testing commit 621c9dac0eea7607cb9a57cc9ba47fbcd4e644c9 with gcc (GCC) 8.1.0 kernel signature: 54db2f1cbc454edb8abc2214aa9409abdfd40d8e64979862f974dbd296e8f291 all runs: crashed: possible deadlock in input_event # git bisect bad 621c9dac0eea7607cb9a57cc9ba47fbcd4e644c9 Bisecting: 7 revisions left to test after this (roughly 3 steps) [d563bc6ead9e79be37067d58509a605b67378184] lockdep: Make __bfs() visit every dependency until a match testing commit d563bc6ead9e79be37067d58509a605b67378184 with gcc (GCC) 8.1.0 kernel signature: 8d1e1c5fad6f3dd47b65222520a875a238d4505c0817eeea406530b3665e747d all runs: OK # git bisect good d563bc6ead9e79be37067d58509a605b67378184 Bisecting: 3 revisions left to test after this (roughly 2 steps) [61775ed243433ff0556c4f76905929fe01e92922] lockdep: Make __bfs(.match) return bool testing commit 61775ed243433ff0556c4f76905929fe01e92922 with gcc (GCC) 8.1.0 kernel signature: b204c5090ec72d2ce4ed90acbd32a9a08887511c5ceb14245da743838b04645e all runs: OK # git bisect good 61775ed243433ff0556c4f76905929fe01e92922 Bisecting: 1 revision left to test after this (roughly 1 step) [68e305678583f13a67e2ce22088c2520bd4f97b4] lockdep: Adjust check_redundant() for recursive read change testing commit 68e305678583f13a67e2ce22088c2520bd4f97b4 with gcc (GCC) 8.1.0 kernel signature: 1d3ac38a81b8c214b6d5d488495249ecf9787a65fbee41ffd115a94f4b7e1742 all runs: OK # git bisect good 68e305678583f13a67e2ce22088c2520bd4f97b4 Bisecting: 0 revisions left to test after this (roughly 0 steps) [f08e3888574d490b31481eef6d84c61bedba7a47] lockdep: Fix recursive read lock related safe->unsafe detection testing commit f08e3888574d490b31481eef6d84c61bedba7a47 with gcc (GCC) 8.1.0 kernel signature: bc7af865a4ef7168d78ed1c89e2410164c5be8ae470472f210353d740f4b66bf all runs: crashed: possible deadlock in input_event # git bisect bad f08e3888574d490b31481eef6d84c61bedba7a47 f08e3888574d490b31481eef6d84c61bedba7a47 is the first bad commit commit f08e3888574d490b31481eef6d84c61bedba7a47 Author: Boqun Feng Date: Fri Aug 7 15:42:30 2020 +0800 lockdep: Fix recursive read lock related safe->unsafe detection Currently, in safe->unsafe detection, lockdep misses the fact that a LOCK_ENABLED_IRQ_*_READ usage and a LOCK_USED_IN_IRQ_*_READ usage may cause deadlock too, for example: P1 P2 write_lock(l1); read_lock(l2); write_lock(l2); read_lock(l1); Actually, all of the following cases may cause deadlocks: LOCK_USED_IN_IRQ_* -> LOCK_ENABLED_IRQ_* LOCK_USED_IN_IRQ_*_READ -> LOCK_ENABLED_IRQ_* LOCK_USED_IN_IRQ_* -> LOCK_ENABLED_IRQ_*_READ LOCK_USED_IN_IRQ_*_READ -> LOCK_ENABLED_IRQ_*_READ To fix this, we need to 1) change the calculation of exclusive_mask() so that READ bits are not dropped and 2) always call usage() in mark_lock_irq() to check usage deadlocks, even when the new usage of the lock is READ. Besides, adjust usage_match() and usage_acculumate() to recursive read lock changes. Signed-off-by: Boqun Feng Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200807074238.1632519-12-boqun.feng@gmail.com kernel/locking/lockdep.c | 188 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 141 insertions(+), 47 deletions(-) culprit signature: bc7af865a4ef7168d78ed1c89e2410164c5be8ae470472f210353d740f4b66bf parent signature: 1d3ac38a81b8c214b6d5d488495249ecf9787a65fbee41ffd115a94f4b7e1742 revisions tested: 17, total time: 2h47m29.733510349s (build: 1h23m43.830339688s, test: 1h21m52.151244335s) first bad commit: f08e3888574d490b31481eef6d84c61bedba7a47 lockdep: Fix recursive read lock related safe->unsafe detection recipients (to): ["boqun.feng@gmail.com" "linux-kernel@vger.kernel.org" "mingo@redhat.com" "peterz@infradead.org" "peterz@infradead.org" "will@kernel.org"] recipients (cc): [] crash: possible deadlock in input_event ===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 5.9.0-rc2-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.2/10165 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffff88812e2e0138 (&f->f_owner.lock){.+.+}-{2:2}, at: send_sigio+0x23/0x220 fs/fcntl.c:786 and this task is already holding: ffff88811c460018 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1002 [inline] ffff88811c460018 (&new->fa_lock){....}-{2:2}, at: kill_fasync+0xb8/0x240 fs/fcntl.c:1023 which would create a new lock dependency: (&new->fa_lock){....}-{2:2} -> (&f->f_owner.lock){.+.+}-{2:2} but this new dependency connects a HARDIRQ-irq-safe lock: (&dev->event_lock){-...}-{2:2} ... which became HARDIRQ-irq-safe at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x33/0x50 kernel/locking/spinlock.c:159 input_event+0x33/0x70 drivers/input/input.c:440 input_report_key include/linux/input.h:417 [inline] psmouse_report_standard_buttons+0x1b/0x50 drivers/input/mouse/psmouse-base.c:123 psmouse_report_standard_packet drivers/input/mouse/psmouse-base.c:141 [inline] psmouse_process_byte+0x76/0x280 drivers/input/mouse/psmouse-base.c:232 psmouse_handle_byte+0xa/0x120 drivers/input/mouse/psmouse-base.c:274 psmouse_interrupt+0xc7/0x470 drivers/input/mouse/psmouse-base.c:426 serio_interrupt+0x3b/0x80 drivers/input/serio/serio.c:1002 i8042_interrupt+0x1a4/0x340 drivers/input/serio/i8042.c:598 __handle_irq_event_percpu+0x3c/0x340 kernel/irq/handle.c:156 handle_irq_event_percpu+0x2d/0x80 kernel/irq/handle.c:196 handle_irq_event+0x2f/0x4c kernel/irq/handle.c:213 handle_edge_irq+0x98/0x1f0 kernel/irq/chip.c:819 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:706 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline] handle_irq arch/x86/kernel/irq.c:230 [inline] __common_interrupt arch/x86/kernel/irq.c:249 [inline] common_interrupt+0x166/0x240 arch/x86/kernel/irq.c:239 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:572 native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline] arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irqrestore+0x25/0x50 kernel/locking/spinlock.c:191 spin_unlock_irqrestore include/linux/spinlock.h:409 [inline] i8042_command+0x35/0x40 drivers/input/serio/i8042.c:348 i8042_aux_write+0x29/0x30 drivers/input/serio/i8042.c:383 serio_write include/linux/serio.h:125 [inline] ps2_do_sendbyte+0xb3/0x260 drivers/input/serio/libps2.c:40 ps2_sendbyte+0x31/0x80 drivers/input/serio/libps2.c:92 cypress_ps2_sendbyte+0x15/0x70 drivers/input/mouse/cypress_ps2.c:42 cypress_ps2_read_cmd_status drivers/input/mouse/cypress_ps2.c:116 [inline] cypress_send_ext_cmd+0x115/0x6c0 drivers/input/mouse/cypress_ps2.c:189 cypress_detect+0x27/0x80 drivers/input/mouse/cypress_ps2.c:205 psmouse_do_detect+0x2a/0x50 drivers/input/mouse/psmouse-base.c:1009 psmouse_try_protocol+0xd2/0x220 drivers/input/mouse/psmouse-base.c:1023 psmouse_extensions+0x1f6/0x420 drivers/input/mouse/psmouse-base.c:1146 psmouse_switch_protocol+0x125/0x140 drivers/input/mouse/psmouse-base.c:1542 psmouse_connect+0x1c7/0x370 drivers/input/mouse/psmouse-base.c:1632 serio_connect_driver+0x24/0x40 drivers/input/serio/serio.c:47 really_probe+0xe1/0x420 drivers/base/dd.c:553 driver_probe_device+0xe8/0x150 drivers/base/dd.c:738 device_driver_attach+0x4a/0x50 drivers/base/dd.c:1013 __driver_attach+0x80/0x140 drivers/base/dd.c:1090 bus_for_each_dev+0x71/0xb0 drivers/base/bus.c:305 serio_attach_driver drivers/input/serio/serio.c:808 [inline] serio_handle_event+0x1ee/0x260 drivers/input/serio/serio.c:227 process_one_work+0x26a/0x650 kernel/workqueue.c:2269 worker_thread+0x38/0x390 kernel/workqueue.c:2415 kthread+0x148/0x170 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 to a HARDIRQ-irq-unsafe lock: (&f->f_owner.lock){.+.+}-{2:2} ... which became HARDIRQ-irq-unsafe at: ... lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 f_getown+0x16/0x50 fs/fcntl.c:152 sock_ioctl+0x2d2/0x3f0 net/socket.c:1132 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x7c/0xb0 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 other info that might help us debug this: Chain exists of: &dev->event_lock --> &new->fa_lock --> &f->f_owner.lock Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&f->f_owner.lock); local_irq_disable(); lock(&dev->event_lock); lock(&new->fa_lock); lock(&dev->event_lock); *** DEADLOCK *** 8 locks held by syz-executor.2/10165: #0: ffff888238c4e160 (&evdev->mutex){+.+.}-{3:3}, at: evdev_write+0x8a/0x230 drivers/input/evdev.c:513 #1: ffff88813974d230 (&dev->event_lock){-...}-{2:2}, at: input_inject_event+0x44/0x1db drivers/input/input.c:466 #2: ffffffff84f430c0 (rcu_read_lock){....}-{1:2}, at: is_event_supported drivers/input/input.c:53 [inline] #2: ffffffff84f430c0 (rcu_read_lock){....}-{1:2}, at: input_inject_event+0x28/0x1db drivers/input/input.c:465 #3: ffffffff84f430c0 (rcu_read_lock){....}-{1:2}, at: input_pass_values+0x24/0x290 drivers/input/input.c:164 #4: ffffffff84f430c0 (rcu_read_lock){....}-{1:2}, at: evdev_events+0x0/0x1d0 drivers/input/evdev.c:96 #5: ffff88811c487028 (&client->buffer_lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] #5: ffff88811c487028 (&client->buffer_lock){....}-{2:2}, at: evdev_pass_values+0x86/0x340 drivers/input/evdev.c:262 #6: ffffffff84f430c0 (rcu_read_lock){....}-{1:2}, at: kill_fasync+0xa/0x240 fs/fcntl.c:1021 #7: ffff88811c460018 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1002 [inline] #7: ffff88811c460018 (&new->fa_lock){....}-{2:2}, at: kill_fasync+0xb8/0x240 fs/fcntl.c:1023 the dependencies between HARDIRQ-irq-safe lock and the holding lock: -> (&dev->event_lock){-...}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x33/0x50 kernel/locking/spinlock.c:159 input_event+0x33/0x70 drivers/input/input.c:440 input_report_key include/linux/input.h:417 [inline] psmouse_report_standard_buttons+0x1b/0x50 drivers/input/mouse/psmouse-base.c:123 psmouse_report_standard_packet drivers/input/mouse/psmouse-base.c:141 [inline] psmouse_process_byte+0x76/0x280 drivers/input/mouse/psmouse-base.c:232 psmouse_handle_byte+0xa/0x120 drivers/input/mouse/psmouse-base.c:274 psmouse_interrupt+0xc7/0x470 drivers/input/mouse/psmouse-base.c:426 serio_interrupt+0x3b/0x80 drivers/input/serio/serio.c:1002 i8042_interrupt+0x1a4/0x340 drivers/input/serio/i8042.c:598 __handle_irq_event_percpu+0x3c/0x340 kernel/irq/handle.c:156 handle_irq_event_percpu+0x2d/0x80 kernel/irq/handle.c:196 handle_irq_event+0x2f/0x4c kernel/irq/handle.c:213 handle_edge_irq+0x98/0x1f0 kernel/irq/chip.c:819 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:706 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline] handle_irq arch/x86/kernel/irq.c:230 [inline] __common_interrupt arch/x86/kernel/irq.c:249 [inline] common_interrupt+0x166/0x240 arch/x86/kernel/irq.c:239 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:572 native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline] arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irqrestore+0x25/0x50 kernel/locking/spinlock.c:191 spin_unlock_irqrestore include/linux/spinlock.h:409 [inline] i8042_command+0x35/0x40 drivers/input/serio/i8042.c:348 i8042_aux_write+0x29/0x30 drivers/input/serio/i8042.c:383 serio_write include/linux/serio.h:125 [inline] ps2_do_sendbyte+0xb3/0x260 drivers/input/serio/libps2.c:40 ps2_sendbyte+0x31/0x80 drivers/input/serio/libps2.c:92 cypress_ps2_sendbyte+0x15/0x70 drivers/input/mouse/cypress_ps2.c:42 cypress_ps2_read_cmd_status drivers/input/mouse/cypress_ps2.c:116 [inline] cypress_send_ext_cmd+0x115/0x6c0 drivers/input/mouse/cypress_ps2.c:189 cypress_detect+0x27/0x80 drivers/input/mouse/cypress_ps2.c:205 psmouse_do_detect+0x2a/0x50 drivers/input/mouse/psmouse-base.c:1009 psmouse_try_protocol+0xd2/0x220 drivers/input/mouse/psmouse-base.c:1023 psmouse_extensions+0x1f6/0x420 drivers/input/mouse/psmouse-base.c:1146 psmouse_switch_protocol+0x125/0x140 drivers/input/mouse/psmouse-base.c:1542 psmouse_connect+0x1c7/0x370 drivers/input/mouse/psmouse-base.c:1632 serio_connect_driver+0x24/0x40 drivers/input/serio/serio.c:47 really_probe+0xe1/0x420 drivers/base/dd.c:553 driver_probe_device+0xe8/0x150 drivers/base/dd.c:738 device_driver_attach+0x4a/0x50 drivers/base/dd.c:1013 __driver_attach+0x80/0x140 drivers/base/dd.c:1090 bus_for_each_dev+0x71/0xb0 drivers/base/bus.c:305 serio_attach_driver drivers/input/serio/serio.c:808 [inline] serio_handle_event+0x1ee/0x260 drivers/input/serio/serio.c:227 process_one_work+0x26a/0x650 kernel/workqueue.c:2269 worker_thread+0x38/0x390 kernel/workqueue.c:2415 kthread+0x148/0x170 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 INITIAL USE at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x33/0x50 kernel/locking/spinlock.c:159 input_inject_event+0x44/0x1db drivers/input/input.c:466 led_trigger_event+0x3a/0x60 drivers/leds/led-triggers.c:387 kbd_led_trigger_activate+0x4b/0x60 drivers/tty/vt/keyboard.c:1005 led_trigger_set+0x1fc/0x340 drivers/leds/led-triggers.c:195 led_trigger_set_default+0x8b/0xb0 drivers/leds/led-triggers.c:259 led_classdev_register_ext+0x25c/0x370 drivers/leds/led-class.c:412 led_classdev_register include/linux/leds.h:190 [inline] input_leds_connect+0x1cc/0x4b0 drivers/input/input-leds.c:139 input_attach_handler+0x68/0x90 drivers/input/input.c:1031 input_register_device.cold.24+0x7c/0x160 drivers/input/input.c:2229 atkbd_connect+0x269/0x384 drivers/input/keyboard/atkbd.c:1293 serio_connect_driver+0x24/0x40 drivers/input/serio/serio.c:47 really_probe+0xe1/0x420 drivers/base/dd.c:553 driver_probe_device+0xe8/0x150 drivers/base/dd.c:738 device_driver_attach+0x4a/0x50 drivers/base/dd.c:1013 __driver_attach+0x80/0x140 drivers/base/dd.c:1090 bus_for_each_dev+0x71/0xb0 drivers/base/bus.c:305 serio_attach_driver drivers/input/serio/serio.c:808 [inline] serio_handle_event+0x1ee/0x260 drivers/input/serio/serio.c:227 process_one_work+0x26a/0x650 kernel/workqueue.c:2269 worker_thread+0x38/0x390 kernel/workqueue.c:2415 kthread+0x148/0x170 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 } ... key at: [] __key.34710+0x0/0x10 ... acquired at: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] evdev_pass_values+0x86/0x340 drivers/input/evdev.c:262 evdev_events+0x15b/0x1d0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values+0x1e0/0x290 drivers/input/input.c:145 input_handle_event+0x4ce/0x5f0 drivers/input/input.c:399 input_inject_event+0x174/0x1db drivers/input/input.c:471 evdev_write+0x147/0x230 drivers/input/evdev.c:530 vfs_write+0xc7/0x230 fs/read_write.c:576 ksys_write+0xb9/0xd0 fs/read_write.c:631 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> (&client->buffer_lock){....}-{2:2} { INITIAL USE at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] evdev_pass_values+0x86/0x340 drivers/input/evdev.c:262 evdev_events+0x15b/0x1d0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values+0x1e0/0x290 drivers/input/input.c:145 input_handle_event+0x4ce/0x5f0 drivers/input/input.c:399 input_inject_event+0x174/0x1db drivers/input/input.c:471 evdev_write+0x147/0x230 drivers/input/evdev.c:530 vfs_write+0xc7/0x230 fs/read_write.c:576 ksys_write+0xb9/0xd0 fs/read_write.c:631 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 } ... key at: [] __key.37006+0x0/0x10 ... acquired at: __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1002 [inline] kill_fasync+0xb8/0x240 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x1d6/0x340 drivers/input/evdev.c:279 evdev_events+0x15b/0x1d0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values+0x1e0/0x290 drivers/input/input.c:145 input_handle_event+0x4ce/0x5f0 drivers/input/input.c:399 input_inject_event+0x174/0x1db drivers/input/input.c:471 evdev_write+0x147/0x230 drivers/input/evdev.c:530 vfs_write+0xc7/0x230 fs/read_write.c:576 ksys_write+0xb9/0xd0 fs/read_write.c:631 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> (&new->fa_lock){....}-{2:2} { INITIAL USE at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1002 [inline] kill_fasync+0xb8/0x240 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x1d6/0x340 drivers/input/evdev.c:279 evdev_events+0x15b/0x1d0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values+0x1e0/0x290 drivers/input/input.c:145 input_handle_event+0x4ce/0x5f0 drivers/input/input.c:399 input_inject_event+0x174/0x1db drivers/input/input.c:471 evdev_write+0x147/0x230 drivers/input/evdev.c:530 vfs_write+0xc7/0x230 fs/read_write.c:576 ksys_write+0xb9/0xd0 fs/read_write.c:631 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 } ... key at: [] __key.46378+0x0/0x10 ... acquired at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 send_sigio+0x23/0x220 fs/fcntl.c:786 kill_fasync_rcu fs/fcntl.c:1009 [inline] kill_fasync+0xe3/0x240 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x1d6/0x340 drivers/input/evdev.c:279 evdev_events+0x15b/0x1d0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values+0x1e0/0x290 drivers/input/input.c:145 input_handle_event+0x4ce/0x5f0 drivers/input/input.c:399 input_inject_event+0x174/0x1db drivers/input/input.c:471 evdev_write+0x147/0x230 drivers/input/evdev.c:530 vfs_write+0xc7/0x230 fs/read_write.c:576 ksys_write+0xb9/0xd0 fs/read_write.c:631 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 the dependencies between the lock to be acquired and HARDIRQ-irq-unsafe lock: -> (&f->f_owner.lock){.+.+}-{2:2} { HARDIRQ-ON-R at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 f_getown+0x16/0x50 fs/fcntl.c:152 sock_ioctl+0x2d2/0x3f0 net/socket.c:1132 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x7c/0xb0 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 SOFTIRQ-ON-R at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 f_getown+0x16/0x50 fs/fcntl.c:152 sock_ioctl+0x2d2/0x3f0 net/socket.c:1132 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x7c/0xb0 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 INITIAL USE at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 f_getown+0x16/0x50 fs/fcntl.c:152 sock_ioctl+0x2d2/0x3f0 net/socket.c:1132 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x7c/0xb0 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 } ... key at: [] __key.50501+0x0/0x10 ... acquired at: lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 send_sigio+0x23/0x220 fs/fcntl.c:786 kill_fasync_rcu fs/fcntl.c:1009 [inline] kill_fasync+0xe3/0x240 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x1d6/0x340 drivers/input/evdev.c:279 evdev_events+0x15b/0x1d0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values+0x1e0/0x290 drivers/input/input.c:145 input_handle_event+0x4ce/0x5f0 drivers/input/input.c:399 input_inject_event+0x174/0x1db drivers/input/input.c:471 evdev_write+0x147/0x230 drivers/input/evdev.c:530 vfs_write+0xc7/0x230 fs/read_write.c:576 ksys_write+0xb9/0xd0 fs/read_write.c:631 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 stack backtrace: CPU: 1 PID: 10165 Comm: syz-executor.2 Not tainted 5.9.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x77/0xa0 lib/dump_stack.c:118 print_bad_irq_dependency kernel/locking/lockdep.c:2390 [inline] check_irq_usage.cold.55+0x2a3/0x3ad kernel/locking/lockdep.c:2619 check_prev_add kernel/locking/lockdep.c:2808 [inline] check_prevs_add kernel/locking/lockdep.c:2943 [inline] validate_chain kernel/locking/lockdep.c:3560 [inline] __lock_acquire+0x166e/0x3780 kernel/locking/lockdep.c:4779 lock_acquire+0xb0/0x3f0 kernel/locking/lockdep.c:5373 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 send_sigio+0x23/0x220 fs/fcntl.c:786 kill_fasync_rcu fs/fcntl.c:1009 [inline] kill_fasync+0xe3/0x240 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x1d6/0x340 drivers/input/evdev.c:279 evdev_events+0x15b/0x1d0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values+0x1e0/0x290 drivers/input/input.c:145 input_handle_event+0x4ce/0x5f0 drivers/input/input.c:399 input_inject_event+0x174/0x1db drivers/input/input.c:471 evdev_write+0x147/0x230 drivers/input/evdev.c:530 vfs_write+0xc7/0x230 fs/read_write.c:576 ksys_write+0xb9/0xd0 fs/read_write.c:631 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45e219 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fe241d7cc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045e219 RDX: 0000000000035000 RSI: 0000000020000040 RDI: 0000000000000007 RBP: 000000000119bfc0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119bf8c R13: 00007fff0dd9ecdf R14: 00007fe241d7d9c0 R15: 000000000119bf8c