===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.1.84-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.1/3900 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire: ffff888057487968 (&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: ffff8880b983aa18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 which would create a new lock dependency: (&rq->__lock){-.-.}-{2:2} -> (&htab->buckets[i].lock){+...}-{2:2} but this new dependency connects a HARDIRQ-irq-safe lock: (&rq->__lock){-.-.}-{2:2} ... which became HARDIRQ-irq-safe at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 raw_spin_rq_lock kernel/sched/sched.h:1354 [inline] rq_lock kernel/sched/sched.h:1644 [inline] scheduler_tick+0x9d/0x550 kernel/sched/core.c:5513 update_process_times+0x17b/0x1b0 kernel/time/timer.c:1874 tick_periodic+0x197/0x210 kernel/time/tick-common.c:100 tick_handle_periodic+0x46/0x150 kernel/time/tick-common.c:112 timer_interrupt+0x4d/0x60 arch/x86/kernel/time.c:57 __handle_irq_event_percpu+0x2a8/0xb20 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0x85/0x1e0 kernel/irq/handle.c:210 handle_level_irq+0x3ab/0x6c0 kernel/irq/chip.c:650 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:231 [inline] __common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250 common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194 __setup_irq+0x12fa/0x1d80 kernel/irq/manage.c:1809 request_threaded_irq+0x2a7/0x380 kernel/irq/manage.c:2198 request_irq include/linux/interrupt.h:168 [inline] setup_default_timer_irq+0x1f/0x30 arch/x86/kernel/time.c:70 x86_late_time_init+0x51/0x86 arch/x86/kernel/time.c:94 start_kernel+0x414/0x53f init/main.c:1102 secondary_startup_64_no_verify+0xcf/0xdb 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_update_common+0x20c/0xa30 net/core/sock_map.c:1000 sock_map_update_elem_sys+0x5a0/0x910 net/core/sock_map.c:583 map_update_elem+0x503/0x680 kernel/bpf/syscall.c:1448 __sys_bpf+0x337/0x6c0 kernel/bpf/syscall.c:4993 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107 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 other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&htab->buckets[i].lock); local_irq_disable(); lock(&rq->__lock); lock(&htab->buckets[i].lock); lock(&rq->__lock); *** DEADLOCK *** 6 locks held by syz-executor.1/3900: #0: ffffffff8d1713e8 (tracepoints_mutex){+.+.}-{3:3}, at: tracepoint_probe_register_prio_may_exist+0xb7/0x190 kernel/tracepoint.c:478 #1: ffffffff8cfc7d70 (cpu_hotplug_lock){++++}-{0:0}, at: static_key_enable+0xe/0x20 kernel/jump_label.c:189 #2: ffffffff8d1c7008 (jump_label_mutex){+.+.}-{3:3}, at: jump_label_lock kernel/jump_label.c:27 [inline] #2: ffffffff8d1c7008 (jump_label_mutex){+.+.}-{3:3}, at: static_key_enable_cpuslocked+0xcf/0x250 kernel/jump_label.c:174 #3: ffffffff8cfdcc68 (text_mutex){+.+.}-{3:3}, at: arch_jump_label_transform_apply+0xe/0x20 arch/x86/kernel/jump_label.c:145 #4: ffff8880b983aa18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 #5: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #5: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #5: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #5: ffffffff8d12a980 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16a/0x470 kernel/trace/bpf_trace.c:2314 the dependencies between HARDIRQ-irq-safe lock and the holding lock: -> (&rq->__lock){-.-.}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 raw_spin_rq_lock kernel/sched/sched.h:1354 [inline] rq_lock kernel/sched/sched.h:1644 [inline] scheduler_tick+0x9d/0x550 kernel/sched/core.c:5513 update_process_times+0x17b/0x1b0 kernel/time/timer.c:1874 tick_periodic+0x197/0x210 kernel/time/tick-common.c:100 tick_handle_periodic+0x46/0x150 kernel/time/tick-common.c:112 timer_interrupt+0x4d/0x60 arch/x86/kernel/time.c:57 __handle_irq_event_percpu+0x2a8/0xb20 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0x85/0x1e0 kernel/irq/handle.c:210 handle_level_irq+0x3ab/0x6c0 kernel/irq/chip.c:650 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:231 [inline] __common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250 common_interrupt+0x9f/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194 __setup_irq+0x12fa/0x1d80 kernel/irq/manage.c:1809 request_threaded_irq+0x2a7/0x380 kernel/irq/manage.c:2198 request_irq include/linux/interrupt.h:168 [inline] setup_default_timer_irq+0x1f/0x30 arch/x86/kernel/time.c:70 x86_late_time_init+0x51/0x86 arch/x86/kernel/time.c:94 start_kernel+0x414/0x53f init/main.c:1102 secondary_startup_64_no_verify+0xcf/0xdb IN-SOFTIRQ-W at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 raw_spin_rq_lock kernel/sched/sched.h:1354 [inline] rq_lock kernel/sched/sched.h:1644 [inline] ttwu_queue kernel/sched/core.c:3903 [inline] try_to_wake_up+0x5bd/0x12e0 kernel/sched/core.c:4228 __queue_work+0xb4b/0xf90 kernel/workqueue.c:1520 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1544 [inline] __run_timers+0x6a8/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 native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline] default_idle+0xb/0x10 arch/x86/kernel/process.c:730 default_idle_call+0x84/0xc0 kernel/sched/idle.c:109 cpuidle_idle_call kernel/sched/idle.c:191 [inline] do_idle+0x251/0x680 kernel/sched/idle.c:303 cpu_startup_entry+0x3d/0x60 kernel/sched/idle.c:401 rest_init+0x2da/0x300 init/main.c:732 start_kernel+0x0/0x53f init/main.c:892 start_kernel+0x496/0x53f init/main.c:1139 secondary_startup_64_no_verify+0xcf/0xdb INITIAL USE at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 raw_spin_rq_lock kernel/sched/sched.h:1354 [inline] _raw_spin_rq_lock_irqsave kernel/sched/sched.h:1373 [inline] rq_attach_root+0xec/0x540 kernel/sched/topology.c:490 sched_init+0x6c7/0xcc9 kernel/sched/core.c:9787 start_kernel+0x1bf/0x53f init/main.c:1011 secondary_startup_64_no_verify+0xcf/0xdb } ... key at: [] sched_init.__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_update_common+0x20c/0xa30 net/core/sock_map.c:1000 sock_map_update_elem_sys+0x5a0/0x910 net/core/sock_map.c:583 map_update_elem+0x503/0x680 kernel/bpf/syscall.c:1448 __sys_bpf+0x337/0x6c0 kernel/bpf/syscall.c:4993 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107 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_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 sock_hash_update_common+0x20c/0xa30 net/core/sock_map.c:1000 sock_map_update_elem_sys+0x5a0/0x910 net/core/sock_map.c:583 map_update_elem+0x503/0x680 kernel/bpf/syscall.c:1448 __sys_bpf+0x337/0x6c0 kernel/bpf/syscall.c:4993 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107 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 } ... 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_a8aaa52f2e199321+0x42/0x46 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_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314 trace_sched_switch include/trace/events/sched.h:222 [inline] __schedule+0x2116/0x4550 kernel/sched/core.c:6555 preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6727 preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6751 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34 on_each_cpu_cond_mask+0x71/0x80 kernel/smp.c:1167 on_each_cpu include/linux/smp.h:71 [inline] text_poke_sync arch/x86/kernel/alternative.c:1334 [inline] text_poke_bp_batch+0x2bb/0x940 arch/x86/kernel/alternative.c:1534 text_poke_flush arch/x86/kernel/alternative.c:1725 [inline] text_poke_finish+0x16/0x30 arch/x86/kernel/alternative.c:1732 arch_jump_label_transform_apply+0x13/0x20 arch/x86/kernel/jump_label.c:146 static_key_enable_cpuslocked+0x12e/0x250 kernel/jump_label.c:177 static_key_enable+0x16/0x20 kernel/jump_label.c:190 tracepoint_add_func+0x947/0x9d0 kernel/tracepoint.c:361 tracepoint_probe_register_prio_may_exist+0x11e/0x190 kernel/tracepoint.c:482 bpf_raw_tp_link_attach+0x456/0x6b0 kernel/bpf/syscall.c:3372 bpf_raw_tracepoint_open+0x196/0x210 kernel/bpf/syscall.c:3399 __sys_bpf+0x4a7/0x6c0 kernel/bpf/syscall.c:5047 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107 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 stack backtrace: CPU: 0 PID: 3900 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_a8aaa52f2e199321+0x42/0x46 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_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314 trace_sched_switch include/trace/events/sched.h:222 [inline] __schedule+0x2116/0x4550 kernel/sched/core.c:6555 preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6727 preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6751 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34 on_each_cpu_cond_mask+0x71/0x80 kernel/smp.c:1167 on_each_cpu include/linux/smp.h:71 [inline] text_poke_sync arch/x86/kernel/alternative.c:1334 [inline] text_poke_bp_batch+0x2bb/0x940 arch/x86/kernel/alternative.c:1534 text_poke_flush arch/x86/kernel/alternative.c:1725 [inline] text_poke_finish+0x16/0x30 arch/x86/kernel/alternative.c:1732 arch_jump_label_transform_apply+0x13/0x20 arch/x86/kernel/jump_label.c:146 static_key_enable_cpuslocked+0x12e/0x250 kernel/jump_label.c:177 static_key_enable+0x16/0x20 kernel/jump_label.c:190 tracepoint_add_func+0x947/0x9d0 kernel/tracepoint.c:361 tracepoint_probe_register_prio_may_exist+0x11e/0x190 kernel/tracepoint.c:482 bpf_raw_tp_link_attach+0x456/0x6b0 kernel/bpf/syscall.c:3372 bpf_raw_tracepoint_open+0x196/0x210 kernel/bpf/syscall.c:3399 __sys_bpf+0x4a7/0x6c0 kernel/bpf/syscall.c:5047 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107 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 RIP: 0033:0x7f3feb07de69 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:00007f3febddf0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f3feb1abf80 RCX: 00007f3feb07de69 RDX: 0000000000000010 RSI: 0000000020000b40 RDI: 0000000000000011 RBP: 00007f3feb0ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f3feb1abf80 R15: 00007fff6acb7098