linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] [fs?] possible deadlock in input_inject_event
@ 2024-09-27 15:01 syzbot
  2024-11-27  8:41 ` syzbot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: syzbot @ 2024-09-27 15:01 UTC (permalink / raw)
  To: amir73il, jack, linux-fsdevel, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    2a17bb8c204f Merge tag 'devicetree-for-6.12' of git://git...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15953b00580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=c208b3605ba9ec44
dashboard link: https://syzkaller.appspot.com/bug?extid=79c403850e6816dc39cf
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/940305284b35/disk-2a17bb8c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7ae2e1a8e92e/vmlinux-2a17bb8c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/414282d3b1f3/bzImage-2a17bb8c.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+79c403850e6816dc39cf@syzkaller.appspotmail.com

=====================================================
WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
6.11.0-syzkaller-05591-g2a17bb8c204f #0 Not tainted
-----------------------------------------------------
syz.4.5212/19229 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffff88807f685da0 (&f_owner->lock){....}-{2:2}, at: send_sigio+0x37/0x390 fs/fcntl.c:910

and this task is already holding:
ffff88807f3b9750 (&new->fa_lock){...-}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1127 [inline]
ffff88807f3b9750 (&new->fa_lock){...-}-{2:2}, at: kill_fasync+0x199/0x4f0 fs/fcntl.c:1151
which would create a new lock dependency:
 (&new->fa_lock){...-}-{2:2} -> (&f_owner->lock){....}-{2:2}

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

... which became SOFTIRQ-irq-safe at:
  lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
  __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
  _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
  input_inject_event+0xc5/0x340 drivers/input/input.c:423
  kd_sound_helper+0x101/0x210 drivers/tty/vt/keyboard.c:256
  input_handler_for_each_handle+0x105/0x1d0 drivers/input/input.c:2676
  call_timer_fn+0x190/0x650 kernel/time/timer.c:1794
  expire_timers kernel/time/timer.c:1845 [inline]
  __run_timers kernel/time/timer.c:2419 [inline]
  __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2430
  run_timer_base kernel/time/timer.c:2439 [inline]
  run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2449
  handle_softirqs+0x2c7/0x980 kernel/softirq.c:554
  __do_softirq kernel/softirq.c:588 [inline]
  invoke_softirq kernel/softirq.c:428 [inline]
  __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
  irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
  instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline]
  sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1037
  asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
  __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
  _raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:202
  spin_unlock_irq include/linux/spinlock.h:401 [inline]
  filemap_remove_folio+0x110/0x2e0 mm/filemap.c:265
  truncate_inode_folio+0x5d/0x70 mm/truncate.c:178
  shmem_undo_range+0x45d/0x1df0 mm/shmem.c:1019
  shmem_truncate_range mm/shmem.c:1132 [inline]
  shmem_evict_inode+0x29b/0xa80 mm/shmem.c:1260
  evict+0x4ea/0x9b0 fs/inode.c:731
  __dentry_kill+0x20d/0x630 fs/dcache.c:615
  dput+0x19f/0x2b0 fs/dcache.c:857
  __fput+0x5d2/0x880 fs/file_table.c:439
  task_work_run+0x251/0x310 kernel/task_work.c:228
  resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
  exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
  exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
  __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
  syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218
  do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
  entry_SYSCALL_64_after_hwframe+0x77/0x7f

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

... which became SOFTIRQ-irq-unsafe at:
...
  lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
  __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
  _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
  __do_wait+0x12d/0x850 kernel/exit.c:1591
  do_wait+0x1e9/0x560 kernel/exit.c:1635
  kernel_wait+0xe9/0x240 kernel/exit.c:1811
  call_usermodehelper_exec_sync kernel/umh.c:137 [inline]
  call_usermodehelper_exec_work+0xbd/0x230 kernel/umh.c:164
  process_one_work kernel/workqueue.c:3229 [inline]
  process_scheduled_works+0xa65/0x1850 kernel/workqueue.c:3310
  worker_thread+0x870/0xd30 kernel/workqueue.c:3391
  kthread+0x2f2/0x390 kernel/kthread.c:389
  ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

other info that might help us debug this:

Chain exists of:
  &dev->event_lock#2 --> &new->fa_lock --> tasklist_lock

 Possible interrupt unsafe locking scenario:

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

 *** DEADLOCK ***

4 locks held by syz.4.5212/19229:
 #0: ffffffff8ea9b7f0 (file_rwsem){++++}-{0:0}, at: __break_lease+0x3b3/0x1820 fs/locks.c:1563
 #1: ffff8880266f4858 (&ctx->flc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #1: ffff8880266f4858 (&ctx->flc_lock){+.+.}-{2:2}, at: __break_lease+0x3c0/0x1820 fs/locks.c:1564
 #2: ffffffff8e938b60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #2: ffffffff8e938b60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #2: ffffffff8e938b60 (rcu_read_lock){....}-{1:2}, at: kill_fasync+0x54/0x4f0 fs/fcntl.c:1150
 #3: ffff88807f3b9750 (&new->fa_lock){...-}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1127 [inline]
 #3: ffff88807f3b9750 (&new->fa_lock){...-}-{2:2}, at: kill_fasync+0x199/0x4f0 fs/fcntl.c:1151

the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
 -> (&dev->event_lock#2){..-.}-{2:2} {
    IN-SOFTIRQ-W at:
                      lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                      __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                      _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
                      input_inject_event+0xc5/0x340 drivers/input/input.c:423
                      kd_sound_helper+0x101/0x210 drivers/tty/vt/keyboard.c:256
                      input_handler_for_each_handle+0x105/0x1d0 drivers/input/input.c:2676
                      call_timer_fn+0x190/0x650 kernel/time/timer.c:1794
                      expire_timers kernel/time/timer.c:1845 [inline]
                      __run_timers kernel/time/timer.c:2419 [inline]
                      __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2430
                      run_timer_base kernel/time/timer.c:2439 [inline]
                      run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2449
                      handle_softirqs+0x2c7/0x980 kernel/softirq.c:554
                      __do_softirq kernel/softirq.c:588 [inline]
                      invoke_softirq kernel/softirq.c:428 [inline]
                      __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
                      irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
                      instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline]
                      sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1037
                      asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
                      __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
                      _raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:202
                      spin_unlock_irq include/linux/spinlock.h:401 [inline]
                      filemap_remove_folio+0x110/0x2e0 mm/filemap.c:265
                      truncate_inode_folio+0x5d/0x70 mm/truncate.c:178
                      shmem_undo_range+0x45d/0x1df0 mm/shmem.c:1019
                      shmem_truncate_range mm/shmem.c:1132 [inline]
                      shmem_evict_inode+0x29b/0xa80 mm/shmem.c:1260
                      evict+0x4ea/0x9b0 fs/inode.c:731
                      __dentry_kill+0x20d/0x630 fs/dcache.c:615
                      dput+0x19f/0x2b0 fs/dcache.c:857
                      __fput+0x5d2/0x880 fs/file_table.c:439
                      task_work_run+0x251/0x310 kernel/task_work.c:228
                      resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
                      exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
                      exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
                      __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
                      syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218
                      do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
                      entry_SYSCALL_64_after_hwframe+0x77/0x7f
    INITIAL USE at:
                     lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                     __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                     _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
                     input_inject_event+0xc5/0x340 drivers/input/input.c:423
                     kbd_led_trigger_activate+0xb8/0x100 drivers/tty/vt/keyboard.c:1036
                     led_trigger_set+0x584/0x9c0 drivers/leds/led-triggers.c:212
                     led_match_default_trigger drivers/leds/led-triggers.c:269 [inline]
                     led_trigger_set_default+0x229/0x260 drivers/leds/led-triggers.c:287
                     led_classdev_register_ext+0x6e6/0x8a0 drivers/leds/led-class.c:555
                     led_classdev_register include/linux/leds.h:273 [inline]
                     input_leds_connect+0x489/0x630 drivers/input/input-leds.c:145
                     input_attach_handler drivers/input/input.c:1027 [inline]
                     input_register_device+0xd3d/0x1110 drivers/input/input.c:2470
                     atkbd_connect+0x752/0xa00 drivers/input/keyboard/atkbd.c:1342
                     serio_connect_driver drivers/input/serio/serio.c:44 [inline]
                     serio_driver_probe+0x81/0xa0 drivers/input/serio/serio.c:775
                     really_probe+0x2ba/0xad0 drivers/base/dd.c:657
                     __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:799
                     driver_probe_device+0x50/0x430 drivers/base/dd.c:829
                     __driver_attach+0x45f/0x710 drivers/base/dd.c:1215
                     bus_for_each_dev+0x23b/0x2b0 drivers/base/bus.c:368
                     serio_attach_driver drivers/input/serio/serio.c:804 [inline]
                     serio_handle_event+0x1c7/0x920 drivers/input/serio/serio.c:224
                     process_one_work kernel/workqueue.c:3229 [inline]
                     process_scheduled_works+0xa65/0x1850 kernel/workqueue.c:3310
                     worker_thread+0x870/0xd30 kernel/workqueue.c:3391
                     kthread+0x2f2/0x390 kernel/kthread.c:389
                     ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
                     ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
  }
  ... key      at: [<ffffffff9a71d6e0>] input_allocate_device.__key.5+0x0/0x20
-> (&new->fa_lock){...-}-{2:2} {
   IN-SOFTIRQ-R at:
                    lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                    __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                    _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
                    kill_fasync_rcu fs/fcntl.c:1127 [inline]
                    kill_fasync+0x199/0x4f0 fs/fcntl.c:1151
                    sock_wake_async+0x147/0x170
                    sk_wake_async_rcu include/net/sock.h:2450 [inline]
                    sock_def_readable+0x3df/0x5b0 net/core/sock.c:3444
                    __udp_enqueue_schedule_skb+0x81a/0xb20 net/ipv4/udp.c:1566
                    __udpv6_queue_rcv_skb net/ipv6/udp.c:658 [inline]
                    udpv6_queue_rcv_one_skb+0xa22/0x18a0 net/ipv6/udp.c:770
                    udp6_unicast_rcv_skb+0x230/0x370 net/ipv6/udp.c:928
                    ip6_protocol_deliver_rcu+0xccf/0x1580 net/ipv6/ip6_input.c:436
                    ip6_input_finish+0x187/0x2d0 net/ipv6/ip6_input.c:481
                    NF_HOOK+0x3a6/0x450 include/linux/netfilter.h:314
                    NF_HOOK+0x3a6/0x450 include/linux/netfilter.h:314
                    __netif_receive_skb_one_core net/core/dev.c:5662 [inline]
                    __netif_receive_skb+0x1ea/0x650 net/core/dev.c:5775
                    process_backlog+0x662/0x15b0 net/core/dev.c:6107
                    __napi_poll+0xcd/0x490 net/core/dev.c:6771
                    napi_poll net/core/dev.c:6840 [inline]
                    net_rx_action+0x89b/0x1240 net/core/dev.c:6962
                    handle_softirqs+0x2c7/0x980 kernel/softirq.c:554
                    do_softirq+0x11b/0x1e0 kernel/softirq.c:455
                    __local_bh_enable_ip+0x1bb/0x200 kernel/softirq.c:382
                    local_bh_enable include/linux/bottom_half.h:33 [inline]
                    rcu_read_unlock_bh include/linux/rcupdate.h:919 [inline]
                    __dev_queue_xmit+0x1764/0x3e80 net/core/dev.c:4451
                    dev_queue_xmit include/linux/netdevice.h:3094 [inline]
                    neigh_hh_output include/net/neighbour.h:526 [inline]
                    neigh_output include/net/neighbour.h:540 [inline]
                    ip6_finish_output2+0xfc9/0x1730 net/ipv6/ip6_output.c:141
                    ip6_finish_output+0x41e/0x810 net/ipv6/ip6_output.c:226
                    ip6_send_skb+0x1b1/0x3b0 net/ipv6/ip6_output.c:1968
                    udp_v6_send_skb+0xbf5/0x1870 net/ipv6/udp.c:1292
                    udpv6_sendmsg+0x23b6/0x3270 net/ipv6/udp.c:1588
                    sock_sendmsg_nosec net/socket.c:730 [inline]
                    __sock_sendmsg+0xef/0x270 net/socket.c:745
                    __sys_sendto+0x398/0x4f0 net/socket.c:2210
                    __do_sys_sendto net/socket.c:2222 [inline]
                    __se_sys_sendto net/socket.c:2218 [inline]
                    __x64_sys_sendto+0xde/0x100 net/socket.c:2218
                    do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                    do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
                    entry_SYSCALL_64_after_hwframe+0x77/0x7f
   INITIAL USE at:
                   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                   __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                   _raw_write_lock_irq+0xd3/0x120 kernel/locking/spinlock.c:326
                   fasync_remove_entry+0xff/0x1d0 fs/fcntl.c:1004
                   __fput+0x71d/0x880 fs/file_table.c:428
                   task_work_run+0x251/0x310 kernel/task_work.c:228
                   resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
                   exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
                   exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
                   __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
                   syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218
                   do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
                   entry_SYSCALL_64_after_hwframe+0x77/0x7f
   INITIAL READ USE at:
                        lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                        __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                        _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
                        kill_fasync_rcu fs/fcntl.c:1127 [inline]
                        kill_fasync+0x199/0x4f0 fs/fcntl.c:1151
                        mousedev_notify_readers+0x719/0xc80 drivers/input/mousedev.c:309
                        mousedev_event+0x5d9/0x1390 drivers/input/mousedev.c:394
                        input_handler_events_default+0x109/0x1c0 drivers/input/input.c:2549
                        input_pass_values+0x288/0x860 drivers/input/input.c:126
                        input_event_dispose+0x30f/0x600 drivers/input/input.c:341
                        input_handle_event+0xa71/0xbe0 drivers/input/input.c:369
                        input_inject_event+0x22f/0x340 drivers/input/input.c:428
                        evdev_write+0x66f/0x7c0 drivers/input/evdev.c:521
                        vfs_write+0x29e/0xc90 fs/read_write.c:681
                        ksys_write+0x1a0/0x2c0 fs/read_write.c:736
                        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                        do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
                        entry_SYSCALL_64_after_hwframe+0x77/0x7f
 }
 ... key      at: [<ffffffff9a40dcc0>] fasync_insert_entry.__key+0x0/0x20
 ... acquired at:
   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
   kill_fasync_rcu fs/fcntl.c:1127 [inline]
   kill_fasync+0x199/0x4f0 fs/fcntl.c:1151
   mousedev_notify_readers+0x719/0xc80 drivers/input/mousedev.c:309
   mousedev_event+0x5d9/0x1390 drivers/input/mousedev.c:394
   input_handler_events_default+0x109/0x1c0 drivers/input/input.c:2549
   input_pass_values+0x288/0x860 drivers/input/input.c:126
   input_event_dispose+0x30f/0x600 drivers/input/input.c:341
   input_handle_event+0xa71/0xbe0 drivers/input/input.c:369
   input_inject_event+0x22f/0x340 drivers/input/input.c:428
   evdev_write+0x66f/0x7c0 drivers/input/evdev.c:521
   vfs_write+0x29e/0xc90 fs/read_write.c:681
   ksys_write+0x1a0/0x2c0 fs/read_write.c:736
   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
   entry_SYSCALL_64_after_hwframe+0x77/0x7f


the dependencies between the lock to be acquired
 and SOFTIRQ-irq-unsafe lock:
 -> (tasklist_lock){.+.+}-{2:2} {
    HARDIRQ-ON-R at:
                      lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                      __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                      _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
                      __do_wait+0x12d/0x850 kernel/exit.c:1591
                      do_wait+0x1e9/0x560 kernel/exit.c:1635
                      kernel_wait+0xe9/0x240 kernel/exit.c:1811
                      call_usermodehelper_exec_sync kernel/umh.c:137 [inline]
                      call_usermodehelper_exec_work+0xbd/0x230 kernel/umh.c:164
                      process_one_work kernel/workqueue.c:3229 [inline]
                      process_scheduled_works+0xa65/0x1850 kernel/workqueue.c:3310
                      worker_thread+0x870/0xd30 kernel/workqueue.c:3391
                      kthread+0x2f2/0x390 kernel/kthread.c:389
                      ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
                      ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
    SOFTIRQ-ON-R at:
                      lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                      __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                      _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
                      __do_wait+0x12d/0x850 kernel/exit.c:1591
                      do_wait+0x1e9/0x560 kernel/exit.c:1635
                      kernel_wait+0xe9/0x240 kernel/exit.c:1811
                      call_usermodehelper_exec_sync kernel/umh.c:137 [inline]
                      call_usermodehelper_exec_work+0xbd/0x230 kernel/umh.c:164
                      process_one_work kernel/workqueue.c:3229 [inline]
                      process_scheduled_works+0xa65/0x1850 kernel/workqueue.c:3310
                      worker_thread+0x870/0xd30 kernel/workqueue.c:3391
                      kthread+0x2f2/0x390 kernel/kthread.c:389
                      ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
                      ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
    INITIAL USE at:
                     lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                     __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                     _raw_write_lock_irq+0xd3/0x120 kernel/locking/spinlock.c:326
                     copy_process+0x224b/0x3d80 kernel/fork.c:2499
                     kernel_clone+0x226/0x8f0 kernel/fork.c:2780
                     user_mode_thread+0x132/0x1a0 kernel/fork.c:2858
                     rest_init+0x23/0x300 init/main.c:712
                     start_kernel+0x47f/0x500 init/main.c:1105
                     x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:507
                     x86_64_start_kernel+0x9f/0xa0 arch/x86/kernel/head64.c:488
                     common_startup_64+0x13e/0x147
    INITIAL READ USE at:
                          lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                          __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                          _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
                          __do_wait+0x12d/0x850 kernel/exit.c:1591
                          do_wait+0x1e9/0x560 kernel/exit.c:1635
                          kernel_wait+0xe9/0x240 kernel/exit.c:1811
                          call_usermodehelper_exec_sync kernel/umh.c:137 [inline]
                          call_usermodehelper_exec_work+0xbd/0x230 kernel/umh.c:164
                          process_one_work kernel/workqueue.c:3229 [inline]
                          process_scheduled_works+0xa65/0x1850 kernel/workqueue.c:3310
                          worker_thread+0x870/0xd30 kernel/workqueue.c:3391
                          kthread+0x2f2/0x390 kernel/kthread.c:389
                          ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
                          ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
  }
  ... key      at: [<ffffffff8e60a058>] tasklist_lock+0x18/0x40
  ... acquired at:
   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
   __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
   _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
   send_sigio+0x108/0x390 fs/fcntl.c:924
   dnotify_handle_event+0x157/0x460 fs/notify/dnotify/dnotify.c:114
   fsnotify_handle_event fs/notify/fsnotify.c:347 [inline]
   send_to_group fs/notify/fsnotify.c:395 [inline]
   fsnotify+0x18ab/0x1f70 fs/notify/fsnotify.c:604
   fsnotify_parent include/linux/fsnotify.h:99 [inline]
   fsnotify_file include/linux/fsnotify.h:131 [inline]
   fsnotify_access include/linux/fsnotify.h:380 [inline]
   vfs_readv+0x921/0xa80 fs/read_write.c:1030
   do_preadv fs/read_write.c:1142 [inline]
   __do_sys_preadv fs/read_write.c:1192 [inline]
   __se_sys_preadv fs/read_write.c:1187 [inline]
   __x64_sys_preadv+0x1c7/0x2d0 fs/read_write.c:1187
   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
   entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> (&f_owner->lock){....}-{2:2} {
   INITIAL USE at:
                   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                   __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                   _raw_write_lock_irq+0xd3/0x120 kernel/locking/spinlock.c:326
                   __f_setown+0x6b/0x380 fs/fcntl.c:137
                   fcntl_dirnotify+0x459/0x5b0 fs/notify/dnotify/dnotify.c:372
                   do_fcntl+0x7e2/0x1a60 fs/fcntl.c:534
                   __do_sys_fcntl fs/fcntl.c:586 [inline]
                   __se_sys_fcntl+0xd2/0x1e0 fs/fcntl.c:571
                   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
                   entry_SYSCALL_64_after_hwframe+0x77/0x7f
   INITIAL READ USE at:
                        lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
                        __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                        _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
                        send_sigio+0x37/0x390 fs/fcntl.c:910
                        dnotify_handle_event+0x157/0x460 fs/notify/dnotify/dnotify.c:114
                        fsnotify_handle_event fs/notify/fsnotify.c:324 [inline]
                        send_to_group fs/notify/fsnotify.c:395 [inline]
                        fsnotify+0x1738/0x1f70 fs/notify/fsnotify.c:604
                        __fsnotify_parent+0x4f5/0x5e0 fs/notify/fsnotify.c:261
                        notify_change+0xc0c/0xe90 fs/attr.c:508
                        vfs_utimes+0x4b5/0x770 fs/utimes.c:66
                        do_utimes_fd fs/utimes.c:120 [inline]
                        do_utimes+0x162/0x270 fs/utimes.c:144
                        __do_sys_utimensat fs/utimes.c:164 [inline]
                        __se_sys_utimensat fs/utimes.c:148 [inline]
                        __x64_sys_utimensat+0x14f/0x250 fs/utimes.c:148
                        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                        do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
                        entry_SYSCALL_64_after_hwframe+0x77/0x7f
 }
 ... key      at: [<ffffffff9a40dca0>] file_f_owner_allocate.__key+0x0/0x20
 ... acquired at:
   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
   send_sigio+0x37/0x390 fs/fcntl.c:910
   kill_fasync_rcu fs/fcntl.c:1136 [inline]
   kill_fasync+0x256/0x4f0 fs/fcntl.c:1151
   lease_break_callback+0x26/0x30 fs/locks.c:558
   __break_lease+0x6d7/0x1820 fs/locks.c:1592
   break_lease include/linux/filelock.h:436 [inline]
   do_dentry_open+0x8d4/0x1460 fs/open.c:949
   vfs_open+0x3e/0x330 fs/open.c:1088
   do_open fs/namei.c:3774 [inline]
   path_openat+0x2c84/0x3590 fs/namei.c:3933
   do_filp_open+0x235/0x490 fs/namei.c:3960
   do_sys_openat2+0x13e/0x1d0 fs/open.c:1415
   do_sys_open fs/open.c:1430 [inline]
   __do_sys_open fs/open.c:1438 [inline]
   __se_sys_open fs/open.c:1434 [inline]
   __x64_sys_open+0x225/0x270 fs/open.c:1434
   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
   entry_SYSCALL_64_after_hwframe+0x77/0x7f


stack backtrace:
CPU: 1 UID: 0 PID: 19229 Comm: syz.4.5212 Not tainted 6.11.0-syzkaller-05591-g2a17bb8c204f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:93 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
 print_bad_irq_dependency kernel/locking/lockdep.c:2644 [inline]
 check_irq_usage kernel/locking/lockdep.c:2885 [inline]
 check_prev_add kernel/locking/lockdep.c:3162 [inline]
 check_prevs_add kernel/locking/lockdep.c:3277 [inline]
 validate_chain+0x4ebd/0x5920 kernel/locking/lockdep.c:3901
 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5199
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
 _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
 send_sigio+0x37/0x390 fs/fcntl.c:910
 kill_fasync_rcu fs/fcntl.c:1136 [inline]
 kill_fasync+0x256/0x4f0 fs/fcntl.c:1151
 lease_break_callback+0x26/0x30 fs/locks.c:558
 __break_lease+0x6d7/0x1820 fs/locks.c:1592
 break_lease include/linux/filelock.h:436 [inline]
 do_dentry_open+0x8d4/0x1460 fs/open.c:949
 vfs_open+0x3e/0x330 fs/open.c:1088
 do_open fs/namei.c:3774 [inline]
 path_openat+0x2c84/0x3590 fs/namei.c:3933
 do_filp_open+0x235/0x490 fs/namei.c:3960
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1415
 do_sys_open fs/open.c:1430 [inline]
 __do_sys_open fs/open.c:1438 [inline]
 __se_sys_open fs/open.c:1434 [inline]
 __x64_sys_open+0x225/0x270 fs/open.c:1434
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fec1c77def9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fec1d50f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00007fec1c935f80 RCX: 00007fec1c77def9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000540
RBP: 00007fec1c7f0b76 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fec1c935f80 R15: 00007fffa852a548
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [fs?] possible deadlock in input_inject_event
  2024-09-27 15:01 [syzbot] [fs?] possible deadlock in input_inject_event syzbot
@ 2024-11-27  8:41 ` syzbot
  2024-12-15  2:25 ` syzbot
  2025-05-24 20:38 ` syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2024-11-27  8:41 UTC (permalink / raw)
  To: alex.aring, amir73il, brauner, chuck.lever, jack, jlayton,
	linux-fsdevel, linux-kernel, syzkaller-bugs, viro

