syzbot


possible deadlock in try_to_wake_up (4)

Status: upstream: reported C repro on 2024/03/18 16:02
Subsystems: bpf net
[Documentation on labels]
Reported-by: syzbot+21f93e66c95001d6f61a@syzkaller.appspotmail.com
First crash: 31d, last: 3d14h
Cause bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bpf?] [net?] possible deadlock in try_to_wake_up (4) 0 (1) 2024/03/18 16:02
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in try_to_wake_up C 1 20d 20d 0/3 upstream: reported C repro on 2024/03/27 17:52
linux-5.15 possible deadlock in try_to_wake_up 2 5d15h 11d 0/3 upstream: reported on 2024/04/05 17:03
upstream possible deadlock in try_to_wake_up (2) mm 1 576d 572d 0/26 auto-obsoleted due to no activity on 2023/01/16 12:10
upstream possible deadlock in try_to_wake_up (3) net 103 181d 191d 0/26 auto-obsoleted due to no activity on 2023/11/27 02:05
upstream possible deadlock in try_to_wake_up mm 39 1919d 1951d 0/26 auto-closed as invalid on 2019/07/13 09:55

Sample crash report:
=====================================================
WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
6.8.0-syzkaller-05271-gf99c5f563c17 #0 Not tainted
-----------------------------------------------------
swapper/1/0 [HC0[0]:SC1[3]:HE0:SE0] is trying to acquire:
ffff888023428200 (&stab->lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
ffff888023428200 (&stab->lock){+.-.}-{2:2}, at: __sock_map_delete net/core/sock_map.c:414 [inline]
ffff888023428200 (&stab->lock){+.-.}-{2:2}, at: sock_map_delete_elem+0x97/0x140 net/core/sock_map.c:446

and this task is already holding:
ffff8880172b6410 (&p->pi_lock){-.-.}-{2:2}, at: class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
ffff8880172b6410 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
which would create a new lock dependency:
 (&p->pi_lock){-.-.}-{2:2} -> (&stab->lock){+.-.}-{2:2}

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

... which became HARDIRQ-irq-safe at:
  lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
  __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
  _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
  class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
  try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
  autoremove_wake_function+0x16/0x110 kernel/sched/wait.c:384
  __wake_up_common kernel/sched/wait.c:89 [inline]
  __wake_up_common_lock+0x130/0x1e0 kernel/sched/wait.c:106
  irq_work_single+0xe2/0x240 kernel/irq_work.c:221
  irq_work_run_list kernel/irq_work.c:252 [inline]
  irq_work_run+0x18b/0x350 kernel/irq_work.c:261
  __sysvec_irq_work+0xa8/0x3e0 arch/x86/kernel/irq_work.c:22
  instr_sysvec_irq_work arch/x86/kernel/irq_work.c:17 [inline]
  sysvec_irq_work+0x9e/0xc0 arch/x86/kernel/irq_work.c:17
  asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:738
  __wrmsr arch/x86/include/asm/msr.h:96 [inline]
  native_write_msr arch/x86/include/asm/msr.h:160 [inline]
  wrmsr arch/x86/include/asm/msr.h:269 [inline]
  native_apic_msr_write+0x39/0x50 arch/x86/include/asm/apic.h:207
  __apic_send_IPI_self arch/x86/include/asm/apic.h:458 [inline]
  arch_irq_work_raise+0x6f/0x80 arch/x86/kernel/irq_work.c:31
  irq_work_queue+0xa7/0x150 kernel/irq_work.c:124
  __kfence_alloc+0x22e/0x370 mm/kfence/core.c:1088
  kfence_alloc include/linux/kfence.h:129 [inline]
  slab_alloc_node mm/slub.c:3846 [inline]
  __do_kmalloc_node mm/slub.c:3980 [inline]
  __kmalloc+0x41c/0x4a0 mm/slub.c:3994
  kmalloc include/linux/slab.h:594 [inline]
  kzalloc include/linux/slab.h:711 [inline]
  alloc_workqueue+0x1b0/0x20c0 kernel/workqueue.c:5542
  init_mm_internals+0x17/0x120 mm/vmstat.c:2122
  kernel_init_freeable+0x403/0x5d0 init/main.c:1543
  kernel_init+0x1d/0x2a0 init/main.c:1446
  ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243

to a HARDIRQ-irq-unsafe lock:
 (&stab->lock){+.-.}-{2:2}

... which became HARDIRQ-irq-unsafe at:
...
  lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
  __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
  _raw_spin_lock_bh+0x35/0x50 kernel/locking/spinlock.c:178
  spin_lock_bh include/linux/spinlock.h:356 [inline]
  __sock_map_delete net/core/sock_map.c:414 [inline]
  sock_map_delete_elem+0x97/0x140 net/core/sock_map.c:446
  bpf_prog_2c29ac5cdc6b1842+0x42/0x46
  bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
  __bpf_prog_run include/linux/filter.h:657 [inline]
  bpf_prog_run include/linux/filter.h:664 [inline]
  __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
  bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420
  trace_contention_end+0xd7/0x100 include/trace/events/lock.h:122
  __mutex_lock_common kernel/locking/mutex.c:617 [inline]
  __mutex_lock+0x2e5/0xd70 kernel/locking/mutex.c:752
  futex_cleanup_begin kernel/futex/core.c:1091 [inline]
  futex_exit_release+0x34/0x1f0 kernel/futex/core.c:1143
  exit_mm_release+0x1a/0x30 kernel/fork.c:1652
  exit_mm+0xb0/0x310 kernel/exit.c:542
  do_exit+0x99e/0x27e0 kernel/exit.c:865
  do_group_exit+0x207/0x2c0 kernel/exit.c:1027
  __do_sys_exit_group kernel/exit.c:1038 [inline]
  __se_sys_exit_group kernel/exit.c:1036 [inline]
  __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036
  do_syscall_64+0xfb/0x240
  entry_SYSCALL_64_after_hwframe+0x6d/0x75

other info that might help us debug this:

 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&stab->lock);
                               local_irq_disable();
                               lock(&p->pi_lock);
                               lock(&stab->lock);
  <Interrupt>
    lock(&p->pi_lock);

 *** DEADLOCK ***

