========================================================
WARNING: possible irq lock inversion dependency detected
5.10.0-rc1-syzkaller #0 Not tainted
--------------------------------------------------------
syz-executor.0/5585 just changed the state of lock:
ffff8880129d7db8 (&f->f_owner.lock){.+..}-{2:2}, at: send_sigio+0x24/0x370
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 --> &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);
  <Interrupt>
    lock(
&dev->event_lock);

 *** DEADLOCK ***

2 locks held by syz-executor.0/5585:
 #0: ffffffff8ef47df8 (&fsnotify_mark_srcu){....}-{0:0}, at: fsnotify+0x2d5/0x1420
 #1: ffff888024e17bf0 (&mark->lock){+.+.}-{2:2}, at: dnotify_handle_event+0x47/0x280

the shortest dependencies between 2nd lock and 1st lock:
   -> (&dev->event_lock){-...}-{2:2} {
      IN-HARDIRQ-W at:
                          lock_acquire+0x1a6/0x890
                          _raw_spin_lock_irqsave+0x36/0x50
                          input_event+0x7b/0xb0
                          psmouse_report_standard_buttons+0x2c/0x80
                          psmouse_process_byte+0x1df/0x890
                          psmouse_handle_byte+0x41/0x1a0
                          psmouse_interrupt+0x2fe/0xef0
                          serio_interrupt+0x89/0x150
                          i8042_interrupt+0x264/0x500
                          __handle_irq_event_percpu+0x303/0x900
                          handle_irq_event+0x102/0x290
                          handle_edge_irq+0x25d/0xcf0
                          asm_call_irq_on_stack+0xf/0x20
                          common_interrupt+0x11a/0x1d0
                          asm_common_interrupt+0x1e/0x40
                          _raw_spin_unlock_irqrestore+0x25/0x50
                          i8042_aux_write+0xfc/0x150
                          ps2_do_sendbyte+0x269/0x6b0
                          ps2_sendbyte+0x55/0x150
                          cypress_ps2_sendbyte+0x2e/0x160
                          cypress_send_ext_cmd+0x1df/0x890
                          cypress_detect+0x7c/0x190
                          psmouse_try_protocol+0x214/0x370
                          psmouse_extensions+0x60f/0x950
                          psmouse_switch_protocol+0x528/0x740
                          psmouse_connect+0x5e8/0xfd0
                          serio_driver_probe+0x6d/0x90
                          really_probe+0x291/0xdc0
                          driver_probe_device+0x269/0x3d0
                          device_driver_attach+0x228/0x290
                          __driver_attach+0x151/0x2e0
                          bus_for_each_dev+0x148/0x1d0
                          serio_handle_event+0x607/0x920
                          process_one_work+0x9a9/0x15d0
                          worker_thread+0x676/0x1170
                          kthread+0x3a0/0x490
                          ret_from_fork+0x1f/0x30
      INITIAL USE at:
                         lock_acquire+0x1a6/0x890
                         _raw_spin_lock_irqsave+0x36/0x50
                         input_inject_event+0xab/0x310
                         led_set_brightness_nosleep+0xe7/0x1a0
                         led_set_brightness+0x135/0x180
                         led_trigger_event+0x70/0xd0
                         kbd_led_trigger_activate+0xf2/0x130
                         led_trigger_set+0x578/0xbb0
                         led_trigger_set_default+0x1c5/0x220
                         led_classdev_register_ext+0x5cc/0x7e0
                         input_leds_connect+0x3fb/0x750
                         input_attach_handler.isra.0+0x178/0x1e0
                         input_register_device.cold+0xed/0x305
                         atkbd_connect+0x72b/0xa00
                         serio_driver_probe+0x6d/0x90
                         really_probe+0x291/0xdc0
                         driver_probe_device+0x269/0x3d0
                         device_driver_attach+0x228/0x290
                         __driver_attach+0x151/0x2e0
                         bus_for_each_dev+0x148/0x1d0
                         serio_handle_event+0x607/0x920
                         process_one_work+0x9a9/0x15d0
                         worker_thread+0x676/0x1170
                         kthread+0x3a0/0x490
                         ret_from_fork+0x1f/0x30
    }
    ... key      at: [<ffffffff8fa180c0>] __key.8+0x0/0x40
    ... acquired at:
   _raw_spin_lock+0x2a/0x40
   evdev_pass_values.part.0+0xac/0x950
   evdev_events+0x289/0x3e0
   input_to_handler+0x29e/0x4c0
   input_pass_values.part.0+0x284/0x740
   input_handle_event+0xd3f/0x14d0
   input_inject_event+0x212/0x310
   evdev_write+0x42f/0x730
   vfs_write+0x270/0x6f0
   ksys_write+0x1f2/0x250
   do_syscall_64+0x2d/0x70
   entry_SYSCALL_64_after_hwframe+0x44/0xa9

  -> (&client->buffer_lock){....}-{2:2} {
     INITIAL USE at:
                       lock_acquire+0x1a6/0x890
                       _raw_spin_lock+0x2a/0x40
                       evdev_pass_values.part.0+0xac/0x950
                       evdev_events+0x289/0x3e0
                       input_to_handler+0x29e/0x4c0
                       input_pass_values.part.0+0x284/0x740
                       input_handle_event+0xd3f/0x14d0
                       input_inject_event+0x212/0x310
                       evdev_write+0x42f/0x730
                       vfs_write+0x270/0x6f0
                       ksys_write+0x1f2/0x250
                       do_syscall_64+0x2d/0x70
                       entry_SYSCALL_64_after_hwframe+0x44/0xa9
   }
   ... key      at: [<ffffffff8fa185c0>] __key.4+0x0/0x40
   ... acquired at:
   _raw_read_lock+0x5b/0x70
   kill_fasync+0x14b/0x460
   evdev_pass_values.part.0+0x568/0x950
   evdev_events+0x289/0x3e0
   input_to_handler+0x29e/0x4c0
   input_pass_values.part.0+0x284/0x740
   input_handle_event+0xd3f/0x14d0
   input_inject_event+0x212/0x310
   evdev_write+0x42f/0x730
   vfs_write+0x270/0x6f0
   ksys_write+0x1f2/0x250
   do_syscall_64+0x2d/0x70
   entry_SYSCALL_64_after_hwframe+0x44/0xa9

 -> (&new->fa_lock){....}-{2:2} {
    INITIAL READ USE at:
                          lock_acquire+0x1a6/0x890
                          _raw_read_lock+0x5b/0x70
                          kill_fasync+0x14b/0x460
                          evdev_pass_values.part.0+0x568/0x950
                          evdev_events+0x289/0x3e0
                          input_to_handler+0x29e/0x4c0
                          input_pass_values.part.0+0x284/0x740
                          input_handle_event+0xd3f/0x14d0
                          input_inject_event+0x212/0x310
                          evdev_write+0x42f/0x730
                          vfs_write+0x270/0x6f0
                          ksys_write+0x1f2/0x250
                          do_syscall_64+0x2d/0x70
                          entry_SYSCALL_64_after_hwframe+0x44/0xa9
  }
  ... key      at: [<ffffffff8ef447e0>] __key.0+0x0/0x40
  ... acquired at:
   _raw_read_lock+0x5b/0x70
   send_sigio+0x24/0x370
   kill_fasync+0x205/0x460
   evdev_pass_values.part.0+0x568/0x950
   evdev_events+0x289/0x3e0
   input_to_handler+0x29e/0x4c0
   input_pass_values.part.0+0x284/0x740
   input_handle_event+0xd3f/0x14d0
   input_inject_event+0x212/0x310
   evdev_write+0x42f/0x730
   vfs_write+0x270/0x6f0
   ksys_write+0x1f2/0x250
   do_syscall_64+0x2d/0x70
   entry_SYSCALL_64_after_hwframe+0x44/0xa9

