===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 5.15.153-syzkaller #0 Not tainted ----------------------------------------------------- syz-fuzzer/3628 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire: ffff8880740fc020 (&htab->buckets[i].lock){+.-.}-{2:2}, at: sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 and this task is already holding: ffff888022e39bd8 (&sighand->siglock){-.-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:388 [inline] ffff888022e39bd8 (&sighand->siglock){-.-.}-{2:2}, at: get_signal+0x20e/0x14e0 kernel/signal.c:2686 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+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __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+0x11a/0x290 kernel/signal.c:1404 lock_task_sighand include/linux/sched/signal.h:704 [inline] send_sigqueue+0x1bc/0x6e0 kernel/signal.c:1971 posix_timer_event kernel/time/posix-timers.c:359 [inline] posix_timer_fn+0x186/0x390 kernel/time/posix-timers.c:385 __run_hrtimer kernel/time/hrtimer.c:1686 [inline] __hrtimer_run_queues+0x598/0xcf0 kernel/time/hrtimer.c:1750 hrtimer_interrupt+0x392/0x980 kernel/time/hrtimer.c:1812 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1085 [inline] __sysvec_apic_timer_interrupt+0x139/0x470 arch/x86/kernel/apic/apic.c:1102 sysvec_apic_timer_interrupt+0x8c/0xb0 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline] _raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:418 [inline] unlock_timer kernel/time/posix-timers.c:171 [inline] do_timer_settime+0x2d2/0x330 kernel/time/posix-timers.c:941 __do_sys_timer_settime kernel/time/posix-timers.c:961 [inline] __se_sys_timer_settime kernel/time/posix-timers.c:947 [inline] __x64_sys_timer_settime+0x1a2/0x250 kernel/time/posix-timers.c:947 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb to a HARDIRQ-irq-unsafe lock: (&htab->buckets[i].lock){+.-.}-{2:2} ... which became HARDIRQ-irq-unsafe at: ... lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 0xffffffffa001866e bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 __bpf_trace_sys_enter+0x60/0x70 include/trace/events/syscalls.h:18 trace_sys_enter include/trace/events/syscalls.h:18 [inline] syscall_trace_enter kernel/entry/common.c:77 [inline] __syscall_enter_from_user_work kernel/entry/common.c:90 [inline] syscall_enter_from_user_mode+0x1fd/0x230 kernel/entry/common.c:108 do_syscall_64+0x1e/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x61/0xcb 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-fuzzer/3628: #0: ffff888022e39bd8 (&sighand->siglock){-.-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:388 [inline] #0: ffff888022e39bd8 (&sighand->siglock){-.-.}-{2:2}, at: get_signal+0x20e/0x14e0 kernel/signal.c:2686 #1: ffffffff8c91f720 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 the dependencies between HARDIRQ-irq-safe lock and the holding lock: -> (&sighand->siglock){-.-.}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __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+0x11a/0x290 kernel/signal.c:1404 lock_task_sighand include/linux/sched/signal.h:704 [inline] send_sigqueue+0x1bc/0x6e0 kernel/signal.c:1971 posix_timer_event kernel/time/posix-timers.c:359 [inline] posix_timer_fn+0x186/0x390 kernel/time/posix-timers.c:385 __run_hrtimer kernel/time/hrtimer.c:1686 [inline] __hrtimer_run_queues+0x598/0xcf0 kernel/time/hrtimer.c:1750 hrtimer_interrupt+0x392/0x980 kernel/time/hrtimer.c:1812 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1085 [inline] __sysvec_apic_timer_interrupt+0x139/0x470 arch/x86/kernel/apic/apic.c:1102 sysvec_apic_timer_interrupt+0x8c/0xb0 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline] _raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:418 [inline] unlock_timer kernel/time/posix-timers.c:171 [inline] do_timer_settime+0x2d2/0x330 kernel/time/posix-timers.c:941 __do_sys_timer_settime kernel/time/posix-timers.c:961 [inline] __se_sys_timer_settime kernel/time/posix-timers.c:947 [inline] __x64_sys_timer_settime+0x1a2/0x250 kernel/time/posix-timers.c:947 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb IN-SOFTIRQ-W at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __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+0x11a/0x290 kernel/signal.c:1404 lock_task_sighand include/linux/sched/signal.h:704 [inline] send_sigqueue+0x1bc/0x6e0 kernel/signal.c:1971 posix_timer_event kernel/time/posix-timers.c:359 [inline] posix_timer_fn+0x186/0x390 kernel/time/posix-timers.c:385 __run_hrtimer kernel/time/hrtimer.c:1686 [inline] __hrtimer_run_queues+0x598/0xcf0 kernel/time/hrtimer.c:1750 hrtimer_interrupt+0x392/0x980 kernel/time/hrtimer.c:1812 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1085 [inline] __sysvec_apic_timer_interrupt+0x139/0x470 arch/x86/kernel/apic/apic.c:1102 sysvec_apic_timer_interrupt+0x3e/0xb0 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 unwind_next_frame+0xb47/0x1fa0 arch/x86/kernel/unwind_orc.c:539 __unwind_start+0x59d/0x720 arch/x86/kernel/unwind_orc.c:704 unwind_start arch/x86/include/asm/unwind.h:60 [inline] arch_stack_walk+0xdb/0x140 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122 kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3596 neigh_del net/core/neighbour.c:197 [inline] neigh_remove_one+0x4b1/0x5c0 net/core/neighbour.c:218 neigh_forced_gc net/core/neighbour.c:251 [inline] neigh_alloc net/core/neighbour.c:429 [inline] ___neigh_create+0x45a/0x2220 net/core/neighbour.c:591 ip6_finish_output2+0x11aa/0x14f0 net/ipv6/ip6_output.c:123 dst_output include/net/dst.h:443 [inline] NF_HOOK include/linux/netfilter.h:302 [inline] ndisc_send_skb+0xae0/0x13c0 net/ipv6/ndisc.c:509 addrconf_rs_timer+0x357/0x610 net/ipv6/addrconf.c:3957 call_timer_fn+0x16d/0x560 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1737 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1750 __do_softirq+0x3b3/0x93a kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x155/0x240 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 arch_test_and_set_bit arch/x86/include/asm/bitops.h:138 [inline] test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline] queue_delayed_work_on+0x1fd/0x250 kernel/workqueue.c:1714 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 INITIAL USE at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:388 [inline] calculate_sigpending+0x4a/0x80 kernel/signal.c:195 ret_from_fork+0x8/0x30 arch/x86/entry/entry_64.S:283 } ... 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+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 0xffffffffa001866e bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 __bpf_trace_sys_enter+0x60/0x70 include/trace/events/syscalls.h:18 trace_sys_enter include/trace/events/syscalls.h:18 [inline] syscall_trace_enter kernel/entry/common.c:77 [inline] __syscall_enter_from_user_work kernel/entry/common.c:90 [inline] syscall_enter_from_user_mode+0x1fd/0x230 kernel/entry/common.c:108 do_syscall_64+0x1e/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x61/0xcb IN-SOFTIRQ-W at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 bpf_prog_2c29ac5cdc6b1842+0x376/0x594 bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run3+0x1d1/0x380 kernel/trace/bpf_trace.c:1918 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:138 trace_kmem_cache_free include/trace/events/kmem.h:138 [inline] kmem_cache_free+0x1ce/0x1f0 mm/slub.c:3516 kfree_skb include/linux/skbuff.h:1123 [inline] __netif_receive_skb_core+0x3881/0x3df0 net/core/dev.c:5459 __netif_receive_skb_one_core net/core/dev.c:5483 [inline] __netif_receive_skb+0x11c/0x530 net/core/dev.c:5599 process_backlog+0x363/0x7f0 net/core/dev.c:6476 __napi_poll+0xc7/0x440 net/core/dev.c:7035 napi_poll net/core/dev.c:7102 [inline] net_rx_action+0x617/0xda0 net/core/dev.c:7192 __do_softirq+0x3b3/0x93a kernel/softirq.c:558 do_softirq+0x162/0x240 kernel/softirq.c:459 __local_bh_enable_ip+0x1b1/0x1f0 kernel/softirq.c:383 rcu_read_unlock_bh include/linux/rcupdate.h:809 [inline] __dev_queue_xmit+0x1c56/0x3230 net/core/dev.c:4275 batadv_send_skb_packet+0x3ae/0x5f0 net/batman-adv/send.c:108 batadv_iv_ogm_send_to_if net/batman-adv/bat_iv_ogm.c:393 [inline] batadv_iv_ogm_emit net/batman-adv/bat_iv_ogm.c:421 [inline] batadv_iv_send_outstanding_bat_ogm_packet+0x66f/0x800 net/batman-adv/bat_iv_ogm.c:1701 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 INITIAL USE at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 0xffffffffa001866e bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 __bpf_trace_sys_enter+0x60/0x70 include/trace/events/syscalls.h:18 trace_sys_enter include/trace/events/syscalls.h:18 [inline] syscall_trace_enter kernel/entry/common.c:77 [inline] __syscall_enter_from_user_work kernel/entry/common.c:90 [inline] syscall_enter_from_user_mode+0x1fd/0x230 kernel/entry/common.c:108 do_syscall_64+0x1e/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x61/0xcb } ... key at: [] sock_hash_alloc.__key+0x0/0x20 ... acquired at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 bpf_prog_2c29ac5cdc6b1842+0x3a/0x594 bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run3+0x1d1/0x380 kernel/trace/bpf_trace.c:1918 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:138 trace_kmem_cache_free include/trace/events/kmem.h:138 [inline] kmem_cache_free+0x1ce/0x1f0 mm/slub.c:3516 __sigqueue_free kernel/signal.c:458 [inline] collect_signal kernel/signal.c:597 [inline] __dequeue_signal+0x4ac/0x5c0 kernel/signal.c:619 dequeue_signal+0xab/0x520 kernel/signal.c:637 get_signal+0x52e/0x14e0 kernel/signal.c:2770 arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:172 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208 irqentry_exit_to_user_mode+0x5/0x40 kernel/entry/common.c:314 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 stack backtrace: CPU: 0 PID: 3628 Comm: syz-fuzzer Not tainted 5.15.153-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:2567 [inline] check_irq_usage kernel/locking/lockdep.c:2806 [inline] check_prev_add kernel/locking/lockdep.c:3057 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x4d01/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 bpf_prog_2c29ac5cdc6b1842+0x3a/0x594 bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run3+0x1d1/0x380 kernel/trace/bpf_trace.c:1918 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:138 trace_kmem_cache_free include/trace/events/kmem.h:138 [inline] kmem_cache_free+0x1ce/0x1f0 mm/slub.c:3516 __sigqueue_free kernel/signal.c:458 [inline] collect_signal kernel/signal.c:597 [inline] __dequeue_signal+0x4ac/0x5c0 kernel/signal.c:619 dequeue_signal+0xab/0x520 kernel/signal.c:637 get_signal+0x52e/0x14e0 kernel/signal.c:2770 arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:172 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208 irqentry_exit_to_user_mode+0x5/0x40 kernel/entry/common.c:314 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0033:0x74797a Code: 31 f6 45 31 c9 45 31 c0 eb 51 31 ff eb 62 c1 e0 10 09 d0 c3 44 0f b6 13 41 01 d2 45 8d 1c 02 44 0f b6 63 01 45 01 e2 45 01 d3 <44> 0f b6 63 02 45 01 e2 45 01 d3 44 0f b6 63 03 43 8d 14 14 48 83 RSP: 002b:000000c000a18ce8 EFLAGS: 00000216 RAX: 0000000000886378 RBX: 000000c0001776c4 RCX: 000000000000093c RDX: 000000000000b235 RSI: 0000000000000000 RDI: 000000000000093c RBP: 000000c000a18d10 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000b312 R11: 000000000089c921 R12: 000000000000007b R13: 0000000000000004 R14: 000000c0000061a0 R15: 000000000000018b