syzbot


possible deadlock in evdev_pass_values (3)

Status: upstream: reported on 2024/03/28 21:07
Reported-by: syzbot+24b102734939bf00567f@syzkaller.appspotmail.com
First crash: 50d, last: 15d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in evdev_pass_values fuse kernfs 351 402d 1225d 0/26 closed as dup on 2021/07/02 09:55
linux-6.1 possible deadlock in evdev_pass_values 1 321d 321d 0/3 auto-obsoleted due to no activity on 2023/10/09 19:52
linux-5.15 possible deadlock in evdev_pass_values 6 199d 302d 0/3 auto-obsoleted due to no activity on 2024/02/09 07:09
upstream possible deadlock in evdev_pass_values (2) input 607 8h26m 393d 0/26 upstream: reported on 2023/04/21 09:42
linux-5.15 possible deadlock in evdev_pass_values (2) 22 17d 94d 0/3 upstream: reported on 2024/02/13 17:30
linux-6.1 possible deadlock in evdev_pass_values (2) 1 182d 182d 0/3 auto-obsoleted due to no activity on 2024/02/25 22:49

Sample crash report:
=====================================================
WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
6.1.90-syzkaller #0 Not tainted
-----------------------------------------------------
syz-executor.4/7924 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
ffffffff8ce0a058 (tasklist_lock){.+.+}-{2:2}, at: send_sigio+0xf8/0x360 fs/fcntl.c:790

and this task is already holding:
ffff8880764ff530 (&f->f_owner.lock){...-}-{2:2}, at: send_sigio+0x2f/0x360 fs/fcntl.c:776
which would create a new lock dependency:
 (&f->f_owner.lock){...-}-{2:2} -> (tasklist_lock){.+.+}-{2:2}

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

... which became SOFTIRQ-irq-safe at:
  lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
  __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:351 [inline]
  evdev_pass_values+0xee/0xad0 drivers/input/evdev.c:261
  evdev_events+0x1be/0x2f0 drivers/input/evdev.c:306
  input_to_handler drivers/input/input.c:127 [inline]
  input_pass_values+0x8e0/0x12a0 drivers/input/input.c:159
  input_event_dispose+0x3fc/0x650 drivers/input/input.c:385
  input_handle_event+0x97d/0xb00 drivers/input/input.c:402
  input_event+0xa0/0xd0 drivers/input/input.c:431
  hidinput_hid_event+0x13de/0x1d30 drivers/hid/hid-input.c:1706
  hid_process_event+0x433/0x580 drivers/hid/hid-core.c:1544
  hid_process_report drivers/hid/hid-core.c:1692 [inline]
  hid_report_raw_event+0xfd5/0x17e0 drivers/hid/hid-core.c:2019
  hid_input_report+0x420/0x4e0 drivers/hid/hid-core.c:2087
  hid_irq_in+0x45c/0x690 drivers/hid/usbhid/hid-core.c:284
  __usb_hcd_giveback_urb+0x371/0x530 drivers/usb/core/hcd.c:1675
  dummy_timer+0x8ad/0x3200 drivers/usb/gadget/udc/dummy_hcd.c:1988
  call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504
  expire_timers kernel/time/timer.c:1549 [inline]
  __run_timers+0x67c/0x890 kernel/time/timer.c:1820
  run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833
  __do_softirq+0x2e9/0xa4c kernel/softirq.c:571
  invoke_softirq kernel/softirq.c:445 [inline]
  __irq_exit_rcu+0x155/0x240 kernel/softirq.c:650
  irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
  sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106
  asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653
  lock_acquire+0x26f/0x5a0 kernel/locking/lockdep.c:5666
  rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
  rcu_read_lock include/linux/rcupdate.h:791 [inline]
  is_bpf_text_address+0x3e/0x2a0 kernel/bpf/core.c:731
  kernel_text_address+0x9f/0xd0 kernel/extable.c:125
  __kernel_text_address+0x9/0x40 kernel/extable.c:79
  unwind_get_return_address+0x49/0x80 arch/x86/kernel/unwind_orc.c:323
  arch_stack_walk+0xf3/0x140 arch/x86/kernel/stacktrace.c:26
  stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122
  save_stack+0xf6/0x1e0 mm/page_owner.c:127
  __set_page_owner+0x26/0x390 mm/page_owner.c:190
  set_page_owner include/linux/page_owner.h:31 [inline]
  post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
  prep_new_page mm/page_alloc.c:2520 [inline]
  get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
  __alloc_pages+0x28d/0x770 mm/page_alloc.c:5547
  __folio_alloc+0xf/0x30 mm/page_alloc.c:5579
  vma_alloc_folio+0x486/0x990 mm/mempolicy.c:2243
  shmem_alloc_folio mm/shmem.c:1589 [inline]
  shmem_alloc_and_acct_folio+0x5a8/0xd50 mm/shmem.c:1613
  shmem_get_folio_gfp+0x13f0/0x3470 mm/shmem.c:1941
  shmem_get_folio mm/shmem.c:2072 [inline]
  shmem_write_begin+0x16e/0x4e0 mm/shmem.c:2559
  generic_perform_write+0x2fc/0x5e0 mm/filemap.c:3817
  __generic_file_write_iter+0x176/0x400 mm/filemap.c:3945
  generic_file_write_iter+0xab/0x310 mm/filemap.c:3977
  call_write_iter include/linux/fs.h:2265 [inline]
  new_sync_write fs/read_write.c:491 [inline]
  vfs_write+0x7ae/0xba0 fs/read_write.c:584
  ksys_write+0x19c/0x2c0 fs/read_write.c:637
  do_syscall_x64 arch/x86/entry/common.c:51 [inline]
  do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
  entry_SYSCALL_64_after_hwframe+0x68/0xd2

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