syzbot has found a reproducer for the following issue on:

HEAD commit:    7eef7e306d3c Merge tag 'for-6.13/dm-changes' of git://git...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17c07778580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8df9bf3383f5970
dashboard link: https://syzkaller.appspot.com/bug?extid=79c403850e6816dc39cf
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13bfd530580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ea7fc4bd274d/disk-7eef7e30.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2b75212b0174/vmlinux-7eef7e30.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f1ab50706485/bzImage-7eef7e30.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+79c403850e6816dc39cf@syzkaller.appspotmail.com

=====================================================
WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
6.12.0-syzkaller-09567-g7eef7e306d3c #0 Not tainted
-----------------------------------------------------
syz.0.15/6015 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffff88807770f018 (&new->fa_lock){....}-{3:3}, at: kill_fasync_rcu fs/fcntl.c:1121 [inline]
ffff88807770f018 (&new->fa_lock){....}-{3:3}, at: kill_fasync+0x199/0x4f0 fs/fcntl.c:1145

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

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

... which became SOFTIRQ-irq-safe at:
  lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
  __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
  _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
  input_inject_event+0xc5/0x340 drivers/input/input.c:423
  led_trigger_event+0x138/0x210 drivers/leds/led-triggers.c:407
  kbd_propagate_led_state drivers/tty/vt/keyboard.c:1080 [inline]
  kbd_bh+0x1b5/0x290 drivers/tty/vt/keyboard.c:1269
  tasklet_action_common+0x426/0x620 kernel/softirq.c:804
  handle_softirqs+0x2c5/0x980 kernel/softirq.c:554
  run_ksoftirqd+0xca/0x130 kernel/softirq.c:943
  smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164
  kthread+0x2f0/0x390 kernel/kthread.c:389
  ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