3 locks held by swapper/1/0:
 #0: ffffffff8e136ab0 (&rcu_state.gp_wq){..-.}-{2:2}, at: swake_up_one+0x20/0x160 kernel/sched/swait.c:51
 #1: ffff8880172b6410 (&p->pi_lock){-.-.}-{2:2}, at: class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
 #1: ffff8880172b6410 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
 #2: ffffffff8e131920 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #2: ffffffff8e131920 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #2: ffffffff8e131920 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2380 [inline]
 #2: ffffffff8e131920 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x114/0x420 kernel/trace/bpf_trace.c:2420

the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-> (&p->pi_lock){-.-.}-{2:2} {
   IN-HARDIRQ-W at:
                    lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
                    __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                    _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
                    class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
                    try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
                    autoremove_wake_function+0x16/0x110 kernel/sched/wait.c:384
                    __wake_up_common kernel/sched/wait.c:89 [inline]
                    __wake_up_common_lock+0x130/0x1e0 kernel/sched/wait.c:106
                    irq_work_single+0xe2/0x240 kernel/irq_work.c:221
                    irq_work_run_list kernel/irq_work.c:252 [inline]
                    irq_work_run+0x18b/0x350 kernel/irq_work.c:261
                    __sysvec_irq_work+0xa8/0x3e0 arch/x86/kernel/irq_work.c:22
                    instr_sysvec_irq_work arch/x86/kernel/irq_work.c:17 [inline]
                    sysvec_irq_work+0x9e/0xc0 arch/x86/kernel/irq_work.c:17
                    asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:738
                    __wrmsr arch/x86/include/asm/msr.h:96 [inline]
                    native_write_msr arch/x86/include/asm/msr.h:160 [inline]
                    wrmsr arch/x86/include/asm/msr.h:269 [inline]
                    native_apic_msr_write+0x39/0x50 arch/x86/include/asm/apic.h:207
                    __apic_send_IPI_self arch/x86/include/asm/apic.h:458 [inline]
                    arch_irq_work_raise+0x6f/0x80 arch/x86/kernel/irq_work.c:31
                    irq_work_queue+0xa7/0x150 kernel/irq_work.c:124
                    __kfence_alloc+0x22e/0x370 mm/kfence/core.c:1088
                    kfence_alloc include/linux/kfence.h:129 [inline]
                    slab_alloc_node mm/slub.c:3846 [inline]
                    __do_kmalloc_node mm/slub.c:3980 [inline]
                    __kmalloc+0x41c/0x4a0 mm/slub.c:3994
                    kmalloc include/linux/slab.h:594 [inline]
                    kzalloc include/linux/slab.h:711 [inline]
                    alloc_workqueue+0x1b0/0x20c0 kernel/workqueue.c:5542
                    init_mm_internals+0x17/0x120 mm/vmstat.c:2122
                    kernel_init_freeable+0x403/0x5d0 init/main.c:1543
                    kernel_init+0x1d/0x2a0 init/main.c:1446
                    ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
                    ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
   IN-SOFTIRQ-W at:
                    lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
                    __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                    _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
                    class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
                    try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
                    call_timer_fn+0x17e/0x600 kernel/time/timer.c:1792
                    expire_timers kernel/time/timer.c:1843 [inline]
                    __run_timers kernel/time/timer.c:2408 [inline]
                    __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2419
                    run_timer_base kernel/time/timer.c:2428 [inline]
                    run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2438
                    __do_softirq+0x2bc/0x943 kernel/softirq.c:554
                    invoke_softirq kernel/softirq.c:428 [inline]
                    __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633
                    irq_exit_rcu+0x9/0x30 kernel/softirq.c:645
                    instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
                    sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
                    asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
                    native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline]
                    arch_safe_halt arch/x86/include/asm/irqflags.h:86 [inline]
                    default_idle+0x13/0x20 arch/x86/kernel/process.c:742
                    default_idle_call+0x74/0xb0 kernel/sched/idle.c:117
                    cpuidle_idle_call kernel/sched/idle.c:191 [inline]
                    do_idle+0x22f/0x5d0 kernel/sched/idle.c:332
                    cpu_startup_entry+0x42/0x60 kernel/sched/idle.c:430
                    rest_init+0x2e0/0x300 init/main.c:730
                    arch_call_rest_init+0xe/0x10 init/main.c:831
                    start_kernel+0x47a/0x500 init/main.c:1077
                    x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:509
                    x86_64_start_kernel+0x99/0xa0 arch/x86/kernel/head64.c:490
                    common_startup_64+0x13e/0x147
   INITIAL USE at:
                   lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
                   __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
                   _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
                   sched_cgroup_fork+0x33/0x410 kernel/sched/core.c:4828
                   copy_process+0x2217/0x3df0 kernel/fork.c:2498
                   kernel_clone+0x21e/0x8d0 kernel/fork.c:2796
                   user_mode_thread+0x132/0x1a0 kernel/fork.c:2874
                   rest_init+0x27/0x300 init/main.c:695
                   arch_call_rest_init+0xe/0x10 init/main.c:831
                   start_kernel+0x47a/0x500 init/main.c:1077
                   x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:509
                   x86_64_start_kernel+0x99/0xa0 arch/x86/kernel/head64.c:490
                   common_startup_64+0x13e/0x147
 }
 ... key      at: [<ffffffff926bf780>] rt_mutex_init_task.__key+0x0/0x20