... which became SOFTIRQ-irq-unsafe at:
...
  lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
  __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
  _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
  do_wait+0x2c6/0xb80 kernel/exit.c:1602
  kernel_wait+0xe5/0x230 kernel/exit.c:1792
  call_usermodehelper_exec_sync kernel/umh.c:140 [inline]
  call_usermodehelper_exec_work+0xb5/0x220 kernel/umh.c:167
  process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
  worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
  kthread+0x28d/0x320 kernel/kthread.c:376
  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

other info that might help us debug this:

Chain exists of:
  &client->buffer_lock --> &f->f_owner.lock --> tasklist_lock

 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(tasklist_lock);
                               local_irq_disable();
                               lock(&client->buffer_lock);
                               lock(&f->f_owner.lock);
  <Interrupt>
    lock(&client->buffer_lock);

 *** DEADLOCK ***

5 locks held by syz-executor.4/7924:
 #0: ffffffff8d267270 (file_rwsem){.+.+}-{0:0}, at: __break_lease+0x186/0x1550 fs/locks.c:1492
 #1: ffff88801ebe16f8 (&ctx->flc_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #1: ffff88801ebe16f8 (&ctx->flc_lock){+.+.}-{2:2}, at: __break_lease+0x193/0x1550 fs/locks.c:1493
 #2: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #2: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #2: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: kill_fasync+0x51/0x4d0 fs/fcntl.c:1014
 #3: ffff8880238256a8 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:994 [inline]
 #3: ffff8880238256a8 (&new->fa_lock){....}-{2:2}, at: kill_fasync+0x196/0x4d0 fs/fcntl.c:1015
 #4: ffff8880764ff530 (&f->f_owner.lock){...-}-{2:2}, at: send_sigio+0x2f/0x360 fs/fcntl.c:776

