netdevsim netdevsim0 netdevsim1: set [1, 0] type 2 family 0 port 6081 - 0 netdevsim netdevsim0 netdevsim2: set [1, 0] type 2 family 0 port 6081 - 0 netdevsim netdevsim0 netdevsim3: set [1, 0] type 2 family 0 port 6081 - 0 ======================================================== WARNING: possible irq lock inversion dependency detected 5.12.0-syzkaller #0 Not tainted -------------------------------------------------------- syz-executor110/8375 just changed the state of lock: ffff888025f2f0c0 (&new->fa_lock){.+..}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1012 [inline] ffff888025f2f0c0 (&new->fa_lock){.+..}-{2:2}, at: kill_fasync+0x19b/0x440 fs/fcntl.c:1033 but this lock was taken by another, HARDIRQ-safe lock in the past: (&dev->event_lock){-...}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Chain exists of: &dev->event_lock --> &client->buffer_lock --> &new->fa_lock Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&new->fa_lock); local_irq_disable(); lock(&dev->event_lock); lock(&client->buffer_lock); lock(&dev->event_lock); *** DEADLOCK *** 3 locks held by syz-executor110/8375: #0: ffffffff8cd14580 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:266 #1: ffffffff8cd14580 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:266 #2: ffffffff8cd14580 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:266 the shortest dependencies between 2nd lock and 1st lock: -> (&dev->event_lock){-...}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0x17f/0x720 kernel/locking/lockdep.c:5512 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 input_event+0x89/0xc0 drivers/input/input.c:445 input_report_key include/linux/input.h:425 [inline] psmouse_report_standard_buttons drivers/input/mouse/psmouse-base.c:123 [inline] psmouse_report_standard_packet+0x4f/0x200 drivers/input/mouse/psmouse-base.c:141 psmouse_process_byte+0x44f/0x640 drivers/input/mouse/psmouse-base.c:232 psmouse_handle_byte+0x44/0x4a0 drivers/input/mouse/psmouse-base.c:274 psmouse_interrupt+0x6d0/0x10c0 drivers/input/mouse/psmouse-base.c:426 serio_interrupt+0x88/0x130 drivers/input/serio/serio.c:1002 i8042_interrupt+0x34c/0x740 drivers/input/serio/i8042.c:602 __handle_irq_event_percpu+0x20a/0x6d0 kernel/irq/handle.c:156 handle_irq_event_percpu kernel/irq/handle.c:196 [inline] handle_irq_event+0x10a/0x2f0 kernel/irq/handle.c:213 handle_edge_irq+0x245/0xbe0 kernel/irq/chip.c:819 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:231 [inline] __common_interrupt+0xce/0x1e0 arch/x86/kernel/irq.c:250 common_interrupt+0x9c/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:623 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline] _raw_spin_unlock_irqrestore+0xbc/0x120 kernel/locking/spinlock.c:191 spin_unlock_irqrestore include/linux/spinlock.h:409 [inline] i8042_command drivers/input/serio/i8042.c:352 [inline] i8042_aux_write+0x118/0x190 drivers/input/serio/i8042.c:387 serio_write include/linux/serio.h:125 [inline] ps2_do_sendbyte+0x210/0x710 drivers/input/serio/libps2.c:40 ps2_sendbyte+0x5c/0x120 drivers/input/serio/libps2.c:92 cypress_ps2_sendbyte drivers/input/mouse/cypress_ps2.c:42 [inline] cypress_ps2_read_cmd_status+0x151/0x600 drivers/input/mouse/cypress_ps2.c:116 cypress_send_ext_cmd+0xfa/0x3e0 drivers/input/mouse/cypress_ps2.c:189 cypress_detect+0x80/0x210 drivers/input/mouse/cypress_ps2.c:205 psmouse_do_detect drivers/input/mouse/psmouse-base.c:1009 [inline] psmouse_try_protocol drivers/input/mouse/psmouse-base.c:1023 [inline] psmouse_extensions+0x14a1/0x2130 drivers/input/mouse/psmouse-base.c:1146 psmouse_switch_protocol+0x307/0x840 drivers/input/mouse/psmouse-base.c:1542 psmouse_connect+0x918/0x1630 drivers/input/mouse/psmouse-base.c:1632 serio_connect_driver drivers/input/serio/serio.c:47 [inline] serio_driver_probe+0x76/0x90 drivers/input/serio/serio.c:778 really_probe+0x385/0x1020 drivers/base/dd.c:576 driver_probe_device+0x178/0x350 drivers/base/dd.c:763 device_driver_attach+0x176/0x280 drivers/base/dd.c:1039 __driver_attach+0xa7/0x390 drivers/base/dd.c:1117 bus_for_each_dev+0x168/0x1d0 drivers/base/bus.c:305 serio_attach_driver drivers/input/serio/serio.c:808 [inline] serio_handle_event+0x8d1/0x1070 drivers/input/serio/serio.c:227 process_one_work+0x833/0x10c0 kernel/workqueue.c:2275 worker_thread+0xac1/0x1300 kernel/workqueue.c:2421 kthread+0x39a/0x3c0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 INITIAL USE at: lock_acquire+0x17f/0x720 kernel/locking/lockdep.c:5512 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 input_inject_event+0xb3/0x280 drivers/input/input.c:471 led_trigger_event+0x6f/0xd0 drivers/leds/led-triggers.c:388 kbd_led_trigger_activate+0xb8/0x100 drivers/tty/vt/keyboard.c:1029 led_trigger_set+0x514/0x940 drivers/leds/led-triggers.c:195 led_trigger_set_default+0x1ca/0x200 drivers/leds/led-triggers.c:259 led_classdev_register_ext+0x690/0x870 drivers/leds/led-class.c:416 led_classdev_register include/linux/leds.h:190 [inline] input_leds_connect+0x495/0x660 drivers/input/input-leds.c:139 input_attach_handler drivers/input/input.c:1035 [inline] input_register_device+0xd36/0x1220 drivers/input/input.c:2335 atkbd_connect+0x74f/0xa70 drivers/input/keyboard/atkbd.c:1293 serio_connect_driver drivers/input/serio/serio.c:47 [inline] serio_driver_probe+0x76/0x90 drivers/input/serio/serio.c:778 really_probe+0x385/0x1020 drivers/base/dd.c:576 driver_probe_device+0x178/0x350 drivers/base/dd.c:763 device_driver_attach+0x176/0x280 drivers/base/dd.c:1039 __driver_attach+0xa7/0x390 drivers/base/dd.c:1117 bus_for_each_dev+0x168/0x1d0 drivers/base/bus.c:305 serio_attach_driver drivers/input/serio/serio.c:808 [inline] serio_handle_event+0x8d1/0x1070 drivers/input/serio/serio.c:227 process_one_work+0x833/0x10c0 kernel/workqueue.c:2275 worker_thread+0xac1/0x1300 kernel/workqueue.c:2421 kthread+0x39a/0x3c0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 } ... key at: [] input_allocate_device.__key.6+0x0/0x40 ... acquired at: lock_acquire+0x17f/0x720 kernel/locking/lockdep.c:5512 __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+0xd9/0xaa0 drivers/input/evdev.c:261 evdev_events+0x1c5/0x270 drivers/input/evdev.c:306 input_to_handler drivers/input/input.c:115 [inline] input_pass_values+0x89c/0x11d0 drivers/input/input.c:145 input_handle_event+0xb99/0x1550 drivers/input/input.c:404 input_inject_event+0x1e8/0x280 drivers/input/input.c:476 evdev_write+0x5f0/0x780 drivers/input/evdev.c:530 vfs_write+0x289/0xc90 fs/read_write.c:603 ksys_write+0x171/0x2a0 fs/read_write.c:658 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae -> (&client->buffer_lock){....}-{2:2} { INITIAL USE at: lock_acquire+0x17f/0x720 kernel/locking/lockdep.c:5512 __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+0xd9/0xaa0 drivers/input/evdev.c:261 evdev_events+0x1c5/0x270 drivers/input/evdev.c:306 input_to_handler drivers/input/input.c:115 [inline] input_pass_values+0x89c/0x11d0 drivers/input/input.c:145 input_handle_event+0xb99/0x1550 drivers/input/input.c:404 input_inject_event+0x1e8/0x280 drivers/input/input.c:476 evdev_write+0x5f0/0x780 drivers/input/evdev.c:530 vfs_write+0x289/0xc90 fs/read_write.c:603 ksys_write+0x171/0x2a0 fs/read_write.c:658 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae } ... key at: [] evdev_open.__key.23+0x0/0x40 ... acquired at: lock_acquire+0x17f/0x720 kernel/locking/lockdep.c:5512 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x19b/0x440 fs/fcntl.c:1033 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x58a/0xaa0 drivers/input/evdev.c:278 evdev_events+0x1c5/0x270 drivers/input/evdev.c:306 input_to_handler drivers/input/input.c:115 [inline] input_pass_values+0x89c/0x11d0 drivers/input/input.c:145 input_handle_event+0xb99/0x1550 drivers/input/input.c:404 input_inject_event+0x1e8/0x280 drivers/input/input.c:476 evdev_write+0x5f0/0x780 drivers/input/evdev.c:530 vfs_write+0x289/0xc90 fs/read_write.c:603 ksys_write+0x171/0x2a0 fs/read_write.c:658 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae -> (&new->fa_lock){.+..}-{2:2} { HARDIRQ-ON-R at: lock_acquire+0x17f/0x720 kernel/locking/lockdep.c:5512 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x19b/0x440 fs/fcntl.c:1033 sock_wake_async+0x133/0x150 net/socket.c:1312 sk_wake_async+0x17f/0x200 include/net/sock.h:2305 sock_def_error_report+0x18c/0x210 net/core/sock.c:2899 sock_queue_err_skb+0x55c/0x690 net/core/skbuff.c:4640 __skb_complete_tx_timestamp net/core/skbuff.c:4735 [inline] __skb_tstamp_tx+0x812/0xc20 net/core/skbuff.c:4825 __dev_queue_xmit+0x1ca4/0x2cb0 net/core/dev.c:4129 packet_snd net/packet/af_packet.c:3006 [inline] packet_sendmsg+0x4ccb/0x6620 net/packet/af_packet.c:3031 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg net/socket.c:674 [inline] ____sys_sendmsg+0x5a2/0x900 net/socket.c:2350 ___sys_sendmsg net/socket.c:2404 [inline] __sys_sendmmsg+0x500/0x790 net/socket.c:2490 __do_sys_sendmmsg net/socket.c:2519 [inline] __se_sys_sendmmsg net/socket.c:2516 [inline] __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2516 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae INITIAL READ USE at: lock_acquire+0x17f/0x720 kernel/locking/lockdep.c:5512 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x19b/0x440 fs/fcntl.c:1033 __pass_event drivers/input/evdev.c:240 [inline] evdev_pass_values+0x58a/0xaa0 drivers/input/evdev.c:278 evdev_events+0x1c5/0x270 drivers/input/evdev.c:306 input_to_handler drivers/input/input.c:115 [inline] input_pass_values+0x89c/0x11d0 drivers/input/input.c:145 input_handle_event+0xb99/0x1550 drivers/input/input.c:404 input_inject_event+0x1e8/0x280 drivers/input/input.c:476 evdev_write+0x5f0/0x780 drivers/input/evdev.c:530 vfs_write+0x289/0xc90 fs/read_write.c:603 ksys_write+0x171/0x2a0 fs/read_write.c:658 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae } ... key at: [] fasync_insert_entry.__key+0x0/0x40 ... acquired at: mark_usage kernel/locking/lockdep.c:4381 [inline] __lock_acquire+0xd10/0x6040 kernel/locking/lockdep.c:4856 lock_acquire+0x17f/0x720 kernel/locking/lockdep.c:5512 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x19b/0x440 fs/fcntl.c:1033 sock_wake_async+0x133/0x150 net/socket.c:1312 sk_wake_async+0x17f/0x200 include/net/sock.h:2305 sock_def_error_report+0x18c/0x210 net/core/sock.c:2899 sock_queue_err_skb+0x55c/0x690 net/core/skbuff.c:4640 __skb_complete_tx_timestamp net/core/skbuff.c:4735 [inline] __skb_tstamp_tx+0x812/0xc20 net/core/skbuff.c:4825 __dev_queue_xmit+0x1ca4/0x2cb0 net/core/dev.c:4129 packet_snd net/packet/af_packet.c:3006 [inline] packet_sendmsg+0x4ccb/0x6620 net/packet/af_packet.c:3031 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg net/socket.c:674 [inline] ____sys_sendmsg+0x5a2/0x900 net/socket.c:2350 ___sys_sendmsg net/socket.c:2404 [inline] __sys_sendmmsg+0x500/0x790 net/socket.c:2490 __do_sys_sendmmsg net/socket.c:2519 [inline] __se_sys_sendmmsg net/socket.c:2516 [inline] __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2516 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae stack backtrace: CPU: 0 PID: 8375 Comm: syz-executor110 Not tainted 5.12.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x202/0x31e lib/dump_stack.c:120 print_irq_inversion_bug+0xa58/0xda0 kernel/locking/lockdep.c:3887 check_usage_backwards kernel/locking/lockdep.c:2482 [inline] mark_lock_irq kernel/locking/lockdep.c:4043 [inline] mark_lock+0x110b/0x1eb0 kernel/locking/lockdep.c:4480 mark_usage kernel/locking/lockdep.c:4381 [inline] __lock_acquire+0xd10/0x6040 kernel/locking/lockdep.c:4856 lock_acquire+0x17f/0x720 kernel/locking/lockdep.c:5512 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x19b/0x440 fs/fcntl.c:1033 sock_wake_async+0x133/0x150 net/socket.c:1312 sk_wake_async+0x17f/0x200 include/net/sock.h:2305 sock_def_error_report+0x18c/0x210 net/core/sock.c:2899 sock_queue_err_skb+0x55c/0x690 net/core/skbuff.c:4640 __skb_complete_tx_timestamp net/core/skbuff.c:4735 [inline] __skb_tstamp_tx+0x812/0xc20 net/core/skbuff.c:4825 __dev_queue_xmit+0x1ca4/0x2cb0 net/core/dev.c:4129 packet_snd net/packet/af_packet.c:3006 [inline] packet_sendmsg+0x4ccb/0x6620 net/packet/af_packet.c:3031 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg net/socket.c:674 [inline] ____sys_sendmsg+0x5a2/0x900 net/socket.c:2350 ___sys_sendmsg net/socket.c:2404 [inline] __sys_sendmmsg+0x500/0x790 net/socket.c:2490 __do_sys_sendmmsg net/socket.c:2519 [inline] __se_sys_sendmmsg net/socket.c:2516 [inline] __x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2516 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x447899 Code: 28 c3 e8 4a 15 00 00 66 2e 0f 1f 84 00 00 00 00 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe8fbe8f08 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007ffe8fbe8f18 RCX: 0000000000447899 RDX: 000000000400004e RSI: 0000000020000d00 RDI: 0000000000000005 RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe8fbe8f20 R13: 00007ffe8fbe8f40 R14: 00000000004b8018 R15: 00000000004004b8