the dependencies between the lock to be acquired
 and HARDIRQ-irq-unsafe lock:
-> (&stab->lock){+.-.}-{2:2} {
   HARDIRQ-ON-W at:
                    lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
                    __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
                    _raw_spin_lock_bh+0x35/0x50 kernel/locking/spinlock.c:178
                    spin_lock_bh include/linux/spinlock.h:356 [inline]
                    __sock_map_delete net/core/sock_map.c:414 [inline]
                    sock_map_delete_elem+0x97/0x140 net/core/sock_map.c:446
                    bpf_prog_2c29ac5cdc6b1842+0x42/0x46
                    bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
                    __bpf_prog_run include/linux/filter.h:657 [inline]
                    bpf_prog_run include/linux/filter.h:664 [inline]
                    __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
                    bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420
                    trace_contention_end+0xd7/0x100 include/trace/events/lock.h:122
                    __mutex_lock_common kernel/locking/mutex.c:617 [inline]
                    __mutex_lock+0x2e5/0xd70 kernel/locking/mutex.c:752
                    futex_cleanup_begin kernel/futex/core.c:1091 [inline]
                    futex_exit_release+0x34/0x1f0 kernel/futex/core.c:1143
                    exit_mm_release+0x1a/0x30 kernel/fork.c:1652
                    exit_mm+0xb0/0x310 kernel/exit.c:542
                    do_exit+0x99e/0x27e0 kernel/exit.c:865
                    do_group_exit+0x207/0x2c0 kernel/exit.c:1027
                    __do_sys_exit_group kernel/exit.c:1038 [inline]
                    __se_sys_exit_group kernel/exit.c:1036 [inline]
                    __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036
                    do_syscall_64+0xfb/0x240
                    entry_SYSCALL_64_after_hwframe+0x6d/0x75
   IN-SOFTIRQ-W at:
                    lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
                    __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
                    _raw_spin_lock_bh+0x35/0x50 kernel/locking/spinlock.c:178
                    spin_lock_bh include/linux/spinlock.h:356 [inline]
                    __sock_map_delete net/core/sock_map.c:414 [inline]
                    sock_map_delete_elem+0x97/0x140 net/core/sock_map.c:446
                    bpf_prog_2c29ac5cdc6b1842+0x42/0x46
                    bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
                    __bpf_prog_run include/linux/filter.h:657 [inline]
                    bpf_prog_run include/linux/filter.h:664 [inline]
                    __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
                    bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420
                    trace_contention_end+0xf6/0x120 include/trace/events/lock.h:122
                    __pv_queued_spin_lock_slowpath+0x939/0xc60 kernel/locking/qspinlock.c:560
                    pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline]
                    queued_spin_lock_slowpath+0x42/0x50 arch/x86/include/asm/qspinlock.h:51
                    queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
                    do_raw_spin_lock+0x272/0x370 kernel/locking/spinlock_debug.c:116
                    __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
                    _raw_spin_lock_irqsave+0xe1/0x120 kernel/locking/spinlock.c:162
                    class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
                    try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
                    swake_up_locked kernel/sched/swait.c:29 [inline]
                    swake_up_one+0x70/0x160 kernel/sched/swait.c:52
                    rcu_report_qs_rdp kernel/rcu/tree.c:2059 [inline]
                    rcu_check_quiescent_state kernel/rcu/tree.c:2100 [inline]
                    rcu_core+0x13d7/0x1830 kernel/rcu/tree.c:2455
                    __do_softirq+0x2bc/0x943 kernel/softirq.c:554
                    invoke_softirq kernel/softirq.c:428 [inline]
                    __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633
                    irq_exit_rcu+0x9/0x30 kernel/softirq.c:645
                    instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
                    sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
                    asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
                    native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline]
                    arch_safe_halt arch/x86/include/asm/irqflags.h:86 [inline]
                    acpi_safe_halt+0x21/0x30 drivers/acpi/processor_idle.c:112
                    acpi_idle_enter+0xe4/0x140 drivers/acpi/processor_idle.c:707
                    cpuidle_enter_state+0x118/0x490 drivers/cpuidle/cpuidle.c:267
                    cpuidle_enter+0x5d/0xa0 drivers/cpuidle/cpuidle.c:388
                    call_cpuidle kernel/sched/idle.c:155 [inline]
                    cpuidle_idle_call kernel/sched/idle.c:236 [inline]
                    do_idle+0x375/0x5d0 kernel/sched/idle.c:332
                    cpu_startup_entry+0x42/0x60 kernel/sched/idle.c:430
                    __pfx_ap_starting+0x0/0x10 arch/x86/kernel/smpboot.c:313
                    common_startup_64+0x13e/0x147
   INITIAL USE at:
                   lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
                   __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
                   _raw_spin_lock_bh+0x35/0x50 kernel/locking/spinlock.c:178
                   spin_lock_bh include/linux/spinlock.h:356 [inline]
                   __sock_map_delete net/core/sock_map.c:414 [inline]
                   sock_map_delete_elem+0x97/0x140 net/core/sock_map.c:446
                   bpf_prog_2c29ac5cdc6b1842+0x42/0x46
                   bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
                   __bpf_prog_run include/linux/filter.h:657 [inline]
                   bpf_prog_run include/linux/filter.h:664 [inline]
                   __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
                   bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420
                   trace_contention_end+0xd7/0x100 include/trace/events/lock.h:122
                   __mutex_lock_common kernel/locking/mutex.c:617 [inline]
                   __mutex_lock+0x2e5/0xd70 kernel/locking/mutex.c:752
                   futex_cleanup_begin kernel/futex/core.c:1091 [inline]
                   futex_exit_release+0x34/0x1f0 kernel/futex/core.c:1143
                   exit_mm_release+0x1a/0x30 kernel/fork.c:1652
                   exit_mm+0xb0/0x310 kernel/exit.c:542
                   do_exit+0x99e/0x27e0 kernel/exit.c:865
                   do_group_exit+0x207/0x2c0 kernel/exit.c:1027
                   __do_sys_exit_group kernel/exit.c:1038 [inline]
                   __se_sys_exit_group kernel/exit.c:1036 [inline]
                   __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036
                   do_syscall_64+0xfb/0x240
                   entry_SYSCALL_64_after_hwframe+0x6d/0x75
 }
 ... key      at: [<ffffffff948822e0>] sock_map_alloc.__key+0x0/0x20
 ... acquired at:
   lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
   __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
   _raw_spin_lock_bh+0x35/0x50 kernel/locking/spinlock.c:178
   spin_lock_bh include/linux/spinlock.h:356 [inline]
   __sock_map_delete net/core/sock_map.c:414 [inline]
   sock_map_delete_elem+0x97/0x140 net/core/sock_map.c:446
   bpf_prog_2c29ac5cdc6b1842+0x42/0x46
   bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
   __bpf_prog_run include/linux/filter.h:657 [inline]
   bpf_prog_run include/linux/filter.h:664 [inline]
   __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
   bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420
   trace_contention_end+0xf6/0x120 include/trace/events/lock.h:122
   __pv_queued_spin_lock_slowpath+0x939/0xc60 kernel/locking/qspinlock.c:560
   pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline]
   queued_spin_lock_slowpath+0x42/0x50 arch/x86/include/asm/qspinlock.h:51
   queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
   do_raw_spin_lock+0x272/0x370 kernel/locking/spinlock_debug.c:116
   __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
   _raw_spin_lock_irqsave+0xe1/0x120 kernel/locking/spinlock.c:162
   class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
   try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
   swake_up_locked kernel/sched/swait.c:29 [inline]
   swake_up_one+0x70/0x160 kernel/sched/swait.c:52
   rcu_report_qs_rdp kernel/rcu/tree.c:2059 [inline]
   rcu_check_quiescent_state kernel/rcu/tree.c:2100 [inline]
   rcu_core+0x13d7/0x1830 kernel/rcu/tree.c:2455
   __do_softirq+0x2bc/0x943 kernel/softirq.c:554
   invoke_softirq kernel/softirq.c:428 [inline]
   __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633
   irq_exit_rcu+0x9/0x30 kernel/softirq.c:645
   instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
   sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
   asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
   native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline]
   arch_safe_halt arch/x86/include/asm/irqflags.h:86 [inline]
   acpi_safe_halt+0x21/0x30 drivers/acpi/processor_idle.c:112
   acpi_idle_enter+0xe4/0x140 drivers/acpi/processor_idle.c:707
   cpuidle_enter_state+0x118/0x490 drivers/cpuidle/cpuidle.c:267
   cpuidle_enter+0x5d/0xa0 drivers/cpuidle/cpuidle.c:388
   call_cpuidle kernel/sched/idle.c:155 [inline]
   cpuidle_idle_call kernel/sched/idle.c:236 [inline]
   do_idle+0x375/0x5d0 kernel/sched/idle.c:332
   cpu_startup_entry+0x42/0x60 kernel/sched/idle.c:430
   __pfx_ap_starting+0x0/0x10 arch/x86/kernel/smpboot.c:313
   common_startup_64+0x13e/0x147