the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
  -> (&client->buffer_lock){..-.}-{2:2} {
     IN-SOFTIRQ-W at:
                        lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                        __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:351 [inline]
                        evdev_pass_values+0xee/0xad0 drivers/input/evdev.c:261
                        evdev_events+0x1be/0x2f0 drivers/input/evdev.c:306
                        input_to_handler drivers/input/input.c:127 [inline]
                        input_pass_values+0x8e0/0x12a0 drivers/input/input.c:159
                        input_event_dispose+0x3fc/0x650 drivers/input/input.c:385
                        input_handle_event+0x97d/0xb00 drivers/input/input.c:402
                        input_event+0xa0/0xd0 drivers/input/input.c:431
                        hidinput_hid_event+0x13de/0x1d30 drivers/hid/hid-input.c:1706
                        hid_process_event+0x433/0x580 drivers/hid/hid-core.c:1544
                        hid_process_report drivers/hid/hid-core.c:1692 [inline]
                        hid_report_raw_event+0xfd5/0x17e0 drivers/hid/hid-core.c:2019
                        hid_input_report+0x420/0x4e0 drivers/hid/hid-core.c:2087
                        hid_irq_in+0x45c/0x690 drivers/hid/usbhid/hid-core.c:284
                        __usb_hcd_giveback_urb+0x371/0x530 drivers/usb/core/hcd.c:1675
                        dummy_timer+0x8ad/0x3200 drivers/usb/gadget/udc/dummy_hcd.c:1988
                        call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504
                        expire_timers kernel/time/timer.c:1549 [inline]
                        __run_timers+0x67c/0x890 kernel/time/timer.c:1820
                        run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833
                        __do_softirq+0x2e9/0xa4c kernel/softirq.c:571
                        invoke_softirq kernel/softirq.c:445 [inline]
                        __irq_exit_rcu+0x155/0x240 kernel/softirq.c:650
                        irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
                        sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106
                        asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653
                        lock_acquire+0x26f/0x5a0 kernel/locking/lockdep.c:5666
                        rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
                        rcu_read_lock include/linux/rcupdate.h:791 [inline]
                        is_bpf_text_address+0x3e/0x2a0 kernel/bpf/core.c:731
                        kernel_text_address+0x9f/0xd0 kernel/extable.c:125
                        __kernel_text_address+0x9/0x40 kernel/extable.c:79
                        unwind_get_return_address+0x49/0x80 arch/x86/kernel/unwind_orc.c:323
                        arch_stack_walk+0xf3/0x140 arch/x86/kernel/stacktrace.c:26
                        stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122
                        save_stack+0xf6/0x1e0 mm/page_owner.c:127
                        __set_page_owner+0x26/0x390 mm/page_owner.c:190
                        set_page_owner include/linux/page_owner.h:31 [inline]
                        post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
                        prep_new_page mm/page_alloc.c:2520 [inline]
                        get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
                        __alloc_pages+0x28d/0x770 mm/page_alloc.c:5547
                        __folio_alloc+0xf/0x30 mm/page_alloc.c:5579
                        vma_alloc_folio+0x486/0x990 mm/mempolicy.c:2243
                        shmem_alloc_folio mm/shmem.c:1589 [inline]
                        shmem_alloc_and_acct_folio+0x5a8/0xd50 mm/shmem.c:1613
                        shmem_get_folio_gfp+0x13f0/0x3470 mm/shmem.c:1941
                        shmem_get_folio mm/shmem.c:2072 [inline]
                        shmem_write_begin+0x16e/0x4e0 mm/shmem.c:2559
                        generic_perform_write+0x2fc/0x5e0 mm/filemap.c:3817
                        __generic_file_write_iter+0x176/0x400 mm/filemap.c:3945
                        generic_file_write_iter+0xab/0x310 mm/filemap.c:3977
                        call_write_iter include/linux/fs.h:2265 [inline]
                        new_sync_write fs/read_write.c:491 [inline]
                        vfs_write+0x7ae/0xba0 fs/read_write.c:584
                        ksys_write+0x19c/0x2c0 fs/read_write.c:637
                        do_syscall_x64 arch/x86/entry/common.c:51 [inline]
                        do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
                        entry_SYSCALL_64_after_hwframe+0x68/0xd2
     INITIAL USE at:
                       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                       __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:351 [inline]
                       evdev_pass_values+0xee/0xad0 drivers/input/evdev.c:261
                       evdev_events+0x1be/0x2f0 drivers/input/evdev.c:306
                       input_to_handler drivers/input/input.c:127 [inline]
                       input_pass_values+0x8e0/0x12a0 drivers/input/input.c:159
                       input_event_dispose+0x366/0x650 drivers/input/input.c:374
                       input_handle_event+0x97d/0xb00 drivers/input/input.c:402
                       input_inject_event+0x224/0x330 drivers/input/input.c:461
                       evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
                       vfs_write+0x2d9/0xba0 fs/read_write.c:582
                       ksys_write+0x19c/0x2c0 fs/read_write.c:637
                       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
                       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
                       entry_SYSCALL_64_after_hwframe+0x68/0xd2
   }
   ... key      at: [<ffffffff92056660>] evdev_open.__key.25+0x0/0x20
 -> (&new->fa_lock){....}-{2:2} {
    INITIAL USE at:
                     lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                     __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                     _raw_write_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:326
                     fasync_remove_entry+0xfb/0x1d0 fs/fcntl.c:871
                     __fput+0x70d/0x890 fs/file_table.c:317
                     task_work_run+0x246/0x300 kernel/task_work.c:179
                     resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
                     exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:177
                     exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
                     __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
                     syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303
                     do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87
                     entry_SYSCALL_64_after_hwframe+0x68/0xd2
    INITIAL READ USE at:
                          lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                          __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                          _raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
                          kill_fasync_rcu fs/fcntl.c:994 [inline]
                          kill_fasync+0x196/0x4d0 fs/fcntl.c:1015
                          __pass_event drivers/input/evdev.c:240 [inline]
                          evdev_pass_values+0x586/0xad0 drivers/input/evdev.c:278
                          evdev_events+0x1be/0x2f0 drivers/input/evdev.c:306
                          input_to_handler drivers/input/input.c:127 [inline]
                          input_pass_values+0x8e0/0x12a0 drivers/input/input.c:159
                          input_event_dispose+0x366/0x650 drivers/input/input.c:374
                          input_handle_event+0x97d/0xb00 drivers/input/input.c:402
                          input_inject_event+0x224/0x330 drivers/input/input.c:461
                          evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
                          vfs_write+0x2d9/0xba0 fs/read_write.c:582
                          ksys_write+0x19c/0x2c0 fs/read_write.c:637
                          do_syscall_x64 arch/x86/entry/common.c:51 [inline]
                          do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
                          entry_SYSCALL_64_after_hwframe+0x68/0xd2
  }
  ... key      at: [<ffffffff91d5d8e0>] fasync_insert_entry.__key+0x0/0x20
  ... acquired at:
   lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
   kill_fasync_rcu fs/fcntl.c:994 [inline]
   kill_fasync+0x196/0x4d0 fs/fcntl.c:1015
   __pass_event drivers/input/evdev.c:240 [inline]
   evdev_pass_values+0x586/0xad0 drivers/input/evdev.c:278
   evdev_events+0x1be/0x2f0 drivers/input/evdev.c:306
   input_to_handler drivers/input/input.c:127 [inline]
   input_pass_values+0x8e0/0x12a0 drivers/input/input.c:159
   input_event_dispose+0x366/0x650 drivers/input/input.c:374
   input_handle_event+0x97d/0xb00 drivers/input/input.c:402
   input_inject_event+0x224/0x330 drivers/input/input.c:461
   evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
   vfs_write+0x2d9/0xba0 fs/read_write.c:582
   ksys_write+0x19c/0x2c0 fs/read_write.c:637
   do_syscall_x64 arch/x86/entry/common.c:51 [inline]
   do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
   entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> (&f->f_owner.lock){...-}-{2:2} {
   IN-SOFTIRQ-R at:
                    lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                    __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                    _raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
                    send_sigurg+0x25/0x3b0 fs/fcntl.c:815
                    sk_send_sigurg+0x6a/0xb0 net/core/sock.c:3363
                    tcp_check_urg+0x202/0x740 net/ipv4/tcp_input.c:5637
                    tcp_urg+0x154/0x440 net/ipv4/tcp_input.c:5678
                    tcp_rcv_established+0xe58/0x1f00 net/ipv4/tcp_input.c:6025
                    tcp_v4_do_rcv+0x487/0xb00 net/ipv4/tcp_ipv4.c:1677
                    tcp_v4_rcv+0x29e0/0x3250 net/ipv4/tcp_ipv4.c:2099
                    ip_protocol_deliver_rcu+0x381/0x740 net/ipv4/ip_input.c:205
                    ip_local_deliver_finish+0x304/0x580 net/ipv4/ip_input.c:233
                    NF_HOOK+0x39d/0x450 include/linux/netfilter.h:302
                    NF_HOOK+0x39d/0x450 include/linux/netfilter.h:302
                    __netif_receive_skb_one_core net/core/dev.c:5528 [inline]
                    __netif_receive_skb+0x1c6/0x530 net/core/dev.c:5642
                    process_backlog+0x381/0x760 net/core/dev.c:5970
                    __napi_poll+0xc7/0x470 net/core/dev.c:6537
                    napi_poll net/core/dev.c:6604 [inline]
                    net_rx_action+0x70f/0xeb0 net/core/dev.c:6718
                    __do_softirq+0x2e9/0xa4c kernel/softirq.c:571
                    run_ksoftirqd+0xc1/0x120 kernel/softirq.c:934
                    smpboot_thread_fn+0x52c/0xa30 kernel/smpboot.c:164
                    kthread+0x28d/0x320 kernel/kthread.c:376
                    ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
   INITIAL USE at:
                   lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                   __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                   _raw_write_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:326
                   f_modown+0x38/0x340 fs/fcntl.c:91
                   generic_add_lease fs/locks.c:1806 [inline]
                   generic_setlease+0xf3f/0x1440 fs/locks.c:1886
                   vfs_setlease fs/locks.c:1976 [inline]
                   do_fcntl_add_lease fs/locks.c:1997 [inline]
                   fcntl_setlease+0x341/0x3f0 fs/locks.c:2019
                   do_fcntl+0x10a/0x1510 fs/fcntl.c:401
                   __do_sys_fcntl fs/fcntl.c:452 [inline]
                   __se_sys_fcntl+0xd5/0x1b0 fs/fcntl.c:437
                   do_syscall_x64 arch/x86/entry/common.c:51 [inline]
                   do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
                   entry_SYSCALL_64_after_hwframe+0x68/0xd2
   INITIAL READ USE at:
                        lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                        __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
                        _raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
                        send_sigio+0x2f/0x360 fs/fcntl.c:776
                        kill_fasync_rcu fs/fcntl.c:1001 [inline]
                        kill_fasync+0x232/0x4d0 fs/fcntl.c:1015
                        __pass_event drivers/input/evdev.c:240 [inline]
                        evdev_pass_values+0x586/0xad0 drivers/input/evdev.c:278
                        evdev_events+0x1be/0x2f0 drivers/input/evdev.c:306
                        input_to_handler drivers/input/input.c:127 [inline]
                        input_pass_values+0x8e0/0x12a0 drivers/input/input.c:159
                        input_event_dispose+0x366/0x650 drivers/input/input.c:374
                        input_handle_event+0x97d/0xb00 drivers/input/input.c:402
                        input_inject_event+0x224/0x330 drivers/input/input.c:461
                        evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
                        vfs_write+0x2d9/0xba0 fs/read_write.c:582
                        ksys_write+0x19c/0x2c0 fs/read_write.c:637
                        do_syscall_x64 arch/x86/entry/common.c:51 [inline]
                        do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
                        entry_SYSCALL_64_after_hwframe+0x68/0xd2
 }
 ... key      at: [<ffffffff91d5cc60>] __alloc_file.__key+0x0/0x10
 ... acquired at:
   lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
   __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:160 [inline]
   _raw_read_lock_irqsave+0xd9/0x120 kernel/locking/spinlock.c:236
   send_sigio+0x2f/0x360 fs/fcntl.c:776
   kill_fasync_rcu fs/fcntl.c:1001 [inline]
   kill_fasync+0x232/0x4d0 fs/fcntl.c:1015
   __pass_event drivers/input/evdev.c:240 [inline]
   evdev_pass_values+0x586/0xad0 drivers/input/evdev.c:278
   evdev_events+0x1be/0x2f0 drivers/input/evdev.c:306
   input_to_handler drivers/input/input.c:127 [inline]
   input_pass_values+0x8e0/0x12a0 drivers/input/input.c:159
   input_event_dispose+0x366/0x650 drivers/input/input.c:374
   input_handle_event+0x97d/0xb00 drivers/input/input.c:402
   input_inject_event+0x224/0x330 drivers/input/input.c:461
   evdev_write+0x668/0x7c0 drivers/input/evdev.c:530
   vfs_write+0x2d9/0xba0 fs/read_write.c:582
   ksys_write+0x19c/0x2c0 fs/read_write.c:637
   do_syscall_x64 arch/x86/entry/common.c:51 [inline]
   do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
   entry_SYSCALL_64_after_hwframe+0x68/0xd2


