syzbot


possible deadlock in input_event (2)

Status: upstream: reported C repro on 2021/11/10 17:01
Reported-by: syzbot+d4c06e848a1c1f9f726f@syzkaller.appspotmail.com
First crash: 325d, last: 1d12h

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: possible deadlock in input_event (log)
Repro: C syz .config
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in input_event C done 2740 325d 629d 0/24 closed as dup on 2021/07/07 07:31

Sample crash report:
=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
6.0.0-rc5-syzkaller-00097-g38eddeedbbea #0 Not tainted
-----------------------------------------------------
syz-executor179/3605 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffff8880748a70c0 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:996 [inline]
ffff8880748a70c0 (&new->fa_lock){....}-{2:2}, at: kill_fasync fs/fcntl.c:1017 [inline]
ffff8880748a70c0 (&new->fa_lock){....}-{2:2}, at: kill_fasync+0x136/0x470 fs/fcntl.c:1010

and this task is already holding:
ffff8880179ff028 (&client->buffer_lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
ffff8880179ff028 (&client->buffer_lock){....}-{2:2}, at: evdev_pass_values.part.0+0xf6/0x960 drivers/input/evdev.c:261
which would create a new lock dependency:
 (&client->buffer_lock){....}-{2:2} -> (&new->fa_lock){....}-{2:2}

but this new dependency connects a HARDIRQ-irq-safe lock:
 (&dev->event_lock#2){-...}-{2:2}

... which became HARDIRQ-irq-safe at:
  lock_acquire kernel/locking/lockdep.c:5666 [inline]
  lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
  __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
  _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162
  input_event drivers/input/input.c:430 [inline]
  input_event+0x6c/0xa0 drivers/input/input.c:423
  input_report_key include/linux/input.h:425 [inline]
  psmouse_report_standard_buttons+0x2c/0x80 drivers/input/mouse/psmouse-base.c:123
  psmouse_report_standard_packet drivers/input/mouse/psmouse-base.c:141 [inline]
  psmouse_process_byte+0x1e1/0x890 drivers/input/mouse/psmouse-base.c:232
  psmouse_handle_byte+0x41/0x1b0 drivers/input/mouse/psmouse-base.c:274
  psmouse_interrupt+0x304/0xf00 drivers/input/mouse/psmouse-base.c:426
  serio_interrupt+0x88/0x150 drivers/input/serio/serio.c:1001
  i8042_interrupt+0x27a/0x520 drivers/input/serio/i8042.c:606
  __handle_irq_event_percpu+0x227/0x870 kernel/irq/handle.c:158
  handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
  handle_irq_event+0xa7/0x1e0 kernel/irq/handle.c:210
  handle_edge_irq+0x25f/0xd00 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+0x9d/0x210 arch/x86/kernel/irq.c:250
  common_interrupt+0xa4/0xc0 arch/x86/kernel/irq.c:240
  asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:640
  __sanitizer_cov_trace_pc+0xd/0x60 kernel/kcov.c:196
  stack_not_used include/linux/sched/task_stack.h:105 [inline]
  check_stack_usage kernel/exit.c:719 [inline]
  do_exit+0x180c/0x29b0 kernel/exit.c:839
  call_usermodehelper_exec_async+0x418/0x580 kernel/umh.c:125
  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

to a HARDIRQ-irq-unsafe lock:
 (tasklist_lock){.+.+}-{2:2}

... which became HARDIRQ-irq-unsafe at:
...
  lock_acquire kernel/locking/lockdep.c:5666 [inline]
  lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
  __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
  _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:228
  do_wait+0x27f/0xce0 kernel/exit.c:1508
  kernel_wait+0x9c/0x150 kernel/exit.c:1698
  call_usermodehelper_exec_sync kernel/umh.c:139 [inline]
  call_usermodehelper_exec_work+0xf5/0x180 kernel/umh.c:166
  process_one_work+0x991/0x1610 kernel/workqueue.c:2289
  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
  kthread+0x2e4/0x3a0 kernel/kthread.c:376
  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

other info that might help us debug this:

Chain exists of:
  &dev->event_lock#2 --> &client->buffer_lock --> tasklist_lock

 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(tasklist_lock);
                               local_irq_disable();
                               lock(&dev->event_lock#2);
                               lock(&client->buffer_lock);
  <Interrupt>
    lock(&dev->event_lock#2);

 *** DEADLOCK ***

7 locks held by syz-executor179/3605:
 #0: ffff888147f3a110 (&evdev->mutex){+.+.}-{3:3}, at: evdev_write+0x1d3/0x760 drivers/input/evdev.c:513
 #1: ffff88801b40f230 (&dev->event_lock#2){-...}-{2:2}, at: input_inject_event+0x9b/0x320 drivers/input/input.c:456
 #2: ffffffff8bf89400 (rcu_read_lock){....}-{1:2}, at: is_event_supported drivers/input/input.c:65 [inline]
 #2: ffffffff8bf89400 (rcu_read_lock){....}-{1:2}, at: is_event_supported drivers/input/input.c:62 [inline]
 #2: ffffffff8bf89400 (rcu_read_lock){....}-{1:2}, at: input_inject_event+0x87/0x320 drivers/input/input.c:455
 #3: ffffffff8bf89400 (rcu_read_lock){....}-{1:2}, at: input_pass_values.part.0+0x0/0x710 drivers/input/input.c:858
 #4: ffffffff8bf89400 (rcu_read_lock){....}-{1:2}, at: evdev_events+0x59/0x3e0 drivers/input/evdev.c:296
 #5: ffff8880179ff028 (&client->buffer_lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
 #5: ffff8880179ff028 (&client->buffer_lock){....}-{2:2}, at: evdev_pass_values.part.0+0xf6/0x960 drivers/input/evdev.c:261
 #6: ffffffff8bf89400 (rcu_read_lock){....}-{1:2}, at: kill_fasync+0x41/0x470 fs/fcntl.c:1015

the dependencies between HARDIRQ-irq-safe lock and the holding lock:
 -> (&dev->event_lock#2){-...}-{2:2} {
    IN-HARDIRQ-W at:
                      lock_acquire kernel/locking/lockdep.c:5666 [inline]
                      lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                      __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                      _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162
                      input_event drivers/input/input.c:430 [inline]
                      input_event+0x6c/0xa0 drivers/input/input.c:423
                      input_report_key include/linux/input.h:425 [inline]
                      psmouse_report_standard_buttons+0x2c/0x80 drivers/input/mouse/psmouse-base.c:123
                      psmouse_report_standard_packet drivers/input/mouse/psmouse-base.c:141 [inline]
                      psmouse_process_byte+0x1e1/0x890 drivers/input/mouse/psmouse-base.c:232
                      psmouse_handle_byte+0x41/0x1b0 drivers/input/mouse/psmouse-base.c:274
                      psmouse_interrupt+0x304/0xf00 drivers/input/mouse/psmouse-base.c:426
                      serio_interrupt+0x88/0x150 drivers/input/serio/serio.c:1001
                      i8042_interrupt+0x27a/0x520 drivers/input/serio/i8042.c:606
                      __handle_irq_event_percpu+0x227/0x870 kernel/irq/handle.c:158
                      handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
                      handle_irq_event+0xa7/0x1e0 kernel/irq/handle.c:210
                      handle_edge_irq+0x25f/0xd00 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+0x9d/0x210 arch/x86/kernel/irq.c:250
                      common_interrupt+0xa4/0xc0 arch/x86/kernel/irq.c:240
                      asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:640
                      __sanitizer_cov_trace_pc+0xd/0x60 kernel/kcov.c:196
                      stack_not_used include/linux/sched/task_stack.h:105 [inline]
                      check_stack_usage kernel/exit.c:719 [inline]
                      do_exit+0x180c/0x29b0 kernel/exit.c:839
                      call_usermodehelper_exec_async+0x418/0x580 kernel/umh.c:125
                      ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
    INITIAL USE at:
                     lock_acquire kernel/locking/lockdep.c:5666 [inline]
                     lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                     __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                     _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162
                     input_inject_event+0x9b/0x320 drivers/input/input.c:456
                     __led_set_brightness drivers/leds/led-core.c:47 [inline]
                     led_set_brightness_nopm drivers/leds/led-core.c:271 [inline]
                     led_set_brightness_nosleep+0xe6/0x1a0 drivers/leds/led-core.c:287
                     led_set_brightness+0x134/0x170 drivers/leds/led-core.c:264
                     led_trigger_event drivers/leds/led-triggers.c:390 [inline]
                     led_trigger_event+0xb0/0x200 drivers/leds/led-triggers.c:380
                     kbd_led_trigger_activate+0xc9/0x100 drivers/tty/vt/keyboard.c:1036
                     led_trigger_set+0x5d7/0xaf0 drivers/leds/led-triggers.c:197
                     led_trigger_set_default drivers/leds/led-triggers.c:262 [inline]
                     led_trigger_set_default+0x1a6/0x230 drivers/leds/led-triggers.c:249
                     led_classdev_register_ext+0x56f/0x760 drivers/leds/led-class.c:415
                     led_classdev_register include/linux/leds.h:196 [inline]
                     input_leds_connect+0x4bd/0x860 drivers/input/input-leds.c:139
                     input_attach_handler+0x180/0x1f0 drivers/input/input.c:1060
                     input_register_device.cold+0xf0/0x2ff drivers/input/input.c:2396
                     atkbd_connect+0x749/0xa10 drivers/input/keyboard/atkbd.c:1282
                     serio_connect_driver drivers/input/serio/serio.c:47 [inline]
                     serio_driver_probe+0x72/0xa0 drivers/input/serio/serio.c:778
                     call_driver_probe drivers/base/dd.c:560 [inline]
                     really_probe+0x249/0xb90 drivers/base/dd.c:639
                     __driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:778
                     driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:808
                     __driver_attach+0x1d0/0x550 drivers/base/dd.c:1190
                     bus_for_each_dev+0x147/0x1d0 drivers/base/bus.c:301
                     serio_attach_driver drivers/input/serio/serio.c:807 [inline]
                     serio_handle_event+0x5f6/0xa30 drivers/input/serio/serio.c:227
                     process_one_work+0x991/0x1610 kernel/workqueue.c:2289
                     worker_thread+0x665/0x1080 kernel/workqueue.c:2436
                     kthread+0x2e4/0x3a0 kernel/kthread.c:376
                     ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
  }
  ... key      at: [<ffffffff914cc2e0>] __key.7+0x0/0x40
-> (&client->buffer_lock){....}-{2:2} {
   INITIAL USE at:
                   lock_acquire kernel/locking/lockdep.c:5666 [inline]
                   lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                   __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
                   _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
                   spin_lock include/linux/spinlock.h:349 [inline]
                   evdev_pass_values.part.0+0xf6/0x960 drivers/input/evdev.c:261
                   evdev_pass_values drivers/input/evdev.c:253 [inline]
                   evdev_events+0x359/0x3e0 drivers/input/evdev.c:306
                   input_to_handler+0x2a0/0x4c0 drivers/input/input.c:127
                   input_pass_values.part.0+0x230/0x710 drivers/input/input.c:159
                   input_pass_values drivers/input/input.c:146 [inline]
                   input_event_dispose+0x5cf/0x730 drivers/input/input.c:374
                   input_handle_event+0x112/0xda0 drivers/input/input.c:402
                   input_inject_event+0x1c4/0x320 drivers/input/input.c:461
                   evdev_write+0x430/0x760 drivers/input/evdev.c:530
                   vfs_write+0x2d7/0xdd0 fs/read_write.c:576
                   ksys_write+0x1e8/0x250 fs/read_write.c:631
                   do_syscall_x64 arch/x86/entry/common.c:50 [inline]
                   do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
                   entry_SYSCALL_64_after_hwframe+0x63/0xcd
 }
 ... key      at: [<ffffffff914cc760>] __key.3+0x0/0x40
 ... acquired at:
   __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
   _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
   spin_lock include/linux/spinlock.h:349 [inline]
   evdev_pass_values.part.0+0xf6/0x960 drivers/input/evdev.c:261
   evdev_pass_values drivers/input/evdev.c:253 [inline]
   evdev_events+0x359/0x3e0 drivers/input/evdev.c:306
   input_to_handler+0x2a0/0x4c0 drivers/input/input.c:127
   input_pass_values.part.0+0x230/0x710 drivers/input/input.c:159
   input_pass_values drivers/input/input.c:146 [inline]
   input_event_dispose+0x5cf/0x730 drivers/input/input.c:374
   input_handle_event+0x112/0xda0 drivers/input/input.c:402
   input_inject_event+0x1c4/0x320 drivers/input/input.c:461
   evdev_write+0x430/0x760 drivers/input/evdev.c:530
   vfs_write+0x2d7/0xdd0 fs/read_write.c:576
   ksys_write+0x1e8/0x250 fs/read_write.c:631
   do_syscall_x64 arch/x86/entry/common.c:50 [inline]
   do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
   entry_SYSCALL_64_after_hwframe+0x63/0xcd


the dependencies between the lock to be acquired
 and HARDIRQ-irq-unsafe lock:
  -> (tasklist_lock){.+.+}-{2:2} {
     HARDIRQ-ON-R at:
                        lock_acquire kernel/locking/lockdep.c:5666 [inline]
                        lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                        __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                        _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:228
                        do_wait+0x27f/0xce0 kernel/exit.c:1508
                        kernel_wait+0x9c/0x150 kernel/exit.c:1698
                        call_usermodehelper_exec_sync kernel/umh.c:139 [inline]
                        call_usermodehelper_exec_work+0xf5/0x180 kernel/umh.c:166
                        process_one_work+0x991/0x1610 kernel/workqueue.c:2289
                        worker_thread+0x665/0x1080 kernel/workqueue.c:2436
                        kthread+0x2e4/0x3a0 kernel/kthread.c:376
                        ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
     SOFTIRQ-ON-R at:
                        lock_acquire kernel/locking/lockdep.c:5666 [inline]
                        lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                        __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                        _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:228
                        do_wait+0x27f/0xce0 kernel/exit.c:1508
                        kernel_wait+0x9c/0x150 kernel/exit.c:1698
                        call_usermodehelper_exec_sync kernel/umh.c:139 [inline]
                        call_usermodehelper_exec_work+0xf5/0x180 kernel/umh.c:166
                        process_one_work+0x991/0x1610 kernel/workqueue.c:2289
                        worker_thread+0x665/0x1080 kernel/workqueue.c:2436
                        kthread+0x2e4/0x3a0 kernel/kthread.c:376
                        ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
     INITIAL USE at:
                       lock_acquire kernel/locking/lockdep.c:5666 [inline]
                       lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                       __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                       _raw_write_lock_irq+0x32/0x50 kernel/locking/spinlock.c:326
                       copy_process+0x449b/0x7090 kernel/fork.c:2391
                       kernel_clone+0xe7/0xab0 kernel/fork.c:2674
                       user_mode_thread+0xad/0xe0 kernel/fork.c:2743
                       rest_init+0x23/0x270 init/main.c:692
                       arch_call_rest_init+0xf/0x14 init/main.c:883
                       start_kernel+0x46e/0x48f init/main.c:1138
                       secondary_startup_64_no_verify+0xce/0xdb
     INITIAL READ USE at:
                            lock_acquire kernel/locking/lockdep.c:5666 [inline]
                            lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                            __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                            _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:228
                            do_wait+0x27f/0xce0 kernel/exit.c:1508
                            kernel_wait+0x9c/0x150 kernel/exit.c:1698
                            call_usermodehelper_exec_sync kernel/umh.c:139 [inline]
                            call_usermodehelper_exec_work+0xf5/0x180 kernel/umh.c:166
                            process_one_work+0x991/0x1610 kernel/workqueue.c:2289
                            worker_thread+0x665/0x1080 kernel/workqueue.c:2436
                            kthread+0x2e4/0x3a0 kernel/kthread.c:376
                            ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
   }
   ... key      at: [<ffffffff8bc0a098>] tasklist_lock+0x18/0x40
   ... acquired at:
   __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
   _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:228
   send_sigio+0xab/0x370 fs/fcntl.c:792
   kill_fasync_rcu fs/fcntl.c:1003 [inline]
   kill_fasync fs/fcntl.c:1017 [inline]
   kill_fasync+0x1f8/0x470 fs/fcntl.c:1010
   sock_wake_async+0xd2/0x160 net/socket.c:1419
   sk_wake_async include/net/sock.h:2499 [inline]
   sk_wake_async include/net/sock.h:2495 [inline]
   sock_def_readable+0x349/0x4e0 net/core/sock.c:3223
   unix_dgram_sendmsg+0xf88/0x1b50 net/unix/af_unix.c:2045
   sock_sendmsg_nosec net/socket.c:714 [inline]
   sock_sendmsg+0xcf/0x120 net/socket.c:734
   ____sys_sendmsg+0x334/0x810 net/socket.c:2482
   ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
   __sys_sendmmsg+0x18b/0x460 net/socket.c:2622
   __do_sys_sendmmsg net/socket.c:2651 [inline]
   __se_sys_sendmmsg net/socket.c:2648 [inline]
   __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2648
   do_syscall_x64 arch/x86/entry/common.c:50 [inline]
   do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
   entry_SYSCALL_64_after_hwframe+0x63/0xcd

 -> (&f->f_owner.lock){....}-{2:2} {
    INITIAL USE at:
                     lock_acquire kernel/locking/lockdep.c:5666 [inline]
                     lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                     __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                     _raw_write_lock_irq+0x32/0x50 kernel/locking/spinlock.c:326
                     f_modown+0x2a/0x390 fs/fcntl.c:91
                     __f_setown fs/fcntl.c:110 [inline]
                     f_setown+0xd7/0x230 fs/fcntl.c:138
                     sock_ioctl+0x37e/0x640 net/socket.c:1229
                     vfs_ioctl fs/ioctl.c:51 [inline]
                     __do_sys_ioctl fs/ioctl.c:870 [inline]
                     __se_sys_ioctl fs/ioctl.c:856 [inline]
                     __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
                     do_syscall_x64 arch/x86/entry/common.c:50 [inline]
                     do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
                     entry_SYSCALL_64_after_hwframe+0x63/0xcd
    INITIAL READ USE at:
                          lock_acquire kernel/locking/lockdep.c:5666 [inline]
                          lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                          __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                          _raw_read_lock_irqsave+0x70/0x90 kernel/locking/spinlock.c:236
                          send_sigio+0x24/0x370 fs/fcntl.c:778
                          kill_fasync_rcu fs/fcntl.c:1003 [inline]
                          kill_fasync fs/fcntl.c:1017 [inline]
                          kill_fasync+0x1f8/0x470 fs/fcntl.c:1010
                          sock_wake_async+0xd2/0x160 net/socket.c:1419
                          sk_wake_async include/net/sock.h:2499 [inline]
                          sk_wake_async include/net/sock.h:2495 [inline]
                          sock_def_readable+0x349/0x4e0 net/core/sock.c:3223
                          unix_dgram_sendmsg+0xf88/0x1b50 net/unix/af_unix.c:2045
                          sock_sendmsg_nosec net/socket.c:714 [inline]
                          sock_sendmsg+0xcf/0x120 net/socket.c:734
                          ____sys_sendmsg+0x334/0x810 net/socket.c:2482
                          ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
                          __sys_sendmmsg+0x18b/0x460 net/socket.c:2622
                          __do_sys_sendmmsg net/socket.c:2651 [inline]
                          __se_sys_sendmmsg net/socket.c:2648 [inline]
                          __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2648
                          do_syscall_x64 arch/x86/entry/common.c:50 [inline]
                          do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
                          entry_SYSCALL_64_after_hwframe+0x63/0xcd
  }
  ... key      at: [<ffffffff91229ae0>] __key.5+0x0/0x40
  ... acquired at:
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0x70/0x90 kernel/locking/spinlock.c:236
   send_sigio+0x24/0x370 fs/fcntl.c:778
   kill_fasync_rcu fs/fcntl.c:1003 [inline]
   kill_fasync fs/fcntl.c:1017 [inline]
   kill_fasync+0x1f8/0x470 fs/fcntl.c:1010
   sock_wake_async+0xd2/0x160 net/socket.c:1419
   sk_wake_async include/net/sock.h:2499 [inline]
   sk_wake_async include/net/sock.h:2495 [inline]
   sock_def_readable+0x349/0x4e0 net/core/sock.c:3223
   unix_dgram_sendmsg+0xf88/0x1b50 net/unix/af_unix.c:2045
   sock_sendmsg_nosec net/socket.c:714 [inline]
   sock_sendmsg+0xcf/0x120 net/socket.c:734
   ____sys_sendmsg+0x334/0x810 net/socket.c:2482
   ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
   __sys_sendmmsg+0x18b/0x460 net/socket.c:2622
   __do_sys_sendmmsg net/socket.c:2651 [inline]
   __se_sys_sendmmsg net/socket.c:2648 [inline]
   __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2648
   do_syscall_x64 arch/x86/entry/common.c:50 [inline]
   do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
   entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> (&new->fa_lock){....}-{2:2} {
   INITIAL READ USE at:
                        lock_acquire kernel/locking/lockdep.c:5666 [inline]
                        lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
                        __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                        _raw_read_lock_irqsave+0x70/0x90 kernel/locking/spinlock.c:236
                        kill_fasync_rcu fs/fcntl.c:996 [inline]
                        kill_fasync fs/fcntl.c:1017 [inline]
                        kill_fasync+0x136/0x470 fs/fcntl.c:1010
                        sock_wake_async+0xd2/0x160 net/socket.c:1419
                        sk_wake_async include/net/sock.h:2499 [inline]
                        sk_wake_async include/net/sock.h:2495 [inline]
                        sock_def_readable+0x349/0x4e0 net/core/sock.c:3223
                        unix_dgram_sendmsg+0xf88/0x1b50 net/unix/af_unix.c:2045
                        sock_sendmsg_nosec net/socket.c:714 [inline]
                        sock_sendmsg+0xcf/0x120 net/socket.c:734
                        ____sys_sendmsg+0x334/0x810 net/socket.c:2482
                        ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
                        __sys_sendmmsg+0x18b/0x460 net/socket.c:2622
                        __do_sys_sendmmsg net/socket.c:2651 [inline]
                        __se_sys_sendmmsg net/socket.c:2648 [inline]
                        __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2648
                        do_syscall_x64 arch/x86/entry/common.c:50 [inline]
                        do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
                        entry_SYSCALL_64_after_hwframe+0x63/0xcd
 }
 ... key      at: [<ffffffff9122a8c0>] __key.0+0x0/0x40
 ... acquired at:
   lock_acquire kernel/locking/lockdep.c:5666 [inline]
   lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0x70/0x90 kernel/locking/spinlock.c:236
   kill_fasync_rcu fs/fcntl.c:996 [inline]
   kill_fasync fs/fcntl.c:1017 [inline]
   kill_fasync+0x136/0x470 fs/fcntl.c:1010
   __pass_event drivers/input/evdev.c:240 [inline]
   evdev_pass_values.part.0+0x667/0x960 drivers/input/evdev.c:278
   evdev_pass_values drivers/input/evdev.c:253 [inline]
   evdev_events+0x359/0x3e0 drivers/input/evdev.c:306
   input_to_handler+0x2a0/0x4c0 drivers/input/input.c:127
   input_pass_values.part.0+0x230/0x710 drivers/input/input.c:159
   input_pass_values drivers/input/input.c:146 [inline]
   input_event_dispose+0x5cf/0x730 drivers/input/input.c:374
   input_handle_event+0x112/0xda0 drivers/input/input.c:402
   input_inject_event+0x1c4/0x320 drivers/input/input.c:461
   evdev_write+0x430/0x760 drivers/input/evdev.c:530
   vfs_write+0x2d7/0xdd0 fs/read_write.c:576
   ksys_write+0x1e8/0x250 fs/read_write.c:631
   do_syscall_x64 arch/x86/entry/common.c:50 [inline]
   do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
   entry_SYSCALL_64_after_hwframe+0x63/0xcd


stack backtrace:
CPU: 1 PID: 3605 Comm: syz-executor179 Not tainted 6.0.0-rc5-syzkaller-00097-g38eddeedbbea #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_bad_irq_dependency kernel/locking/lockdep.c:2609 [inline]
 check_irq_usage.cold+0x4c1/0x6b0 kernel/locking/lockdep.c:2848
 check_prev_add kernel/locking/lockdep.c:3099 [inline]
 check_prevs_add kernel/locking/lockdep.c:3214 [inline]
 validate_chain kernel/locking/lockdep.c:3829 [inline]
 __lock_acquire+0x2a5b/0x56d0 kernel/locking/lockdep.c:5053
 lock_acquire kernel/locking/lockdep.c:5666 [inline]
 lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631
 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
 _raw_read_lock_irqsave+0x70/0x90 kernel/locking/spinlock.c:236
 kill_fasync_rcu fs/fcntl.c:996 [inline]
 kill_fasync fs/fcntl.c:1017 [inline]
 kill_fasync+0x136/0x470 fs/fcntl.c:1010
 __pass_event drivers/input/evdev.c:240 [inline]
 evdev_pass_values.part.0+0x667/0x960 drivers/input/evdev.c:278
 evdev_pass_values drivers/input/evdev.c:253 [inline]
 evdev_events+0x359/0x3e0 drivers/input/evdev.c:306
 input_to_handler+0x2a0/0x4c0 drivers/input/input.c:127
 input_pass_values.part.0+0x230/0x710 drivers/input/input.c:159
 input_pass_values drivers/input/input.c:146 [inline]
 input_event_dispose+0x5cf/0x730 drivers/input/input.c:374
 input_handle_event+0x112/0xda0 drivers/input/input.c:402
 input_inject_event+0x1c4/0x320 drivers/input/input.c:461
 evdev_write+0x430/0x760 drivers/input/evdev.c:530
 vfs_write+0x2d7/0xdd0 fs/read_write.c:576
 ksys_write+0x1e8/0x250 fs/read_write.c:631
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fc48f633829
Code: 28 c3 e8 2a 14 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:00007fff857777d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc48f633829
RDX: 0000000000000079 RSI: 000000002004d000 RDI: 0000000000000006

Crashes (934):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/09/19 04:11 upstream 38eddeedbbea dd9a85ff .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/19 03:16 upstream 38eddeedbbea dd9a85ff .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-smack-root 2022/09/19 02:45 upstream 38eddeedbbea dd9a85ff .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-smack-root 2022/09/07 23:30 upstream 0066f1b0e275 c5b7bc57 .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/08/18 16:02 upstream 274a2eebf80c d58e263f .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/08/11 05:36 upstream 200e340f2196 a6201f11 .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/08/04 08:15 upstream 200e340f2196 1c9013ac .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce 2022/08/04 02:29 upstream 200e340f2196 1c9013ac .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/07/14 17:11 upstream 4a57a8400075 5d921b08 .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce 2022/07/14 06:21 upstream 4a57a8400075 5d921b08 .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-selinux-root 2022/07/12 23:29 upstream 72a8e05d4f66 d91dd8ea .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce 2022/07/01 20:53 upstream a175eca0f3d7 1434eec0 .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-selinux-root 2022/06/15 11:43 upstream 018ab4fabddd 127d1faf .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-smack-root 2022/04/27 07:23 upstream cf424ef014ac 1fa34c1b .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce-root 2021/12/13 02:41 upstream 90d9fbc16b69 49ca1f59 .config log report syz C possible deadlock in input_event
ci-upstream-linux-next-kasan-gce-root 2022/04/24 13:37 linux-next f1244c81da13 131df97d .config log report syz C possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/26 10:21 upstream f76349cf4145 d59ba983 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/21 22:07 upstream 06f7db949993 380f82fb .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-selinux-root 2022/09/20 19:15 upstream 60891ec99e14 7c41a9ba .config log report info possible deadlock in input_event
ci-qemu-upstream 2022/09/20 11:29 upstream 521a547ced64 7c41a9ba .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/20 07:46 upstream 521a547ced64 7c41a9ba .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-selinux-root 2022/09/19 08:51 upstream 521a547ced64 dd9a85ff .config log report info possible deadlock in input_event
ci-qemu-upstream 2022/09/18 17:51 upstream 38eddeedbbea dd9a85ff .config log report info possible deadlock in input_event
ci-qemu-upstream 2022/09/16 16:36 upstream 6879c2d3b960 dd9a85ff .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/09/14 11:33 upstream 3245cb65fd91 b884348d .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/09/14 00:54 upstream d1221cea11fc b884348d .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/12 16:54 upstream 80e78fcce86d f371ed7e .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/09/12 11:32 upstream 80e78fcce86d 356d8217 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/09/11 21:17 upstream 4ed9c1e971b1 356d8217 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/10 04:14 upstream ce888220d5c7 356d8217 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/09/08 13:59 upstream 26b1224903b3 f3027468 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-root 2022/09/08 12:43 upstream 0066f1b0e275 f3027468 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-selinux-root 2022/09/07 17:05 upstream 0066f1b0e275 c5b7bc57 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/07 01:52 upstream d2ec799d1c1b 5fc30c37 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/05 11:34 upstream 7e18e42e4b28 922294ab .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/05 09:48 upstream 7e18e42e4b28 922294ab .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/05 07:50 upstream 7e18e42e4b28 28811d0a .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/03 17:25 upstream d895ec7938c4 28811d0a .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/03 04:22 upstream 0b3acd1cc022 49e94a20 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/03 03:11 upstream 0b3acd1cc022 49e94a20 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/02 22:26 upstream 0b3acd1cc022 25194605 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce 2022/09/02 20:54 upstream 0b3acd1cc022 25194605 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/29 19:45 upstream 511cce163b75 1d385642 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/28 13:16 upstream 49c13ed0316d e2556bc3 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/27 13:33 upstream a1375562c0a8 87840e00 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/26 07:53 upstream f76349cf4145 d59ba983 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/24 07:07 upstream a63f2e7cb110 0042f2b4 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/19 11:57 upstream 521a547ced64 dd9a85ff .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/19 07:23 upstream 521a547ced64 dd9a85ff .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/18 23:15 upstream 38eddeedbbea dd9a85ff .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/17 06:10 upstream a335366bad13 dd9a85ff .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/16 14:16 upstream 3245cb65fd91 dd9a85ff .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/15 10:21 upstream 3245cb65fd91 dd9a85ff .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/12 00:39 upstream 4ed9c1e971b1 356d8217 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/10 06:04 upstream ce888220d5c7 356d8217 .config log report info possible deadlock in input_event
ci-qemu-upstream-386 2022/09/08 18:29 upstream 26b1224903b3 f3027468 .config log report info possible deadlock in input_event
ci-qemu-upstream-386 2022/09/08 02:28 upstream 0066f1b0e275 435aeef7 .config log report info possible deadlock in input_event
ci-qemu-upstream-386 2022/09/08 01:16 upstream 0066f1b0e275 435aeef7 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/07 14:49 upstream 0066f1b0e275 c5b7bc57 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/06 14:59 upstream 53e99dcff61e 65aea2b9 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/03 22:10 upstream 42cf58c272ee 28811d0a .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/03 00:54 upstream 0b3acd1cc022 25194605 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/02 17:43 upstream 42e66b1cc3a0 25194605 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2022/09/02 15:19 upstream 42e66b1cc3a0 25194605 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2021/11/10 12:51 upstream cb690f5238d7 75b04091 .config log report info possible deadlock in input_event
ci-upstream-kasan-gce-386 2021/11/10 04:33 upstream cb690f5238d7 55fa030c .config log report info possible deadlock in input_event
ci-upstream-linux-next-kasan-gce-root 2022/08/19 06:50 linux-next 8755ae45a9e8 26a13b38 .config log report info possible deadlock in input_event
* Struck through repros no longer work on HEAD.