to a SOFTIRQ-irq-unsafe lock:
 (tasklist_lock){.+.+}-{3:3}

... which became SOFTIRQ-irq-unsafe at:
...
  lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
  __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
  _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
  __do_wait+0x12d/0x850 kernel/exit.c:1647
  do_wait+0x1e9/0x560 kernel/exit.c:1691
  kernel_wait+0xe9/0x240 kernel/exit.c:1867
  call_usermodehelper_exec_sync kernel/umh.c:136 [inline]
  call_usermodehelper_exec_work+0xbd/0x230 kernel/umh.c:163
  process_one_work kernel/workqueue.c:3229 [inline]
  process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
  worker_thread+0x870/0xd30 kernel/workqueue.c:3391
  kthread+0x2f0/0x390 kernel/kthread.c:389
  ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

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.0.15/6015:
 #0: ffff88802a001118 (&evdev->mutex){+.+.}-{4:4}, at: evdev_write+0x25e/0x790 drivers/input/evdev.c:511
 #1: ffff888020738230 (&dev->event_lock#2){..-.}-{3:3}, at: input_inject_event+0xc5/0x340 drivers/input/input.c:423
 #2: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #2: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #2: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: input_inject_event+0xd6/0x340 drivers/input/input.c:425
 #3: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #3: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #3: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: input_pass_values+0x8e/0x890 drivers/input/input.c:118
 #4: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #4: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #4: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: evdev_events+0x6f/0x300 drivers/input/evdev.c:298
 #5: ffff888032183028 (&client->buffer_lock){....}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #5: ffff888032183028 (&client->buffer_lock){....}-{3:3}, at: evdev_pass_values+0xf2/0xad0 drivers/input/evdev.c:261
 #6: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #6: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #6: ffffffff8e93c520 (rcu_read_lock){....}-{1:3}, at: kill_fasync+0x54/0x4f0 fs/fcntl.c:1144