the dependencies between the lock to be acquired
 and SOFTIRQ-irq-unsafe lock:
-> (tasklist_lock){.+.+}-{2:2} {
   HARDIRQ-ON-R at:
                    lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                    __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                    _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
                    do_wait+0x2c6/0xb80 kernel/exit.c:1602
                    kernel_wait+0xe5/0x230 kernel/exit.c:1792
                    call_usermodehelper_exec_sync kernel/umh.c:140 [inline]
                    call_usermodehelper_exec_work+0xb5/0x220 kernel/umh.c:167
                    process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
                    worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
                    kthread+0x28d/0x320 kernel/kthread.c:376
                    ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
   SOFTIRQ-ON-R at:
                    lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                    __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                    _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
                    do_wait+0x2c6/0xb80 kernel/exit.c:1602
                    kernel_wait+0xe5/0x230 kernel/exit.c:1792
                    call_usermodehelper_exec_sync kernel/umh.c:140 [inline]
                    call_usermodehelper_exec_work+0xb5/0x220 kernel/umh.c:167
                    process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
                    worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
                    kthread+0x28d/0x320 kernel/kthread.c:376
                    ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
   INITIAL USE at:
                   lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                   __raw_write_lock_irq include/linux/rwlock_api_smp.h:195 [inline]
                   _raw_write_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:326
                   copy_process+0x24b6/0x4060 kernel/fork.c:2401
                   kernel_clone+0x222/0x920 kernel/fork.c:2682
                   user_mode_thread+0x12e/0x190 kernel/fork.c:2758
                   rest_init+0x23/0x300 init/main.c:699
                   start_kernel+0x0/0x53f init/main.c:894
                   start_kernel+0x496/0x53f init/main.c:1141
                   secondary_startup_64_no_verify+0xcf/0xdb
   INITIAL READ USE at:
                        lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
                        __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
                        _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
                        do_wait+0x2c6/0xb80 kernel/exit.c:1602
                        kernel_wait+0xe5/0x230 kernel/exit.c:1792
                        call_usermodehelper_exec_sync kernel/umh.c:140 [inline]
                        call_usermodehelper_exec_work+0xb5/0x220 kernel/umh.c:167
                        process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
                        worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
                        kthread+0x28d/0x320 kernel/kthread.c:376
                        ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
 }
 ... key      at: [<ffffffff8ce0a058>] tasklist_lock+0x18/0x40
 ... acquired at:
   lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
   __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
   _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
   send_sigio+0xf8/0x360 fs/fcntl.c:790
   kill_fasync_rcu fs/fcntl.c:1001 [inline]
   kill_fasync+0x232/0x4d0 fs/fcntl.c:1015
   lease_break_callback+0x22/0x30 fs/locks.c:521
   __break_lease+0x4d1/0x1550 fs/locks.c:1521
   break_lease include/linux/fs.h:2714 [inline]
   do_dentry_open+0x76c/0x10f0 fs/open.c:873
   do_open fs/namei.c:3628 [inline]
   path_openat+0x2644/0x2e60 fs/namei.c:3785
   do_filp_open+0x230/0x480 fs/namei.c:3812
   do_sys_openat2+0x13b/0x500 fs/open.c:1318
   do_sys_open fs/open.c:1334 [inline]
   __do_sys_openat fs/open.c:1350 [inline]
   __se_sys_openat fs/open.c:1345 [inline]
   __x64_sys_openat+0x243/0x290 fs/open.c:1345
   do_syscall_x64 arch/x86/entry/common.c:51 [inline]
   do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
   entry_SYSCALL_64_after_hwframe+0x68/0xd2