stack backtrace:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.8.0-syzkaller-05271-gf99c5f563c17 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106
 print_bad_irq_dependency kernel/locking/lockdep.c:2626 [inline]
 check_irq_usage kernel/locking/lockdep.c:2865 [inline]
 check_prev_add kernel/locking/lockdep.c:3138 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain+0x4dc7/0x58e0 kernel/locking/lockdep.c:3869
 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
 lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
 _raw_spin_lock_bh+0x35/0x50 kernel/locking/spinlock.c:178
 spin_lock_bh include/linux/spinlock.h:356 [inline]
 __sock_map_delete net/core/sock_map.c:414 [inline]
 sock_map_delete_elem+0x97/0x140 net/core/sock_map.c:446
 bpf_prog_2c29ac5cdc6b1842+0x42/0x46
 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
 __bpf_prog_run include/linux/filter.h:657 [inline]
 bpf_prog_run include/linux/filter.h:664 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
 bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420
 trace_contention_end+0xf6/0x120 include/trace/events/lock.h:122
 __pv_queued_spin_lock_slowpath+0x939/0xc60 kernel/locking/qspinlock.c:560
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline]
 queued_spin_lock_slowpath+0x42/0x50 arch/x86/include/asm/qspinlock.h:51
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x272/0x370 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xe1/0x120 kernel/locking/spinlock.c:162
 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:553 [inline]
 try_to_wake_up+0xb0/0x1470 kernel/sched/core.c:4262
 swake_up_locked kernel/sched/swait.c:29 [inline]
 swake_up_one+0x70/0x160 kernel/sched/swait.c:52
 rcu_report_qs_rdp kernel/rcu/tree.c:2059 [inline]
 rcu_check_quiescent_state kernel/rcu/tree.c:2100 [inline]
 rcu_core+0x13d7/0x1830 kernel/rcu/tree.c:2455
 __do_softirq+0x2bc/0x943 kernel/softirq.c:554
 invoke_softirq kernel/softirq.c:428 [inline]
 __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
 sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:native_irq_disable arch/x86/include/asm/irqflags.h:37 [inline]
RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:72 [inline]
RIP: 0010:acpi_safe_halt+0x21/0x30 drivers/acpi/processor_idle.c:113
Code: 90 90 90 90 90 90 90 90 90 65 48 8b 04 25 80 ce 03 00 48 f7 00 08 00 00 00 75 10 66 90 0f 00 2d 15 4a 98 00 f3 0f 1e fa fb f4 <fa> c3 cc cc cc cc 66 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90
RSP: 0018:ffffc90000197d08 EFLAGS: 00000246
RAX: ffff8880172c5a00 RBX: ffff8880172ee064 RCX: 00000000000136b9
RDX: 0000000000000001 RSI: ffff8880172ee000 RDI: ffff8880172ee064
RBP: 0000000000039f18 R08: ffff8880b9537d0b R09: 1ffff110172a6fa1
R10: dffffc0000000000 R11: ffffffff8b701580 R12: ffff88801a33e800
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8e8a2e80
 acpi_idle_enter+0xe4/0x140 drivers/acpi/processor_idle.c:707
 cpuidle_enter_state+0x118/0x490 drivers/cpuidle/cpuidle.c:267
 cpuidle_enter+0x5d/0xa0 drivers/cpuidle/cpuidle.c:388
 call_cpuidle kernel/sched/idle.c:155 [inline]
 cpuidle_idle_call kernel/sched/idle.c:236 [inline]
 do_idle+0x375/0x5d0 kernel/sched/idle.c:332
 cpu_startup_entry+0x42/0x60 kernel/sched/idle.c:430
 start_secondary+0x100/0x100 arch/x86/kernel/smpboot.c:313
 common_startup_64+0x13e/0x147
 </TASK>