the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
 -> (&dev->event_lock#2){..-.}-{3:3} {
    IN-SOFTIRQ-W at:
                      lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                      __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                      _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
                      input_inject_event+0xc5/0x340 drivers/input/input.c:423
                      led_trigger_event+0x138/0x210 drivers/leds/led-triggers.c:407
                      kbd_propagate_led_state drivers/tty/vt/keyboard.c:1080 [inline]
                      kbd_bh+0x1b5/0x290 drivers/tty/vt/keyboard.c:1269
                      tasklet_action_common+0x426/0x620 kernel/softirq.c:804
                      handle_softirqs+0x2c5/0x980 kernel/softirq.c:554
                      run_ksoftirqd+0xca/0x130 kernel/softirq.c:943
                      smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164
                      kthread+0x2f0/0x390 kernel/kthread.c:389
                      ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
                      ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
    INITIAL USE at:
                     lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                     __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                     _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
                     input_inject_event+0xc5/0x340 drivers/input/input.c:423
                     kbd_led_trigger_activate+0xb8/0x100 drivers/tty/vt/keyboard.c:1036
                     led_trigger_set+0x582/0x9c0 drivers/leds/led-triggers.c:212
                     led_match_default_trigger drivers/leds/led-triggers.c:269 [inline]
                     led_trigger_set_default+0x229/0x260 drivers/leds/led-triggers.c:287
                     led_classdev_register_ext+0x732/0x8e0 drivers/leds/led-class.c:566
                     led_classdev_register include/linux/leds.h:274 [inline]
                     input_leds_connect+0x489/0x630 drivers/input/input-leds.c:145
                     input_attach_handler drivers/input/input.c:1032 [inline]
                     input_register_device+0xd3b/0x1110 drivers/input/input.c:2475
                     atkbd_connect+0x762/0xa20 drivers/input/keyboard/atkbd.c:1340
                     serio_connect_driver drivers/input/serio/serio.c:43 [inline]
                     serio_driver_probe+0x7f/0xa0 drivers/input/serio/serio.c:747
                     really_probe+0x2b8/0xad0 drivers/base/dd.c:658
                     __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800
                     driver_probe_device+0x50/0x430 drivers/base/dd.c:830
                     __driver_attach+0x45f/0x710 drivers/base/dd.c:1216
                     bus_for_each_dev+0x239/0x2b0 drivers/base/bus.c:370
                     serio_attach_driver drivers/input/serio/serio.c:776 [inline]
                     serio_handle_event+0x1c7/0x920 drivers/input/serio/serio.c:213
                     process_one_work kernel/workqueue.c:3229 [inline]
                     process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
                     worker_thread+0x870/0xd30 kernel/workqueue.c:3391
                     kthread+0x2f0/0x390 kernel/kthread.c:389
                     ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
                     ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
  }
  ... key      at: [<ffffffff9a771300>] input_allocate_device.__key.5+0x0/0x20
-> (&client->buffer_lock){....}-{3:3} {
   INITIAL USE at:
                   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                   __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
                   _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154
                   spin_lock include/linux/spinlock.h:351 [inline]
                   evdev_pass_values+0xf2/0xad0 drivers/input/evdev.c:261
                   evdev_events+0x1c2/0x300 drivers/input/evdev.c:306
                   input_pass_values+0x268/0x890 drivers/input/input.c:126
                   input_event_dispose+0x30f/0x600 drivers/input/input.c:341
                   input_handle_event+0xa71/0xbe0 drivers/input/input.c:369
                   input_inject_event+0x22f/0x340 drivers/input/input.c:428
                   evdev_write+0x5fd/0x790 drivers/input/evdev.c:528
                   vfs_write+0x2a3/0xd30 fs/read_write.c:677
                   ksys_write+0x18f/0x2b0 fs/read_write.c:731
                   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
                   entry_SYSCALL_64_after_hwframe+0x77/0x7f
 }
 ... key      at: [<ffffffff9a7715a0>] evdev_open.__key.24+0x0/0x20
 ... acquired at:
   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
   __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
   _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154
   spin_lock include/linux/spinlock.h:351 [inline]
   evdev_pass_values+0xf2/0xad0 drivers/input/evdev.c:261
   evdev_events+0x1c2/0x300 drivers/input/evdev.c:306
   input_pass_values+0x268/0x890 drivers/input/input.c:126
   input_event_dispose+0x30f/0x600 drivers/input/input.c:341
   input_handle_event+0xa71/0xbe0 drivers/input/input.c:369
   input_inject_event+0x22f/0x340 drivers/input/input.c:428
   evdev_write+0x5fd/0x790 drivers/input/evdev.c:528
   vfs_write+0x2a3/0xd30 fs/read_write.c:677
   ksys_write+0x18f/0x2b0 fs/read_write.c:731
   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
   entry_SYSCALL_64_after_hwframe+0x77/0x7f


