===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.1.84-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.1/3772 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire: ffff88807491d820 (&htab->buckets[i].lock){+...}-{2:2}, at: sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:932 and this task is already holding: ffff88807bb0ae58 (&sighand->siglock){-...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline] ffff88807bb0ae58 (&sighand->siglock){-...}-{2:2}, at: get_signal+0x242/0x17d0 kernel/signal.c:2655 which would create a new lock dependency: (&sighand->siglock){-...}-{2:2} -> (&htab->buckets[i].lock){+...}-{2:2} but this new dependency connects a HARDIRQ-irq-safe lock: (&sighand->siglock){-...}-{2:2} ... which became HARDIRQ-irq-safe at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 __lock_task_sighand+0x145/0x2d0 kernel/signal.c:1410 lock_task_sighand include/linux/sched/signal.h:745 [inline] send_sigqueue+0x1de/0x720 kernel/signal.c:1978 posix_timer_event kernel/time/posix-timers.c:354 [inline] posix_timer_fn+0x186/0x390 kernel/time/posix-timers.c:380 __run_hrtimer kernel/time/hrtimer.c:1686 [inline] __hrtimer_run_queues+0x5e5/0xe50 kernel/time/hrtimer.c:1750 hrtimer_interrupt+0x392/0x980 kernel/time/hrtimer.c:1812 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1095 [inline] __sysvec_apic_timer_interrupt+0x156/0x580 arch/x86/kernel/apic/apic.c:1112 sysvec_apic_timer_interrupt+0x8c/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194 try_to_wake_up+0x7dd/0x12e0 kernel/sched/core.c:4230 wake_up_process kernel/sched/core.c:4362 [inline] wake_up_q+0x8b/0xd0 kernel/sched/core.c:1007 futex_wake+0x4ea/0x590 kernel/futex/waitwake.c:184 do_futex+0x375/0x490 kernel/futex/syscalls.c:111 __do_sys_futex kernel/futex/syscalls.c:183 [inline] __se_sys_futex+0x3d7/0x460 kernel/futex/syscalls.c:164 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd to a HARDIRQ-irq-unsafe lock: (&htab->buckets[i].lock){+...}-{2:2} ... which became HARDIRQ-irq-unsafe at: ... lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_free+0x160/0x820 net/core/sock_map.c:1149 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:307 other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&htab->buckets[i].lock); local_irq_disable(); lock(&sighand->siglock); lock(&htab->buckets[i].lock); lock(&sighand->siglock); *** DEADLOCK *** 2 locks held by syz-executor.1/3772: #0: ffff88807bb0ae58 (&sighand->siglock){-...}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline] #0: ffff88807bb0ae58 (&sighand->siglock){-...}-{2:2}, at: get_signal+0x242/0x17d0 kernel/signal.c:2655 #1: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #1: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #1: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #1: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x146/0x440 kernel/trace/bpf_trace.c:2313 the dependencies between HARDIRQ-irq-safe lock and the holding lock: -> (&sighand->siglock){-...}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 __lock_task_sighand+0x145/0x2d0 kernel/signal.c:1410 lock_task_sighand include/linux/sched/signal.h:745 [inline] send_sigqueue+0x1de/0x720 kernel/signal.c:1978 posix_timer_event kernel/time/posix-timers.c:354 [inline] posix_timer_fn+0x186/0x390 kernel/time/posix-timers.c:380 __run_hrtimer kernel/time/hrtimer.c:1686 [inline] __hrtimer_run_queues+0x5e5/0xe50 kernel/time/hrtimer.c:1750 hrtimer_interrupt+0x392/0x980 kernel/time/hrtimer.c:1812 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1095 [inline] __sysvec_apic_timer_interrupt+0x156/0x580 arch/x86/kernel/apic/apic.c:1112 sysvec_apic_timer_interrupt+0x8c/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194 try_to_wake_up+0x7dd/0x12e0 kernel/sched/core.c:4230 wake_up_process kernel/sched/core.c:4362 [inline] wake_up_q+0x8b/0xd0 kernel/sched/core.c:1007 futex_wake+0x4ea/0x590 kernel/futex/waitwake.c:184 do_futex+0x375/0x490 kernel/futex/syscalls.c:111 __do_sys_futex kernel/futex/syscalls.c:183 [inline] __se_sys_futex+0x3d7/0x460 kernel/futex/syscalls.c:164 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd INITIAL USE at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:376 [inline] calculate_sigpending+0x4a/0x80 kernel/signal.c:195 ret_from_fork+0x8/0x30 arch/x86/entry/entry_64.S:292 } ... key at: [] sighand_ctor.__key+0x0/0x20 the dependencies between the lock to be acquired and HARDIRQ-irq-unsafe lock: -> (&htab->buckets[i].lock){+...}-{2:2} { HARDIRQ-ON-W at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_free+0x160/0x820 net/core/sock_map.c:1149 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:307 INITIAL USE at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_free+0x160/0x820 net/core/sock_map.c:1149 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:307 } ... key at: [] sock_hash_alloc.__key+0x0/0x20 ... acquired at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:932 bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:114 __traceiter_kmem_cache_free+0x2e/0x50 include/trace/events/kmem.h:114 trace_kmem_cache_free include/trace/events/kmem.h:114 [inline] kmem_cache_free+0x418/0x510 mm/slub.c:3682 __sigqueue_free kernel/signal.c:458 [inline] dequeue_synchronous_signal kernel/signal.c:752 [inline] get_signal+0xbdd/0x17d0 kernel/signal.c:2740 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316 exc_page_fault+0x1c0/0x660 arch/x86/mm/fault.c:1521 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 stack backtrace: CPU: 1 PID: 3772 Comm: syz-executor.1 Not tainted 6.1.84-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __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_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:932 bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:114 __traceiter_kmem_cache_free+0x2e/0x50 include/trace/events/kmem.h:114 trace_kmem_cache_free include/trace/events/kmem.h:114 [inline] kmem_cache_free+0x418/0x510 mm/slub.c:3682 __sigqueue_free kernel/signal.c:458 [inline] dequeue_synchronous_signal kernel/signal.c:752 [inline] get_signal+0xbdd/0x17d0 kernel/signal.c:2740 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316 exc_page_fault+0x1c0/0x660 arch/x86/mm/fault.c:1521 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fee73a5ef18 Code: fc 89 37 c3 c5 fa 6f 06 c5 fa 6f 4c 16 f0 c5 fa 7f 07 c5 fa 7f 4c 17 f0 c3 66 0f 1f 84 00 00 00 00 00 48 8b 4c 16 f8 48 8b 36 <48> 89 37 48 89 4c 17 f8 c3 c5 fe 6f 54 16 e0 c5 fe 6f 5c 16 c0 c5 RSP: 002b:00007fff264e2f58 EFLAGS: 00010246 RAX: 0000000020000040 RBX: 00007fff264e3068 RCX: 0030656c69662f2e RDX: 0000000000000008 RSI: 0030656c69662f2e RDI: 0000000020000040 RBP: 0000000000000032 R08: 00007fee73a00000 R09: 00000000000003e9 R10: 00000000813291e3 R11: 0000000000000246 R12: 00007fee736015d8 R13: fffffffffffffffe R14: 00007fee73600000 R15: 00007fee736015e0