------------[ cut here ]------------
raw_local_irq_restore() called with IRQs enabled
WARNING: CPU: 1 PID: 0 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x29/0x40 kernel/locking/irqflag-debug.c:10
Modules linked in:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.8.0-syzkaller-05271-gf99c5f563c17 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:warn_bogus_irq_restore+0x29/0x40 kernel/locking/irqflag-debug.c:10
Code: 90 f3 0f 1e fa 90 80 3d de 69 01 04 00 74 06 90 c3 cc cc cc cc c6 05 cf 69 01 04 01 90 48 c7 c7 20 ba aa 8b e8 f8 e5 e7 f5 90 <0f> 0b 90 90 90 c3 cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 0f 1f
RSP: 0018:ffffc90000a089d8 EFLAGS: 00010246
RAX: e8db68f72c90b200 RBX: 1ffff92000141140 RCX: ffff8880172c5a00
RDX: 0000000000000104 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90000a08a70 R08: ffffffff8157cc12 R09: 1ffff92000141090
R10: dffffc0000000000 R11: fffff52000141091 R12: dffffc0000000000
R13: 1ffff9200014113c R14: ffffc90000a08a00 R15: 0000000000000046
FS:  0000000000000000(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff3598423c0 CR3: 000000000df32000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline]
 _raw_spin_unlock_irqrestore+0x120/0x140 kernel/locking/spinlock.c:194
 class_raw_spinlock_irqsave_destructor include/linux/spinlock.h:553 [inline]
 try_to_wake_up+0x5c8/0x1470 kernel/sched/core.c:4262
 swake_up_locked kernel/sched/swait.c:29 [inline]
 swake_up_one+0x70/0x160 kernel/sched/swait.c:52
 rcu_report_qs_rdp kernel/rcu/tree.c:2059 [inline]
 rcu_check_quiescent_state kernel/rcu/tree.c:2100 [inline]
 rcu_core+0x13d7/0x1830 kernel/rcu/tree.c:2455
 __do_softirq+0x2bc/0x943 kernel/softirq.c:554
 invoke_softirq kernel/softirq.c:428 [inline]
 __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
 sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:native_irq_disable arch/x86/include/asm/irqflags.h:37 [inline]
RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:72 [inline]
RIP: 0010:acpi_safe_halt+0x21/0x30 drivers/acpi/processor_idle.c:113
Code: 90 90 90 90 90 90 90 90 90 65 48 8b 04 25 80 ce 03 00 48 f7 00 08 00 00 00 75 10 66 90 0f 00 2d 15 4a 98 00 f3 0f 1e fa fb f4 <fa> c3 cc cc cc cc 66 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90
RSP: 0018:ffffc90000197d08 EFLAGS: 00000246
RAX: ffff8880172c5a00 RBX: ffff8880172ee064 RCX: 00000000000136b9
RDX: 0000000000000001 RSI: ffff8880172ee000 RDI: ffff8880172ee064
RBP: 0000000000039f18 R08: ffff8880b9537d0b R09: 1ffff110172a6fa1
R10: dffffc0000000000 R11: ffffffff8b701580 R12: ffff88801a33e800
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8e8a2e80
 acpi_idle_enter+0xe4/0x140 drivers/acpi/processor_idle.c:707
 cpuidle_enter_state+0x118/0x490 drivers/cpuidle/cpuidle.c:267
 cpuidle_enter+0x5d/0xa0 drivers/cpuidle/cpuidle.c:388
 call_cpuidle kernel/sched/idle.c:155 [inline]
 cpuidle_idle_call kernel/sched/idle.c:236 [inline]
 do_idle+0x375/0x5d0 kernel/sched/idle.c:332
 cpu_startup_entry+0x42/0x60 kernel/sched/idle.c:430
 start_secondary+0x100/0x100 arch/x86/kernel/smpboot.c:313
 common_startup_64+0x13e/0x147
 </TASK>