the dependencies between the lock to be acquired
 and SOFTIRQ-irq-unsafe lock:
  -> (tasklist_lock){.+.+}-{3:3} {
     HARDIRQ-ON-R at:
                        lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                        __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                        _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
                        __do_wait+0x12d/0x850 kernel/exit.c:1647
                        do_wait+0x1e9/0x560 kernel/exit.c:1691
                        kernel_wait+0xe9/0x240 kernel/exit.c:1867
                        call_usermodehelper_exec_sync kernel/umh.c:136 [inline]
                        call_usermodehelper_exec_work+0xbd/0x230 kernel/umh.c:163
                        process_one_work kernel/workqueue.c:3229 [inline]
                        process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
                        worker_thread+0x870/0xd30 kernel/workqueue.c:3391
                        kthread+0x2f0/0x390 kernel/kthread.c:389
                        ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
                        ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
     SOFTIRQ-ON-R at:
                        lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                        __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                        _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
                        __do_wait+0x12d/0x850 kernel/exit.c:1647
                        do_wait+0x1e9/0x560 kernel/exit.c:1691
                        kernel_wait+0xe9/0x240 kernel/exit.c:1867
                        call_usermodehelper_exec_sync kernel/umh.c:136 [inline]
                        call_usermodehelper_exec_work+0xbd/0x230 kernel/umh.c:163
                        process_one_work kernel/workqueue.c:3229 [inline]
                        process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
                        worker_thread+0x870/0xd30 kernel/workqueue.c:3391
                        kthread+0x2f0/0x390 kernel/kthread.c:389
                        ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
                        ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
     INITIAL USE at:
                       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                       __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                       _raw_write_lock_irq+0xd3/0x120 kernel/locking/spinlock.c:326
                       copy_process+0x2267/0x3d50 kernel/fork.c:2503
                       kernel_clone+0x223/0x880 kernel/fork.c:2787
                       user_mode_thread+0x132/0x1a0 kernel/fork.c:2865
                       rest_init+0x23/0x300 init/main.c:712
                       start_kernel+0x47f/0x500 init/main.c:1102
                       x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:507
                       x86_64_start_kernel+0x9f/0xa0 arch/x86/kernel/head64.c:488
                       common_startup_64+0x13e/0x147
     INITIAL READ USE at:
                            lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                            __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                            _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
                            __do_wait+0x12d/0x850 kernel/exit.c:1647
                            do_wait+0x1e9/0x560 kernel/exit.c:1691
                            kernel_wait+0xe9/0x240 kernel/exit.c:1867
                            call_usermodehelper_exec_sync kernel/umh.c:136 [inline]
                            call_usermodehelper_exec_work+0xbd/0x230 kernel/umh.c:163
                            process_one_work kernel/workqueue.c:3229 [inline]
                            process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
                            worker_thread+0x870/0xd30 kernel/workqueue.c:3391
                            kthread+0x2f0/0x390 kernel/kthread.c:389
                            ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
                            ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
   }
   ... key      at: [<ffffffff8e60b058>] tasklist_lock+0x18/0x40
   ... acquired at:
   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
   __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
   _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
   send_sigio+0x108/0x390 fs/fcntl.c:918
   kill_fasync_rcu fs/fcntl.c:1130 [inline]
   kill_fasync+0x256/0x4f0 fs/fcntl.c:1145
   lease_break_callback+0x26/0x30 fs/locks.c:558
   __break_lease+0x6d5/0x1820 fs/locks.c:1592
   vfs_truncate+0x26b/0x3b0 fs/open.c:105
   do_sys_truncate+0xdb/0x190 fs/open.c:134
   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
   entry_SYSCALL_64_after_hwframe+0x77/0x7f

 -> (&f_owner->lock){....}-{3:3} {
    INITIAL USE at:
                     lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                     __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                     _raw_write_lock_irq+0xd3/0x120 kernel/locking/spinlock.c:326
                     __f_setown+0x6b/0x380 fs/fcntl.c:136
                     generic_add_lease fs/locks.c:1874 [inline]
                     generic_setlease+0xc74/0x1550 fs/locks.c:1942
                     do_fcntl_add_lease fs/locks.c:2047 [inline]
                     fcntl_setlease+0x404/0x540 fs/locks.c:2069
                     do_fcntl+0x6c6/0x1a80 fs/fcntl.c:533
                     __do_sys_fcntl fs/fcntl.c:588 [inline]
                     __se_sys_fcntl+0xd2/0x1e0 fs/fcntl.c:573
                     do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                     do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
                     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    INITIAL READ USE at:
                          lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                          __raw_read_lock_irq include/linux/rwlock_api_smp.h:169 [inline]
                          _raw_read_lock_irq+0xda/0x120 kernel/locking/spinlock.c:244
                          f_getown+0x55/0x2a0 fs/fcntl.c:204
                          sock_ioctl+0x498/0x8e0 net/socket.c:1275
                          vfs_ioctl fs/ioctl.c:51 [inline]
                          __do_sys_ioctl fs/ioctl.c:906 [inline]
                          __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
                          do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                          do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
                          entry_SYSCALL_64_after_hwframe+0x77/0x7f
  }
  ... key      at: [<ffffffff9a461fc0>] file_f_owner_allocate.__key+0x0/0x20
  ... acquired at:
   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
   send_sigio+0x37/0x390 fs/fcntl.c:904
   kill_fasync_rcu fs/fcntl.c:1130 [inline]
   kill_fasync+0x256/0x4f0 fs/fcntl.c:1145
   lease_break_callback+0x26/0x30 fs/locks.c:558
   __break_lease+0x6d5/0x1820 fs/locks.c:1592
   vfs_truncate+0x26b/0x3b0 fs/open.c:105
   do_sys_truncate+0xdb/0x190 fs/open.c:134
   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
   entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> (&new->fa_lock){....}-{3:3} {
   INITIAL READ USE at:
                        lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
                        __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                        _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
                        kill_fasync_rcu fs/fcntl.c:1121 [inline]
                        kill_fasync+0x199/0x4f0 fs/fcntl.c:1145
                        lease_break_callback+0x26/0x30 fs/locks.c:558
                        __break_lease+0x6d5/0x1820 fs/locks.c:1592
                        vfs_truncate+0x26b/0x3b0 fs/open.c:105
                        do_sys_truncate+0xdb/0x190 fs/open.c:134
                        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
                        do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
                        entry_SYSCALL_64_after_hwframe+0x77/0x7f
 }
 ... key      at: [<ffffffff9a461fe0>] fasync_insert_entry.__key+0x0/0x20
 ... acquired at:
   lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
   kill_fasync_rcu fs/fcntl.c:1121 [inline]
   kill_fasync+0x199/0x4f0 fs/fcntl.c:1145
   __pass_event drivers/input/evdev.c:240 [inline]
   evdev_pass_values+0x58a/0xad0 drivers/input/evdev.c:278
   evdev_events+0x1c2/0x300 drivers/input/evdev.c:306
   input_pass_values+0x268/0x890 drivers/input/input.c:126
   input_event_dispose+0x30f/0x600 drivers/input/input.c:341
   input_handle_event+0xa71/0xbe0 drivers/input/input.c:369
   input_inject_event+0x22f/0x340 drivers/input/input.c:428
   evdev_write+0x5fd/0x790 drivers/input/evdev.c:528
   vfs_write+0x2a3/0xd30 fs/read_write.c:677
   ksys_write+0x18f/0x2b0 fs/read_write.c:731
   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
   entry_SYSCALL_64_after_hwframe+0x77/0x7f


stack backtrace:
CPU: 0 UID: 0 PID: 6015 Comm: syz.0.15 Not tainted 6.12.0-syzkaller-09567-g7eef7e306d3c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_bad_irq_dependency kernel/locking/lockdep.c:2647 [inline]
 check_irq_usage kernel/locking/lockdep.c:2888 [inline]
 check_prev_add kernel/locking/lockdep.c:3165 [inline]
 check_prevs_add kernel/locking/lockdep.c:3280 [inline]
 validate_chain+0x4ebd/0x5920 kernel/locking/lockdep.c:3904
 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
 _raw_read_lock_irqsave+0xdd/0x130 kernel/locking/spinlock.c:236
 kill_fasync_rcu fs/fcntl.c:1121 [inline]
 kill_fasync+0x199/0x4f0 fs/fcntl.c:1145
 __pass_event drivers/input/evdev.c:240 [inline]
 evdev_pass_values+0x58a/0xad0 drivers/input/evdev.c:278
 evdev_events+0x1c2/0x300 drivers/input/evdev.c:306
 input_pass_values+0x268/0x890 drivers/input/input.c:126
 input_event_dispose+0x30f/0x600 drivers/input/input.c:341
 input_handle_event+0xa71/0xbe0 drivers/input/input.c:369
 input_inject_event+0x22f/0x340 drivers/input/input.c:428
 evdev_write+0x5fd/0x790 drivers/input/evdev.c:528
 vfs_write+0x2a3/0xd30 fs/read_write.c:677
 ksys_write+0x18f/0x2b0 fs/read_write.c:731
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f773f380809
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f77401d2058 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f773f546080 RCX: 00007f773f380809
RDX: 0000000000001068 RSI: 0000000020000040 RDI: 0000000000000009
RBP: 00007f773f3f393e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f773f546080 R15: 00007ffc372f3228
 </TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [fs?] possible deadlock in input_inject_event
  2024-09-27 15:01 [syzbot] [fs?] possible deadlock in input_inject_event syzbot
  2024-11-27  8:41 ` syzbot
@ 2024-12-15  2:25 ` syzbot
  2025-05-24 20:38 ` syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2024-12-15  2:25 UTC (permalink / raw)
  To: alex.aring, amir73il, bfields, brauner, changlianzhi, chuck.lever,
	dmitry.torokhov, gregkh, jack, jlayton, linux-fsdevel,
	linux-kernel, syzkaller-bugs, viro

syzbot has bisected this issue to:

commit fb09d0ac07725b442b32dbf53f0ab0bea54804e9
Author: lianzhi chang <changlianzhi@uniontech.com>
Date:   Wed Dec 15 12:51:25 2021 +0000

    tty: Fix the keyboard led light display problem

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=12ad3cdf980000
start commit:   7eef7e306d3c Merge tag 'for-6.13/dm-changes' of git://git...
git tree:       upstream
final oops:     https://syzkaller.appspot.com/x/report.txt?x=11ad3cdf980000
console output: https://syzkaller.appspot.com/x/log.txt?x=16ad3cdf980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8df9bf3383f5970
dashboard link: https://syzkaller.appspot.com/bug?extid=79c403850e6816dc39cf
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13bfd530580000

Reported-by: syzbot+79c403850e6816dc39cf@syzkaller.appspotmail.com
Fixes: fb09d0ac0772 ("tty: Fix the keyboard led light display problem")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [fs?] possible deadlock in input_inject_event
  2024-09-27 15:01 [syzbot] [fs?] possible deadlock in input_inject_event syzbot
  2024-11-27  8:41 ` syzbot
  2024-12-15  2:25 ` syzbot
@ 2025-05-24 20:38 ` syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2025-05-24 20:38 UTC (permalink / raw)
  To: alex.aring, amir73il, bfields, brauner, changlianzhi, chuck.lever,
	dakr, dmitry.torokhov, gregkh, jack, jlayton, linux-fsdevel,
	linux-kernel, rafael, syzkaller-bugs, viro

syzbot has found a reproducer for the following issue on:

HEAD commit:    4856ebd99715 Merge tag 'drm-fixes-2025-05-24' of https://g..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11879ad4580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=9fd1c9848687d742
dashboard link: https://syzkaller.appspot.com/bug?extid=79c403850e6816dc39cf
compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=126515f4580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=177dc8e8580000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-4856ebd9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/01d4bdc03dd1/vmlinux-4856ebd9.xz
kernel image: https://storage.googleapis.com/syzbot-assets/be7030a85b77/bzImage-4856ebd9.xz

The issue was bisected to:

commit fb09d0ac07725b442b32dbf53f0ab0bea54804e9
Author: lianzhi chang <changlianzhi@uniontech.com>
Date:   Wed Dec 15 12:51:25 2021 +0000

    tty: Fix the keyboard led light display problem

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=12ad3cdf980000
final oops:     https://syzkaller.appspot.com/x/report.txt?x=11ad3cdf980000
console output: https://syzkaller.appspot.com/x/log.txt?x=16ad3cdf980000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+79c403850e6816dc39cf@syzkaller.appspotmail.com
Fixes: fb09d0ac0772 ("tty: Fix the keyboard led light display problem")

=====================================================
WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
6.15.0-rc7-syzkaller-00142-g4856ebd99715 #0 Not tainted
-----------------------------------------------------
syz-executor408/5394 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffff8880345bc558 (&new->fa_lock){....}-{3:3}, at: kill_fasync_rcu fs/fcntl.c:1124 [inline]
ffff8880345bc558 (&new->fa_lock){....}-{3:3}, at: kill_fasync+0x199/0x4d0 fs/fcntl.c:1148

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

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

... which became SOFTIRQ-irq-safe at:
  lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
  __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
  _raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162
  class_spinlock_irqsave_constructor include/linux/spinlock.h:585 [inline]
  input_inject_event+0xab/0x320 drivers/input/input.c:418
  led_trigger_event+0x138/0x210 drivers/leds/led-triggers.c:407
  kbd_propagate_led_state drivers/tty/vt/keyboard.c:1080 [inline]
  kbd_bh+0x1c6/0x2e0 drivers/tty/vt/keyboard.c:1269
  tasklet_action_common+0x36c/0x580 kernel/softirq.c:829
  handle_softirqs+0x286/0x870 kernel/softirq.c:579
  __do_softirq kernel/softirq.c:613 [inline]
  invoke_softirq kernel/softirq.c:453 [inline]
  __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680
  irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
  instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
  sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049
  asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
  __preempt_count_add arch/x86/include/asm/preempt.h:80 [inline]
  rcu_is_watching+0x10/0xb0 kernel/rcu/tree.c:735
  trace_lock_release include/trace/events/lock.h:69 [inline]
  lock_release+0x4b/0x3e0 kernel/locking/lockdep.c:5877
  rcu_lock_release include/linux/rcupdate.h:341 [inline]
  rcu_read_unlock include/linux/rcupdate.h:871 [inline]
  class_rcu_destructor include/linux/rcupdate.h:1155 [inline]
  unwind_next_frame+0x19a9/0x2390 arch/x86/kernel/unwind_orc.c:680
  arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25
  stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122
  kasan_save_stack mm/kasan/common.c:47 [inline]
  kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
  unpoison_slab_object mm/kasan/common.c:319 [inline]
  __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:345
  kasan_slab_alloc include/linux/kasan.h:250 [inline]
  slab_post_alloc_hook mm/slub.c:4147 [inline]
  slab_alloc_node mm/slub.c:4196 [inline]
  kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203
  lsm_inode_alloc security/security.c:755 [inline]
  security_inode_alloc+0x39/0x330 security/security.c:1697
  inode_init_always_gfp+0x9ed/0xdc0 fs/inode.c:306
  inode_init_always include/linux/fs.h:3226 [inline]
  alloc_inode+0x82/0x1b0 fs/inode.c:353
  new_inode+0x22/0x170 fs/inode.c:1145
  debugfs_get_inode fs/debugfs/inode.c:72 [inline]
  __debugfs_create_file+0x14d/0x4f0 fs/debugfs/inode.c:447
  debugfs_create_file_unsafe+0x3a/0x50 fs/debugfs/inode.c:523
  add_sta_files net/mac80211/debugfs_netdev.c:849 [inline]
  add_files net/mac80211/debugfs_netdev.c:958 [inline]
  ieee80211_debugfs_add_netdev net/mac80211/debugfs_netdev.c:1011 [inline]
  ieee80211_debugfs_recreate_netdev+0xca1/0x1460 net/mac80211/debugfs_netdev.c:1035
  ieee80211_if_add+0xc17/0x1390 net/mac80211/iface.c:2202
  ieee80211_register_hw+0x350d/0x4120 net/mac80211/main.c:1606
  mac80211_hwsim_new_radio+0x2f0e/0x5340 drivers/net/wireless/virtual/mac80211_hwsim.c:5559
  hwsim_new_radio_nl+0xea4/0x1b10 drivers/net/wireless/virtual/mac80211_hwsim.c:6243
  genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115
  genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
  genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210
  netlink_rcv_skb+0x21c/0x490 net/netlink/af_netlink.c:2534
  genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
  netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline]
  netlink_unicast+0x758/0x8d0 net/netlink/af_netlink.c:1339
  netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1883
  sock_sendmsg_nosec net/socket.c:712 [inline]
  __sock_sendmsg+0x219/0x270 net/socket.c:727
  __sys_sendto+0x3bd/0x520 net/socket.c:2180
  __do_sys_sendto net/socket.c:2187 [inline]
  __se_sys_sendto net/socket.c:2183 [inline]
  __x64_sys_sendto+0xde/0x100 net/socket.c:2183
  do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
  do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
  entry_SYSCALL_64_after_hwframe+0x77/0x7f

to a SOFTIRQ-irq-unsafe lock:
 (tasklist_lock){.+.+}-{3:3}

... which became SOFTIRQ-irq-unsafe at:
...
  lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
  __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
  _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
  __do_wait+0xde/0x740 kernel/exit.c:1662
  do_wait+0x1f8/0x520 kernel/exit.c:1706
  kernel_wait+0xab/0x170 kernel/exit.c:1882
  call_usermodehelper_exec_sync kernel/umh.c:136 [inline]
  call_usermodehelper_exec_work+0xbe/0x230 kernel/umh.c:163
  process_one_work kernel/workqueue.c:3238 [inline]
  process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319
  worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
  kthread+0x70e/0x8a0 kernel/kthread.c:464
  ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153
  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

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-executor408/5394:
 #0: ffff8880363a6118 (&evdev->mutex){+.+.}-{4:4}, at: evdev_write+0x1a1/0x480 drivers/input/evdev.c:511
 #1: ffff88801f34a230 (&dev->event_lock#2){..-.}-{3:3}, at: class_spinlock_irqsave_constructor include/linux/spinlock.h:585 [inline]
 #1: ffff88801f34a230 (&dev->event_lock#2){..-.}-{3:3}, at: input_inject_event+0xab/0x320 drivers/input/input.c:418
 #2: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #2: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #2: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: class_rcu_constructor include/linux/rcupdate.h:1155 [inline]
 #2: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: input_inject_event+0xbc/0x320 drivers/input/input.c:419
 #3: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #3: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #3: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: class_rcu_constructor include/linux/rcupdate.h:1155 [inline]
 #3: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: input_pass_values+0x8d/0x890 drivers/input/input.c:118
 #4: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #4: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #4: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: evdev_events+0x79/0x340 drivers/input/evdev.c:298
 #5: ffff88804359a028 (&client->buffer_lock){....}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #5: ffff88804359a028 (&client->buffer_lock){....}-{3:3}, at: evdev_pass_values+0xb9/0xbd0 drivers/input/evdev.c:261
 #6: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #6: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #6: ffffffff8df3dee0 (rcu_read_lock){....}-{1:3}, at: kill_fasync+0x53/0x4d0 fs/fcntl.c:1147