stack backtrace:
CPU: 1 PID: 7924 Comm: syz-executor.4 Not tainted 6.1.90-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_bad_irq_dependency kernel/locking/lockdep.c:2604 [inline]
 check_irq_usage kernel/locking/lockdep.c:2843 [inline]
 check_prev_add kernel/locking/lockdep.c:3094 [inline]
 check_prevs_add kernel/locking/lockdep.c:3209 [inline]
 validate_chain+0x4d16/0x5950 kernel/locking/lockdep.c:3825
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
 __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline]
 _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:228
 send_sigio+0xf8/0x360 fs/fcntl.c:790
 kill_fasync_rcu fs/fcntl.c:1001 [inline]
 kill_fasync+0x232/0x4d0 fs/fcntl.c:1015
 lease_break_callback+0x22/0x30 fs/locks.c:521
 __break_lease+0x4d1/0x1550 fs/locks.c:1521
 break_lease include/linux/fs.h:2714 [inline]
 do_dentry_open+0x76c/0x10f0 fs/open.c:873
 do_open fs/namei.c:3628 [inline]
 path_openat+0x2644/0x2e60 fs/namei.c:3785
 do_filp_open+0x230/0x480 fs/namei.c:3812
 do_sys_openat2+0x13b/0x500 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1345
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f65d847dd29
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f65d915c0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f65d85abf80 RCX: 00007f65d847dd29
RDX: 0000000000000000 RSI: 0000000020000000 RDI: ffffffffffffff9c
RBP: 00007f65d84ca47e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f65d85abf80 R15: 00007ffc722ec268
 </TASK>

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/03 01:43 linux-6.1.y 909ba1f1b414 ddfc15a1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/05/01 09:15 linux-6.1.y dcbc050cb0d3 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/29 13:34 linux-6.1.y dcbc050cb0d3 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/20 09:12 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/16 07:11 linux-6.1.y cd5d98c0556c 0d592ce4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/11 04:25 linux-6.1.y bf1e3b1cb1e0 33b9e058 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/10 12:20 linux-6.1.y 347385861c50 4320ec32 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/10 12:20 linux-6.1.y 347385861c50 4320ec32 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/07 16:56 linux-6.1.y 347385861c50 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/06 22:38 linux-6.1.y 347385861c50 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/06 12:04 linux-6.1.y 347385861c50 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/04/04 13:47 linux-6.1.y 347385861c50 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/03/29 12:18 linux-6.1.y e5cd595e23c1 c52bcb23 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
2024/03/28 21:06 linux-6.1.y e5cd595e23c1 e91187ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in evdev_pass_values
* Struck through repros no longer work on HEAD.