----------------
Code disassembly (best guess):
   0:	90                   	nop
   1:	90                   	nop
   2:	90                   	nop
   3:	90                   	nop
   4:	90                   	nop
   5:	90                   	nop
   6:	90                   	nop
   7:	90                   	nop
   8:	90                   	nop
   9:	65 48 8b 04 25 80 ce 	mov    %gs:0x3ce80,%rax
  10:	03 00
  12:	48 f7 00 08 00 00 00 	testq  $0x8,(%rax)
  19:	75 10                	jne    0x2b
  1b:	66 90                	xchg   %ax,%ax
  1d:	0f 00 2d 15 4a 98 00 	verw   0x984a15(%rip)        # 0x984a39
  24:	f3 0f 1e fa          	endbr64
  28:	fb                   	sti
  29:	f4                   	hlt
* 2a:	fa                   	cli <-- trapping instruction
  2b:	c3                   	ret
  2c:	cc                   	int3
  2d:	cc                   	int3
  2e:	cc                   	int3
  2f:	cc                   	int3
  30:	66 0f 1f 84 00 00 00 	nopw   0x0(%rax,%rax,1)
  37:	00 00
  39:	90                   	nop
  3a:	90                   	nop
  3b:	90                   	nop
  3c:	90                   	nop
  3d:	90                   	nop
  3e:	90                   	nop
  3f:	90                   	nop

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/11 19:33 net f99c5f563c17 478efa7f .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in try_to_wake_up
2024/04/09 06:23 net f99c5f563c17 53df08b6 .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in try_to_wake_up
2024/04/09 05:29 net f99c5f563c17 53df08b6 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in try_to_wake_up
2024/03/16 21:20 bpf 0740b6427e90 d615901c .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in try_to_wake_up
2024/03/16 21:14 net ea80e3ed09ab d615901c .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in try_to_wake_up
2024/04/06 21:08 bpf-next 14bb1e8c8d4a ca620dd8 .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in try_to_wake_up
2024/03/16 22:56 net-next 237bb5f7f7f5 d615901c .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in try_to_wake_up
2024/04/13 07:33 upstream fe46a7dd189e c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in try_to_wake_up
2024/04/10 14:01 upstream 2c71fdf02a95 bb5e6c0f .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in try_to_wake_up
2024/04/13 02:14 net f99c5f563c17 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in try_to_wake_up
2024/04/08 21:15 bpf 443574b03387 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in try_to_wake_up
2024/04/07 23:19 bpf 443574b03387 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in try_to_wake_up
2024/03/27 21:59 net f99c5f563c17 454571b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in try_to_wake_up
* Struck through repros no longer work on HEAD.