the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
 -> (&dev->event_lock#2){..-.}-{3:3} {
    IN-SOFTIRQ-W at:
                      lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                      __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                      _raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162
                      class_spinlock_irqsave_constructor include/linux/spinlock.h:585 [inline]
                      input_inject_event+0xab/0x320 drivers/input/input.c:418
                      led_trigger_event+0x138/0x210 drivers/leds/led-triggers.c:407
                      kbd_propagate_led_state drivers/tty/vt/keyboard.c:1080 [inline]
                      kbd_bh+0x1c6/0x2e0 drivers/tty/vt/keyboard.c:1269
                      tasklet_action_common+0x36c/0x580 kernel/softirq.c:829
                      handle_softirqs+0x286/0x870 kernel/softirq.c:579
                      __do_softirq kernel/softirq.c:613 [inline]
                      invoke_softirq kernel/softirq.c:453 [inline]
                      __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680
                      irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
                      instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
                      sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049
                      asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
                      __preempt_count_add arch/x86/include/asm/preempt.h:80 [inline]
                      rcu_is_watching+0x10/0xb0 kernel/rcu/tree.c:735
                      trace_lock_release include/trace/events/lock.h:69 [inline]
                      lock_release+0x4b/0x3e0 kernel/locking/lockdep.c:5877
                      rcu_lock_release include/linux/rcupdate.h:341 [inline]
                      rcu_read_unlock include/linux/rcupdate.h:871 [inline]
                      class_rcu_destructor include/linux/rcupdate.h:1155 [inline]
                      unwind_next_frame+0x19a9/0x2390 arch/x86/kernel/unwind_orc.c:680
                      arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25
                      stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122
                      kasan_save_stack mm/kasan/common.c:47 [inline]
                      kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
                      unpoison_slab_object mm/kasan/common.c:319 [inline]
                      __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:345
                      kasan_slab_alloc include/linux/kasan.h:250 [inline]
                      slab_post_alloc_hook mm/slub.c:4147 [inline]
                      slab_alloc_node mm/slub.c:4196 [inline]
                      kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203
                      lsm_inode_alloc security/security.c:755 [inline]
                      security_inode_alloc+0x39/0x330 security/security.c:1697
                      inode_init_always_gfp+0x9ed/0xdc0 fs/inode.c:306
                      inode_init_always include/linux/fs.h:3226 [inline]
                      alloc_inode+0x82/0x1b0 fs/inode.c:353
                      new_inode+0x22/0x170 fs/inode.c:1145
                      debugfs_get_inode fs/debugfs/inode.c:72 [inline]
                      __debugfs_create_file+0x14d/0x4f0 fs/debugfs/inode.c:447
                      debugfs_create_file_unsafe+0x3a/0x50 fs/debugfs/inode.c:523
                      add_sta_files net/mac80211/debugfs_netdev.c:849 [inline]
                      add_files net/mac80211/debugfs_netdev.c:958 [inline]
                      ieee80211_debugfs_add_netdev net/mac80211/debugfs_netdev.c:1011 [inline]
                      ieee80211_debugfs_recreate_netdev+0xca1/0x1460 net/mac80211/debugfs_netdev.c:1035
                      ieee80211_if_add+0xc17/0x1390 net/mac80211/iface.c:2202
                      ieee80211_register_hw+0x350d/0x4120 net/mac80211/main.c:1606
                      mac80211_hwsim_new_radio+0x2f0e/0x5340 drivers/net/wireless/virtual/mac80211_hwsim.c:5559
                      hwsim_new_radio_nl+0xea4/0x1b10 drivers/net/wireless/virtual/mac80211_hwsim.c:6243
                      genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115
                      genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
                      genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210
                      netlink_rcv_skb+0x21c/0x490 net/netlink/af_netlink.c:2534
                      genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
                      netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline]
                      netlink_unicast+0x758/0x8d0 net/netlink/af_netlink.c:1339
                      netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1883
                      sock_sendmsg_nosec net/socket.c:712 [inline]
                      __sock_sendmsg+0x219/0x270 net/socket.c:727
                      __sys_sendto+0x3bd/0x520 net/socket.c:2180
                      __do_sys_sendto net/socket.c:2187 [inline]
                      __se_sys_sendto net/socket.c:2183 [inline]
                      __x64_sys_sendto+0xde/0x100 net/socket.c:2183
                      do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
                      do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
                      entry_SYSCALL_64_after_hwframe+0x77/0x7f
    INITIAL USE at:
                     lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                     __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                     _raw_spin_lock_irqsave+0xa7/0xf0 kernel/locking/spinlock.c:162
                     class_spinlock_irqsave_constructor include/linux/spinlock.h:585 [inline]
                     input_inject_event+0xab/0x320 drivers/input/input.c:418
                     kbd_led_trigger_activate+0xbc/0x100 drivers/tty/vt/keyboard.c:1036
                     led_trigger_set+0x52d/0x950 drivers/leds/led-triggers.c:212
                     led_match_default_trigger drivers/leds/led-triggers.c:269 [inline]
                     led_trigger_set_default+0x215/0x250 drivers/leds/led-triggers.c:287
                     led_classdev_register_ext+0x73d/0x930 drivers/leds/led-class.c:566
                     led_classdev_register include/linux/leds.h:274 [inline]
                     input_leds_connect+0x517/0x790 drivers/input/input-leds.c:145
                     input_attach_handler drivers/input/input.c:993 [inline]
                     input_register_device+0xcee/0x10b0 drivers/input/input.c:2412
                     atkbd_connect+0x70e/0x9c0 drivers/input/keyboard/atkbd.c:1340
                     serio_connect_driver drivers/input/serio/serio.c:43 [inline]
                     serio_driver_probe+0x7f/0xa0 drivers/input/serio/serio.c:747
                     call_driver_probe drivers/base/dd.c:-1 [inline]
                     really_probe+0x26d/0x9a0 drivers/base/dd.c:657
                     __driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:799
                     driver_probe_device+0x4f/0x430 drivers/base/dd.c:829
                     __driver_attach+0x452/0x700 drivers/base/dd.c:1215
                     bus_for_each_dev+0x233/0x2b0 drivers/base/bus.c:370
                     serio_attach_driver drivers/input/serio/serio.c:776 [inline]
                     serio_handle_event+0x1a2/0x860 drivers/input/serio/serio.c:213
                     process_one_work kernel/workqueue.c:3238 [inline]
                     process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319
                     worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
                     kthread+0x70e/0x8a0 kernel/kthread.c:464
                     ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153
                     ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
  }
  ... key      at: [<ffffffff99b915c0>] input_allocate_device.__key.5+0x0/0x20
-> (&client->buffer_lock){....}-{3:3} {
   INITIAL USE at:
                   lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                   __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
                   _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154
                   spin_lock include/linux/spinlock.h:351 [inline]
                   evdev_pass_values+0xb9/0xbd0 drivers/input/evdev.c:261
                   evdev_events+0x1e6/0x340 drivers/input/evdev.c:306
                   input_pass_values+0x288/0x890 drivers/input/input.c:127
                   input_event_dispose+0x330/0x6b0 drivers/input/input.c:341
                   input_inject_event+0x1fe/0x320 drivers/input/input.c:423
                   evdev_write+0x2fc/0x480 drivers/input/evdev.c:528
                   vfs_write+0x27b/0xa90 fs/read_write.c:682
                   ksys_write+0x145/0x250 fs/read_write.c:736
                   do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
                   do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
                   entry_SYSCALL_64_after_hwframe+0x77/0x7f
 }
 ... key      at: [<ffffffff99b91860>] evdev_open.__key.25+0x0/0x20
 ... acquired at:
   lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
   __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
   _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154
   spin_lock include/linux/spinlock.h:351 [inline]
   evdev_pass_values+0xb9/0xbd0 drivers/input/evdev.c:261
   evdev_events+0x1e6/0x340 drivers/input/evdev.c:306
   input_pass_values+0x288/0x890 drivers/input/input.c:127
   input_event_dispose+0x330/0x6b0 drivers/input/input.c:341
   input_inject_event+0x1fe/0x320 drivers/input/input.c:423
   evdev_write+0x2fc/0x480 drivers/input/evdev.c:528
   vfs_write+0x27b/0xa90 fs/read_write.c:682
   ksys_write+0x145/0x250 fs/read_write.c:736
   do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
   do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
   entry_SYSCALL_64_after_hwframe+0x77/0x7f


