bisecting cause commit starting from dff9f829e5b0181d4ed9d35aa62d695292399b54 building syzkaller on abf9ba4fc75d9b29af15625d44dcfc1360fad3b7 testing commit dff9f829e5b0181d4ed9d35aa62d695292399b54 with gcc (GCC) 8.1.0 kernel signature: 4a50fdb6c1a7ea6cd056e123042bd9a2bbd935239d0adbb805202e721347dea6 all runs: crashed: WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected testing release v5.8 testing commit bcf876870b95592b52519ed4aafcf9d95999bc9c with gcc (GCC) 8.1.0 kernel signature: 07a1fd73f31c8f04bac7b5fed9ce7ca894fd4a1b797a10568c8e3a75acf587ac all runs: OK # git bisect start dff9f829e5b0181d4ed9d35aa62d695292399b54 bcf876870b95592b52519ed4aafcf9d95999bc9c Bisecting: 10341 revisions left to test after this (roughly 13 steps) [60e76bb8a4e4c5398ea9053535e1fd0c9d6bb06e] Merge tag 'm68knommu-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu testing commit 60e76bb8a4e4c5398ea9053535e1fd0c9d6bb06e with gcc (GCC) 8.1.0 kernel signature: 049c193c988f1a4554b261d8e9e739a56a0c1791eb283c33975c9632264e32a3 all runs: OK # git bisect good 60e76bb8a4e4c5398ea9053535e1fd0c9d6bb06e Bisecting: 5167 revisions left to test after this (roughly 12 steps) [527df692cfab7997f5ae751230b4d9460aea3886] Merge remote-tracking branch 'reset/reset/next' into master testing commit 527df692cfab7997f5ae751230b4d9460aea3886 with gcc (GCC) 8.1.0 kernel signature: 57a6021bc3e3ac539a6a8cdee4c0f49efb3625ee6eeebbcc36f23210c50b8ca9 all runs: OK # git bisect good 527df692cfab7997f5ae751230b4d9460aea3886 Bisecting: 2718 revisions left to test after this (roughly 11 steps) [361c081229eab84ba908ea588640a938a3241c51] Merge remote-tracking branch 'drm/drm-next' into master testing commit 361c081229eab84ba908ea588640a938a3241c51 with gcc (GCC) 8.1.0 kernel signature: 002d47b2744ac74e8b5ccf2f8b1617d1cf6446a1b2e0ae0388eefe7197ebd3ae all runs: OK # git bisect good 361c081229eab84ba908ea588640a938a3241c51 Bisecting: 1294 revisions left to test after this (roughly 10 steps) [d495341ab2349464465fb0f10fa2afe66a85ccd1] Merge remote-tracking branch 'tip/auto-latest' into master testing commit d495341ab2349464465fb0f10fa2afe66a85ccd1 with gcc (GCC) 8.1.0 kernel signature: 9e28fba43f41bd608bdaafbd7580c030711cb36cf0e148c447cb64d294dd7918 all runs: crashed: WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected # git bisect bad d495341ab2349464465fb0f10fa2afe66a85ccd1 Bisecting: 602 revisions left to test after this (roughly 10 steps) [b2116983c2c5cbcb14bdbae2509cfe9b0c6efce1] Merge remote-tracking branch 'sound-asoc/for-next' into master testing commit b2116983c2c5cbcb14bdbae2509cfe9b0c6efce1 with gcc (GCC) 8.1.0 kernel signature: da46527af66010956306630acfcf905ee333241afc30e06ae3405e5583c23a61 all runs: OK # git bisect good b2116983c2c5cbcb14bdbae2509cfe9b0c6efce1 Bisecting: 308 revisions left to test after this (roughly 8 steps) [ebb8a0cbdc21217d8e06b4c638c575bbf5d2bfc1] Merge remote-tracking branch 'safesetid/safesetid-next' into master testing commit ebb8a0cbdc21217d8e06b4c638c575bbf5d2bfc1 with gcc (GCC) 8.1.0 kernel signature: 06dc7360c3b8166b53dbaa42833c49991aab8b9f27465abd1982ed27b85963da all runs: OK # git bisect good ebb8a0cbdc21217d8e06b4c638c575bbf5d2bfc1 Bisecting: 154 revisions left to test after this (roughly 7 steps) [c5d4d36a386d54c0720993f9567b6a502da74902] Merge branch 'locking/core' testing commit c5d4d36a386d54c0720993f9567b6a502da74902 with gcc (GCC) 8.1.0 kernel signature: bef967930745f0acb975f1582a608bb9b6292baaa20c32340448b89d0d4b9cea all runs: crashed: WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected # git bisect bad c5d4d36a386d54c0720993f9567b6a502da74902 Bisecting: 75 revisions left to test after this (roughly 6 steps) [ca08e5d7fd94742477eca8529a08404a997dfa26] Merge branch 'x86/cache' testing commit ca08e5d7fd94742477eca8529a08404a997dfa26 with gcc (GCC) 8.1.0 kernel signature: 29686da1b3a480f64021fb8b31c3058c51c81b7634ef7df76a188c9788e5a63a all runs: OK # git bisect good ca08e5d7fd94742477eca8529a08404a997dfa26 Bisecting: 37 revisions left to test after this (roughly 5 steps) [1b45c8ca41d48cc24f1967b9f026bc42aa04ad50] Merge branch 'ras/core' testing commit 1b45c8ca41d48cc24f1967b9f026bc42aa04ad50 with gcc (GCC) 8.1.0 kernel signature: c6f114d8c0568f942195ab693e6b93bd31263a8407bf67b72395f7c2681c0d2a all runs: OK # git bisect good 1b45c8ca41d48cc24f1967b9f026bc42aa04ad50 Bisecting: 18 revisions left to test after this (roughly 4 steps) [31e0d747708272356bee9b6a1b90c1e6525b0f6d] lockdep/selftest: Unleash irq_read_recursion2 and add more testing commit 31e0d747708272356bee9b6a1b90c1e6525b0f6d with gcc (GCC) 8.1.0 kernel signature: 27adc08b1cc0a462302c6b43207dbd6862026c7a0ac772483bea8a1c2e23c3f6 all runs: crashed: WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected # git bisect bad 31e0d747708272356bee9b6a1b90c1e6525b0f6d Bisecting: 9 revisions left to test after this (roughly 3 steps) [bd76eca10de2eb9998d5125b08e8997cbf5508d5] lockdep: Reduce the size of lock_list::distance testing commit bd76eca10de2eb9998d5125b08e8997cbf5508d5 with gcc (GCC) 8.1.0 kernel signature: 3421c70462cc10768077d628d7096e1850d6949630ee4a58e3aa453f2696b8b6 all runs: OK # git bisect good bd76eca10de2eb9998d5125b08e8997cbf5508d5 Bisecting: 4 revisions left to test after this (roughly 2 steps) [68e305678583f13a67e2ce22088c2520bd4f97b4] lockdep: Adjust check_redundant() for recursive read change testing commit 68e305678583f13a67e2ce22088c2520bd4f97b4 with gcc (GCC) 8.1.0 kernel signature: 8616e3ea9c6f682ac1462a1bacf7cb7b60c5f5e18b28bd3927b512c2cbf5deca all runs: OK # git bisect good 68e305678583f13a67e2ce22088c2520bd4f97b4 Bisecting: 2 revisions left to test after this (roughly 1 step) [621c9dac0eea7607cb9a57cc9ba47fbcd4e644c9] lockdep: Add recursive read locks into dependency graph testing commit 621c9dac0eea7607cb9a57cc9ba47fbcd4e644c9 with gcc (GCC) 8.1.0 kernel signature: 7d158e2061a20063e4f99c3af882d31ba33347c33cf76fea0f6e895f87ac280c all runs: crashed: WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected # git bisect bad 621c9dac0eea7607cb9a57cc9ba47fbcd4e644c9 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: 83f3389fe90233e504114509671637c7469c02baf87f57f3e6e7e948662946b7 all runs: crashed: WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected # 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: 83f3389fe90233e504114509671637c7469c02baf87f57f3e6e7e948662946b7 parent signature: 8616e3ea9c6f682ac1462a1bacf7cb7b60c5f5e18b28bd3927b512c2cbf5deca revisions tested: 16, total time: 3h31m45.935570058s (build: 1h18m29.843796172s, test: 2h11m36.382523798s) 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: WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 5.9.0-rc2-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.5/8289 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffff88812abc0738 (&f->f_owner.lock){.+.+}-{2:2}, at: send_sigio+0x23/0x1c0 fs/fcntl.c:786 and this task is already holding: ffff88810eed3630 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1002 [inline] ffff88810eed3630 (&new->fa_lock){....}-{2:2}, at: kill_fasync+0xa7/0x200 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+0xd7/0x3e0 kernel/locking/lockdep.c:5373 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x58/0x80 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+0x70/0x260 drivers/input/mouse/psmouse-base.c:232 psmouse_handle_byte+0xa/0x50 drivers/input/mouse/psmouse-base.c:274 psmouse_interrupt+0xb7/0x360 drivers/input/mouse/psmouse-base.c:426 serio_interrupt+0x3b/0x80 drivers/input/serio/serio.c:1002 i8042_interrupt+0x147/0x240 drivers/input/serio/i8042.c:598 __handle_irq_event_percpu+0x83/0x370 kernel/irq/handle.c:156 handle_irq_event_percpu+0x2b/0x70 kernel/irq/handle.c:196 handle_irq_event+0x2f/0x4c kernel/irq/handle.c:213 handle_edge_irq+0x8f/0x1b0 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+0x159/0x220 arch/x86/kernel/irq.c:239 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:572 arch_atomic_inc arch/x86/include/asm/atomic.h:95 [inline] atomic_inc include/asm-generic/atomic-instrumented.h:241 [inline] page_ref_inc include/linux/page_ref.h:116 [inline] try_get_page include/linux/mm.h:1159 [inline] try_grab_page+0xe2/0x130 mm/gup.c:152 follow_page_pte+0x229/0x6a0 mm/gup.c:488 __get_user_pages+0x2db/0x8e0 mm/gup.c:1103 __get_user_pages_locked mm/gup.c:1288 [inline] __get_user_pages_remote+0xca/0x2a0 mm/gup.c:1787 get_arg_page+0x39/0xa0 fs/exec.c:220 copy_string_kernel+0xa0/0x1d0 fs/exec.c:631 copy_strings_kernel+0x3f/0x90 fs/exec.c:650 kernel_execve+0xfc/0x1a0 fs/exec.c:2072 call_usermodehelper_exec_async+0xad/0x110 kernel/umh.c:101 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+0xd7/0x3e0 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_sigurg+0x15/0x1b0 fs/fcntl.c:824 sk_send_sigurg+0x31/0x160 net/core/sock.c:2944 tcp_check_urg net/ipv4/tcp_input.c:5412 [inline] tcp_urg+0xa2/0x1f0 net/ipv4/tcp_input.c:5453 tcp_rcv_established+0x1de/0x6b0 net/ipv4/tcp_input.c:5783 tcp_v4_do_rcv+0x11c/0x1d0 net/ipv4/tcp_ipv4.c:1642 sk_backlog_rcv include/net/sock.h:1011 [inline] __release_sock+0x68/0x100 net/core/sock.c:2542 release_sock+0x26/0xa0 net/core/sock.c:3065 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1442 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0x2b/0x40 net/socket.c:671 __sys_sendto+0xec/0x160 net/socket.c:1992 __do_sys_sendto net/socket.c:2004 [inline] __se_sys_sendto net/socket.c:2000 [inline] __x64_sys_sendto+0x1f/0x30 net/socket.c:2000 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.5/8289: #0: ffff8881264ce960 (&evdev->mutex){+.+.}-{3:3}, at: evdev_write+0x8a/0x230 drivers/input/evdev.c:513 #1: ffff888129117230 (&dev->event_lock){-...}-{2:2}, at: input_inject_event+0x44/0x1b6 drivers/input/input.c:466 #2: ffffffff842f5dc0 (rcu_read_lock){....}-{1:2}, at: is_event_supported drivers/input/input.c:53 [inline] #2: ffffffff842f5dc0 (rcu_read_lock){....}-{1:2}, at: input_inject_event+0x28/0x1b6 drivers/input/input.c:465 #3: ffffffff842f5dc0 (rcu_read_lock){....}-{1:2}, at: input_pass_values.part.8+0x0/0x260 drivers/input/input.c:2325 #4: ffffffff842f5dc0 (rcu_read_lock){....}-{1:2}, at: evdev_events+0x0/0x1a0 drivers/input/evdev.c:335 #5: ffff88810ff70828 (&client->buffer_lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] #5: ffff88810ff70828 (&client->buffer_lock){....}-{2:2}, at: evdev_pass_values+0x73/0x220 drivers/input/evdev.c:262 #6: ffffffff842f5dc0 (rcu_read_lock){....}-{1:2}, at: kill_fasync+0xa/0x200 fs/fcntl.c:1021 #7: ffff88810eed3630 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1002 [inline] #7: ffff88810eed3630 (&new->fa_lock){....}-{2:2}, at: kill_fasync+0xa7/0x200 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+0xd7/0x3e0 kernel/locking/lockdep.c:5373 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x58/0x80 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+0x70/0x260 drivers/input/mouse/psmouse-base.c:232 psmouse_handle_byte+0xa/0x50 drivers/input/mouse/psmouse-base.c:274 psmouse_interrupt+0xb7/0x360 drivers/input/mouse/psmouse-base.c:426 serio_interrupt+0x3b/0x80 drivers/input/serio/serio.c:1002 i8042_interrupt+0x147/0x240 drivers/input/serio/i8042.c:598 __handle_irq_event_percpu+0x83/0x370 kernel/irq/handle.c:156 handle_irq_event_percpu+0x2b/0x70 kernel/irq/handle.c:196 handle_irq_event+0x2f/0x4c kernel/irq/handle.c:213 handle_edge_irq+0x8f/0x1b0 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+0x159/0x220 arch/x86/kernel/irq.c:239 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:572 arch_atomic_inc arch/x86/include/asm/atomic.h:95 [inline] atomic_inc include/asm-generic/atomic-instrumented.h:241 [inline] page_ref_inc include/linux/page_ref.h:116 [inline] try_get_page include/linux/mm.h:1159 [inline] try_grab_page+0xe2/0x130 mm/gup.c:152 follow_page_pte+0x229/0x6a0 mm/gup.c:488 __get_user_pages+0x2db/0x8e0 mm/gup.c:1103 __get_user_pages_locked mm/gup.c:1288 [inline] __get_user_pages_remote+0xca/0x2a0 mm/gup.c:1787 get_arg_page+0x39/0xa0 fs/exec.c:220 copy_string_kernel+0xa0/0x1d0 fs/exec.c:631 copy_strings_kernel+0x3f/0x90 fs/exec.c:650 kernel_execve+0xfc/0x1a0 fs/exec.c:2072 call_usermodehelper_exec_async+0xad/0x110 kernel/umh.c:101 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 INITIAL USE at: lock_acquire+0xd7/0x3e0 kernel/locking/lockdep.c:5373 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x58/0x80 kernel/locking/spinlock.c:159 input_inject_event+0x44/0x1b6 drivers/input/input.c:466 led_trigger_event+0x3c/0x60 drivers/leds/led-triggers.c:387 kbd_led_trigger_activate+0x4b/0x60 drivers/tty/vt/keyboard.c:1005 led_trigger_set+0x1fc/0x300 drivers/leds/led-triggers.c:195 led_trigger_set_default+0x8b/0xb0 drivers/leds/led-triggers.c:259 led_classdev_register_ext+0x228/0x2c0 drivers/leds/led-class.c:412 led_classdev_register include/linux/leds.h:190 [inline] input_leds_connect+0x14e/0x269 drivers/input/input-leds.c:139 input_attach_handler+0x68/0x90 drivers/input/input.c:1031 input_register_device.cold.22+0xa4/0x115 drivers/input/input.c:2229 atkbd_connect+0x214/0x2eb drivers/input/keyboard/atkbd.c:1293 serio_connect_driver+0x24/0x40 drivers/input/serio/serio.c:47 really_probe+0xcc/0x2e0 drivers/base/dd.c:553 driver_probe_device+0x49/0xa0 drivers/base/dd.c:738 device_driver_attach+0x4a/0x50 drivers/base/dd.c:1013 __driver_attach+0x43/0xb0 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/0x250 drivers/input/serio/serio.c:227 process_one_work+0x26a/0x5f0 kernel/workqueue.c:2269 worker_thread+0x38/0x380 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.34751+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+0x73/0x220 drivers/input/evdev.c:262 evdev_events+0xf7/0x1a0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values.part.8+0x1b0/0x260 drivers/input/input.c:145 input_pass_values drivers/input/input.c:134 [inline] input_handle_event+0x4ae/0x570 drivers/input/input.c:399 input_inject_event+0x14f/0x1b6 drivers/input/input.c:471 evdev_write+0x136/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+0xd7/0x3e0 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+0x73/0x220 drivers/input/evdev.c:262 evdev_events+0xf7/0x1a0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values.part.8+0x1b0/0x260 drivers/input/input.c:145 input_pass_values drivers/input/input.c:134 [inline] input_handle_event+0x4ae/0x570 drivers/input/input.c:399 input_inject_event+0x14f/0x1b6 drivers/input/input.c:471 evdev_write+0x136/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.37028+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+0xa7/0x200 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x16e/0x220 drivers/input/evdev.c:279 evdev_events+0xf7/0x1a0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values.part.8+0x1b0/0x260 drivers/input/input.c:145 input_pass_values drivers/input/input.c:134 [inline] input_handle_event+0x4ae/0x570 drivers/input/input.c:399 input_inject_event+0x14f/0x1b6 drivers/input/input.c:471 evdev_write+0x136/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+0xd7/0x3e0 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+0xa7/0x200 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x16e/0x220 drivers/input/evdev.c:279 evdev_events+0xf7/0x1a0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values.part.8+0x1b0/0x260 drivers/input/input.c:145 input_pass_values drivers/input/input.c:134 [inline] input_handle_event+0x4ae/0x570 drivers/input/input.c:399 input_inject_event+0x14f/0x1b6 drivers/input/input.c:471 evdev_write+0x136/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.46405+0x0/0x10 ... acquired at: lock_acquire+0xd7/0x3e0 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/0x1c0 fs/fcntl.c:786 kill_fasync_rcu fs/fcntl.c:1009 [inline] kill_fasync+0xd2/0x200 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x16e/0x220 drivers/input/evdev.c:279 evdev_events+0xf7/0x1a0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values.part.8+0x1b0/0x260 drivers/input/input.c:145 input_pass_values drivers/input/input.c:134 [inline] input_handle_event+0x4ae/0x570 drivers/input/input.c:399 input_inject_event+0x14f/0x1b6 drivers/input/input.c:471 evdev_write+0x136/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+0xd7/0x3e0 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_sigurg+0x15/0x1b0 fs/fcntl.c:824 sk_send_sigurg+0x31/0x160 net/core/sock.c:2944 tcp_check_urg net/ipv4/tcp_input.c:5412 [inline] tcp_urg+0xa2/0x1f0 net/ipv4/tcp_input.c:5453 tcp_rcv_established+0x1de/0x6b0 net/ipv4/tcp_input.c:5783 tcp_v4_do_rcv+0x11c/0x1d0 net/ipv4/tcp_ipv4.c:1642 sk_backlog_rcv include/net/sock.h:1011 [inline] __release_sock+0x68/0x100 net/core/sock.c:2542 release_sock+0x26/0xa0 net/core/sock.c:3065 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1442 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0x2b/0x40 net/socket.c:671 __sys_sendto+0xec/0x160 net/socket.c:1992 __do_sys_sendto net/socket.c:2004 [inline] __se_sys_sendto net/socket.c:2000 [inline] __x64_sys_sendto+0x1f/0x30 net/socket.c:2000 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 SOFTIRQ-ON-R at: lock_acquire+0xd7/0x3e0 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_sigurg+0x15/0x1b0 fs/fcntl.c:824 sk_send_sigurg+0x31/0x160 net/core/sock.c:2944 tcp_check_urg net/ipv4/tcp_input.c:5412 [inline] tcp_urg+0xa2/0x1f0 net/ipv4/tcp_input.c:5453 tcp_rcv_established+0x1de/0x6b0 net/ipv4/tcp_input.c:5783 tcp_v4_do_rcv+0x11c/0x1d0 net/ipv4/tcp_ipv4.c:1642 sk_backlog_rcv include/net/sock.h:1011 [inline] __release_sock+0x68/0x100 net/core/sock.c:2542 release_sock+0x26/0xa0 net/core/sock.c:3065 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1442 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0x2b/0x40 net/socket.c:671 __sys_sendto+0xec/0x160 net/socket.c:1992 __do_sys_sendto net/socket.c:2004 [inline] __se_sys_sendto net/socket.c:2000 [inline] __x64_sys_sendto+0x1f/0x30 net/socket.c:2000 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 INITIAL USE at: lock_acquire+0xd7/0x3e0 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_sigurg+0x15/0x1b0 fs/fcntl.c:824 sk_send_sigurg+0x31/0x160 net/core/sock.c:2944 tcp_check_urg net/ipv4/tcp_input.c:5412 [inline] tcp_urg+0xa2/0x1f0 net/ipv4/tcp_input.c:5453 tcp_rcv_established+0x1de/0x6b0 net/ipv4/tcp_input.c:5783 tcp_v4_do_rcv+0x11c/0x1d0 net/ipv4/tcp_ipv4.c:1642 sk_backlog_rcv include/net/sock.h:1011 [inline] __release_sock+0x68/0x100 net/core/sock.c:2542 release_sock+0x26/0xa0 net/core/sock.c:3065 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1442 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0x2b/0x40 net/socket.c:671 __sys_sendto+0xec/0x160 net/socket.c:1992 __do_sys_sendto net/socket.c:2004 [inline] __se_sys_sendto net/socket.c:2000 [inline] __x64_sys_sendto+0x1f/0x30 net/socket.c:2000 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 } ... key at: [] __key.50535+0x0/0x10 ... acquired at: lock_acquire+0xd7/0x3e0 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/0x1c0 fs/fcntl.c:786 kill_fasync_rcu fs/fcntl.c:1009 [inline] kill_fasync+0xd2/0x200 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x16e/0x220 drivers/input/evdev.c:279 evdev_events+0xf7/0x1a0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values.part.8+0x1b0/0x260 drivers/input/input.c:145 input_pass_values drivers/input/input.c:134 [inline] input_handle_event+0x4ae/0x570 drivers/input/input.c:399 input_inject_event+0x14f/0x1b6 drivers/input/input.c:471 evdev_write+0x136/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: 8289 Comm: syz-executor.5 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+0xa3/0xcc lib/dump_stack.c:118 print_bad_irq_dependency kernel/locking/lockdep.c:2390 [inline] check_irq_usage.cold.70+0x285/0x291 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+0x1098/0x1740 kernel/locking/lockdep.c:4779 lock_acquire+0xd7/0x3e0 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/0x1c0 fs/fcntl.c:786 kill_fasync_rcu fs/fcntl.c:1009 [inline] kill_fasync+0xd2/0x200 fs/fcntl.c:1023 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x16e/0x220 drivers/input/evdev.c:279 evdev_events+0xf7/0x1a0 drivers/input/evdev.c:307 input_to_handler+0x83/0xe0 drivers/input/input.c:115 input_pass_values.part.8+0x1b0/0x260 drivers/input/input.c:145 input_pass_values drivers/input/input.c:134 [inline] input_handle_event+0x4ae/0x570 drivers/input/input.c:399 input_inject_event+0x14f/0x1b6 drivers/input/input.c:471 evdev_write+0x136/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:0x45d5b9 Code: 5d 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 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ff42472bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000038f80 RCX: 000000000045d5b9 RDX: 0000000000000373 RSI: 0000000020000040 RDI: 0000000000000004 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffc93a0245f R14: 00007ff42472c9c0 R15: 000000000118cf4c