-> (&f->f_owner.lock){.+..}-{2:2} {
   HARDIRQ-ON-R at:
                    lock_acquire+0x1a6/0x890
                    _raw_read_lock+0x5b/0x70
                    send_sigio+0x24/0x370
                    dnotify_handle_event+0x147/0x280
                    fsnotify+0xc82/0x1420
                    do_iter_read+0x53d/0x6e0
                    vfs_readv+0xf0/0x160
                    __x64_sys_preadv+0x233/0x310
                    do_syscall_64+0x2d/0x70
                    entry_SYSCALL_64_after_hwframe+0x44/0xa9
   INITIAL USE at:
                   lock_acquire+0x1a6/0x890
                   _raw_write_lock_irq+0x32/0x50
                   f_modown+0x2a/0x390
                   fcntl_dirnotify+0x727/0xba0
                   do_fcntl+0x269/0x1060
                   __x64_sys_fcntl+0x177/0x1f0
                   do_syscall_64+0x2d/0x70
                   entry_SYSCALL_64_after_hwframe+0x44/0xa9
   INITIAL READ USE at:
                        lock_acquire+0x1a6/0x890
                        _raw_read_lock+0x5b/0x70
                        send_sigio+0x24/0x370
                        kill_fasync+0x205/0x460
                        evdev_pass_values.part.0+0x568/0x950
                        evdev_events+0x289/0x3e0
                        input_to_handler+0x29e/0x4c0
                        input_pass_values.part.0+0x284/0x740
                        input_handle_event+0xd3f/0x14d0
                        input_inject_event+0x212/0x310
                        evdev_write+0x42f/0x730
                        vfs_write+0x270/0x6f0
                        ksys_write+0x1f2/0x250
                        do_syscall_64+0x2d/0x70
                        entry_SYSCALL_64_after_hwframe+0x44/0xa9
 }
 ... key      at: [<ffffffff8ef43a00>] __key.5+0x0/0x40
 ... acquired at:
   __lock_acquire+0x94f/0x5eb0
   lock_acquire+0x1a6/0x890
   _raw_read_lock+0x5b/0x70
   send_sigio+0x24/0x370
   dnotify_handle_event+0x147/0x280
   fsnotify+0xc82/0x1420
   do_iter_read+0x53d/0x6e0
   vfs_readv+0xf0/0x160
   __x64_sys_preadv+0x233/0x310
   do_syscall_64+0x2d/0x70
   entry_SYSCALL_64_after_hwframe+0x44/0xa9


stack backtrace:
CPU: 0 PID: 5585 Comm: syz-executor.0 Not tainted 5.10.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 dump_stack+0x107/0x163
 mark_lock.cold+0xbb/0xc0
 __lock_acquire+0x94f/0x5eb0
 lock_acquire+0x1a6/0x890
 _raw_read_lock+0x5b/0x70
 send_sigio+0x24/0x370
 dnotify_handle_event+0x147/0x280
 fsnotify+0xc82/0x1420
 do_iter_read+0x53d/0x6e0
 vfs_readv+0xf0/0x160
 __x64_sys_preadv+0x233/0x310
 do_syscall_64+0x2d/0x70
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7ff10b52ef69
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 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 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff10a88e0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000127
RAX: ffffffffffffffda RBX: 00007ff10b65d050 RCX: 00007ff10b52ef69
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 00007ff10b57b4a4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007ff10b65d050 R15: 00007ffc0d67a058