the dependencies between the lock to be acquired
 and SOFTIRQ-irq-unsafe lock:
  -> (tasklist_lock){.+.+}-{3:3} {
     HARDIRQ-ON-R at:
                        lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                        __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                        _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
                        __do_wait+0xde/0x740 kernel/exit.c:1662
                        do_wait+0x1f8/0x520 kernel/exit.c:1706
                        kernel_wait+0xab/0x170 kernel/exit.c:1882
                        call_usermodehelper_exec_sync kernel/umh.c:136 [inline]
                        call_usermodehelper_exec_work+0xbe/0x230 kernel/umh.c:163
                        process_one_work kernel/workqueue.c:3238 [inline]
                        process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319
                        worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
                        kthread+0x70e/0x8a0 kernel/kthread.c:464
                        ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153
                        ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
     SOFTIRQ-ON-R at:
                        lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                        __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                        _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
                        __do_wait+0xde/0x740 kernel/exit.c:1662
                        do_wait+0x1f8/0x520 kernel/exit.c:1706
                        kernel_wait+0xab/0x170 kernel/exit.c:1882
                        call_usermodehelper_exec_sync kernel/umh.c:136 [inline]
                        call_usermodehelper_exec_work+0xbe/0x230 kernel/umh.c:163
                        process_one_work kernel/workqueue.c:3238 [inline]
                        process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319
                        worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
                        kthread+0x70e/0x8a0 kernel/kthread.c:464
                        ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153
                        ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
     INITIAL USE at:
                       lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                       __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                       _raw_write_lock_irq+0xa2/0xf0 kernel/locking/spinlock.c:326
                       copy_process+0x21d5/0x3b80 kernel/fork.c:2561
                       kernel_clone+0x21e/0x870 kernel/fork.c:2845
                       user_mode_thread+0xdd/0x140 kernel/fork.c:2923
                       rest_init+0x23/0x300 init/main.c:708
                       start_kernel+0x470/0x4f0 init/main.c:1099
                       x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:513
                       x86_64_start_kernel+0x66/0x70 arch/x86/kernel/head64.c:494
                       common_startup_64+0x13e/0x147
     INITIAL READ USE at:
                            lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                            __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                            _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
                            __do_wait+0xde/0x740 kernel/exit.c:1662
                            do_wait+0x1f8/0x520 kernel/exit.c:1706
                            kernel_wait+0xab/0x170 kernel/exit.c:1882
                            call_usermodehelper_exec_sync kernel/umh.c:136 [inline]
                            call_usermodehelper_exec_work+0xbe/0x230 kernel/umh.c:163
                            process_one_work kernel/workqueue.c:3238 [inline]
                            process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319
                            worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
                            kthread+0x70e/0x8a0 kernel/kthread.c:464
                            ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153
                            ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
   }
   ... key      at: [<ffffffff8dc0c058>] tasklist_lock+0x18/0x40
   ... acquired at:
   lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
   __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
   _raw_read_lock+0x36/0x50 kernel/locking/spinlock.c:228
   send_sigio+0x101/0x370 fs/fcntl.c:921
   kill_fasync_rcu fs/fcntl.c:1133 [inline]
   kill_fasync+0x24d/0x4d0 fs/fcntl.c:1148
   lease_break_callback+0x26/0x30 fs/locks.c:558
   __break_lease+0x6a5/0x1620 fs/locks.c:1592
   vfs_truncate+0x428/0x520 fs/open.c:109
   do_sys_truncate+0xdb/0x190 fs/open.c:138
   __do_sys_truncate fs/open.c:150 [inline]
   __se_sys_truncate fs/open.c:148 [inline]
   __x64_sys_truncate+0x5b/0x70 fs/open.c:148
   do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
   do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
   entry_SYSCALL_64_after_hwframe+0x77/0x7f

 -> (&f_owner->lock){....}-{3:3} {
    INITIAL USE at:
                     lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                     __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                     _raw_write_lock_irq+0xa2/0xf0 kernel/locking/spinlock.c:326
                     __f_setown+0x67/0x370 fs/fcntl.c:136
                     generic_add_lease fs/locks.c:1874 [inline]
                     generic_setlease+0xd5d/0x1240 fs/locks.c:1942
                     do_fcntl_add_lease fs/locks.c:2047 [inline]
                     fcntl_setlease+0x3a2/0x4c0 fs/locks.c:2069
                     do_fcntl+0x6a0/0x1910 fs/fcntl.c:536
                     __do_sys_fcntl fs/fcntl.c:591 [inline]
                     __se_sys_fcntl+0xc8/0x150 fs/fcntl.c:576
                     do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
                     do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
                     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    INITIAL READ USE at:
                          lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                          __raw_read_lock_irq include/linux/rwlock_api_smp.h:169 [inline]
                          _raw_read_lock_irq+0xaa/0xf0 kernel/locking/spinlock.c:244
                          f_getown+0x54/0x2a0 fs/fcntl.c:204
                          sock_ioctl+0x536/0x790 net/socket.c:1256
                          vfs_ioctl fs/ioctl.c:51 [inline]
                          __do_sys_ioctl fs/ioctl.c:906 [inline]
                          __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:892
                          do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
                          do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
                          entry_SYSCALL_64_after_hwframe+0x77/0x7f
  }
  ... key      at: [<ffffffff99882d00>] file_f_owner_allocate.__key+0x0/0x20
  ... acquired at:
   lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0xaf/0x100 kernel/locking/spinlock.c:236
   send_sigio+0x38/0x370 fs/fcntl.c:907
   kill_fasync_rcu fs/fcntl.c:1133 [inline]
   kill_fasync+0x24d/0x4d0 fs/fcntl.c:1148
   lease_break_callback+0x26/0x30 fs/locks.c:558
   __break_lease+0x6a5/0x1620 fs/locks.c:1592
   vfs_truncate+0x428/0x520 fs/open.c:109
   do_sys_truncate+0xdb/0x190 fs/open.c:138
   __do_sys_truncate fs/open.c:150 [inline]
   __se_sys_truncate fs/open.c:148 [inline]
   __x64_sys_truncate+0x5b/0x70 fs/open.c:148
   do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
   do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
   entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> (&new->fa_lock){....}-{3:3} {
   INITIAL USE at:
                   lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                   __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                   _raw_write_lock_irq+0xa2/0xf0 kernel/locking/spinlock.c:326
                   fasync_remove_entry+0xf1/0x1c0 fs/fcntl.c:1001
                   lease_modify+0x1ca/0x3c0 fs/locks.c:1455
                   locks_remove_lease fs/locks.c:2675 [inline]
                   locks_remove_file+0x4bf/0xea0 fs/locks.c:2700
                   __fput+0x3ab/0xa70 fs/file_table.c:457
                   task_work_run+0x1d1/0x260 kernel/task_work.c:227
                   exit_task_work include/linux/task_work.h:40 [inline]
                   do_exit+0x8d6/0x2550 kernel/exit.c:953
                   do_group_exit+0x21c/0x2d0 kernel/exit.c:1102
                   get_signal+0x125e/0x1310 kernel/signal.c:3034
                   arch_do_signal_or_restart+0x95/0x780 arch/x86/kernel/signal.c:337
                   exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
                   exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
                   __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
                   syscall_exit_to_user_mode+0x8b/0x120 kernel/entry/common.c:218
                   do_syscall_64+0x103/0x210 arch/x86/entry/syscall_64.c:100
                   entry_SYSCALL_64_after_hwframe+0x77/0x7f
   INITIAL READ USE at:
                        lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
                        __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                        _raw_read_lock_irqsave+0xaf/0x100 kernel/locking/spinlock.c:236
                        kill_fasync_rcu fs/fcntl.c:1124 [inline]
                        kill_fasync+0x199/0x4d0 fs/fcntl.c:1148
                        lease_break_callback+0x26/0x30 fs/locks.c:558
                        __break_lease+0x6a5/0x1620 fs/locks.c:1592
                        vfs_truncate+0x428/0x520 fs/open.c:109
                        do_sys_truncate+0xdb/0x190 fs/open.c:138
                        __do_sys_truncate fs/open.c:150 [inline]
                        __se_sys_truncate fs/open.c:148 [inline]
                        __x64_sys_truncate+0x5b/0x70 fs/open.c:148
                        do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
                        do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
                        entry_SYSCALL_64_after_hwframe+0x77/0x7f
 }
 ... key      at: [<ffffffff99882d20>] fasync_insert_entry.__key+0x0/0x20
 ... acquired at:
   lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0xaf/0x100 kernel/locking/spinlock.c:236
   kill_fasync_rcu fs/fcntl.c:1124 [inline]
   kill_fasync+0x199/0x4d0 fs/fcntl.c:1148
   __pass_event drivers/input/evdev.c:240 [inline]
   evdev_pass_values+0x627/0xbd0 drivers/input/evdev.c:278
   evdev_events+0x1e6/0x340 drivers/input/evdev.c:306
   input_pass_values+0x288/0x890 drivers/input/input.c:127
   input_event_dispose+0x330/0x6b0 drivers/input/input.c:341
   input_inject_event+0x1fe/0x320 drivers/input/input.c:423
   evdev_write+0x2fc/0x480 drivers/input/evdev.c:528
   vfs_write+0x27b/0xa90 fs/read_write.c:682
   ksys_write+0x145/0x250 fs/read_write.c:736
   do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
   do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
   entry_SYSCALL_64_after_hwframe+0x77/0x7f


stack backtrace:
CPU: 0 UID: 0 PID: 5394 Comm: syz-executor408 Not tainted 6.15.0-rc7-syzkaller-00142-g4856ebd99715 #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_bad_irq_dependency kernel/locking/lockdep.c:2652 [inline]
 check_irq_usage kernel/locking/lockdep.c:2893 [inline]
 check_prev_add kernel/locking/lockdep.c:3170 [inline]
 check_prevs_add kernel/locking/lockdep.c:3285 [inline]
 validate_chain+0x1f05/0x2140 kernel/locking/lockdep.c:3909
 __lock_acquire+0xaac/0xd20 kernel/locking/lockdep.c:5235
 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866
 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
 _raw_read_lock_irqsave+0xaf/0x100 kernel/locking/spinlock.c:236
 kill_fasync_rcu fs/fcntl.c:1124 [inline]
 kill_fasync+0x199/0x4d0 fs/fcntl.c:1148
 __pass_event drivers/input/evdev.c:240 [inline]
 evdev_pass_values+0x627/0xbd0 drivers/input/evdev.c:278
 evdev_events+0x1e6/0x340 drivers/input/evdev.c:306
 input_pass_values+0x288/0x890 drivers/input/input.c:127
 input_event_dispose+0x330/0x6b0 drivers/input/input.c:341
 input_inject_event+0x1fe/0x320 drivers/input/input.c:423
 evdev_write+0x2fc/0x480 drivers/input/evdev.c:528
 vfs_write+0x27b/0xa90 fs/read_write.c:682
 ksys_write+0x145/0x250 fs/read_write.c:736
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f666844d4f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 1d 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:00007f66683f9218 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f66684cd428 RCX: 00007f666844d4f9
RDX: 0000000000001068 RSI: 0000200000000040 RDI: 0000000000000008
RBP: 00007f66684cd420 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f666849a548
R13: 0000200000000040 R14: 00002000000001c0 R15: 00002000000000c0
 </TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-24 20:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 15:01 [syzbot] [fs?] possible deadlock in input_inject_event syzbot
2024-11-27  8:41 ` syzbot
2024-12-15  2:25 ` syzbot
2025-05-24 20:38 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).