===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.8.0-syzkaller-05236-g443574b03387 #0 Not tainted ----------------------------------------------------- syz-executor.3/5874 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire: ffff8880254a6a00 (&stab->lock ){+...}-{2:2} , at: spin_lock_bh include/linux/spinlock.h:356 [inline] , at: __sock_map_delete net/core/sock_map.c:414 [inline] , at: sock_map_delete_elem+0x97/0x140 net/core/sock_map.c:446 and this task is already holding: ffff8880b943e158 (&rq->__lock ){-.-.}-{2:2} , at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559 which would create a new lock dependency: ( &rq->__lock){-.-.}-{2:2} -> ( &stab->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+0x1e4/0x530 kernel/locking/lockdep.c:5754 _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559 raw_spin_rq_lock kernel/sched/sched.h:1385 [inline] rq_lock kernel/sched/sched.h:1699 [inline] scheduler_tick+0xa1/0x6e0 kernel/sched/core.c:5679 update_process_times+0x202/0x230 kernel/time/timer.c:2481 tick_periodic+0x190/0x220 kernel/time/tick-common.c:100 tick_handle_periodic+0x4a/0x160 kernel/time/tick-common.c:112 timer_interrupt+0x5c/0x70 arch/x86/kernel/time.c:57 __handle_irq_event_percpu+0x28c/0xa30 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0x89/0x1f0 kernel/irq/handle.c:210 handle_level_irq+0x3c5/0x6e0 kernel/irq/chip.c:648 generic_handle_irq_desc include/linux/irqdesc.h:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0x13a/0x230 arch/x86/kernel/irq.c:257 common_interrupt+0xa5/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 __setup_irq+0x1277/0x1cf0 kernel/irq/manage.c:1818 request_threaded_irq+0x2ab/0x380 kernel/irq/manage.c:2202 request_irq include/linux/interrupt.h:168 [inline] setup_default_timer_irq+0x25/0x60 arch/x86/kernel/time.c:70 x86_late_time_init+0x66/0xc0 arch/x86/kernel/time.c:94 start_kernel+0x3f3/0x500 init/main.c:1039 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 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_update_common+0x1b6/0x5b0 net/core/sock_map.c:490 sock_map_update_elem_sys+0x55f/0x910 net/core/sock_map.c:579 map_update_elem+0x53a/0x6f0 kernel/bpf/syscall.c:1641 __sys_bpf+0x76f/0x810 kernel/bpf/syscall.c:5619 __do_sys_bpf kernel/bpf/syscall.c:5738 [inline] __se_sys_bpf kernel/bpf/syscall.c:5736 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5736 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(&rq->__lock ); lock( &stab->lock); lock( &rq->__lock); *** DEADLOCK *** 3 locks held by syz-executor.3/5874: #0: ffff88807c0a4420 (sb_writers #4){.+.+}-{0:0} , at: do_coredump+0x1b79/0x2b50 fs/coredump.c:763 #1: ffff8880b943e158 (&rq->__lock ){-.-.}-{2:2} , at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559 #2: ffffffff8e131920 (rcu_read_lock ){....}-{1:2} , at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline] , at: rcu_read_lock include/linux/rcupdate.h:750 [inline] , at: __bpf_trace_run kernel/trace/bpf_trace.c:2380 [inline] , at: bpf_trace_run2+0x114/0x420 kernel/trace/bpf_trace.c:2420 the dependencies between HARDIRQ-irq-safe lock and the holding lock: -> ( &rq->__lock){-.-.}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559 raw_spin_rq_lock kernel/sched/sched.h:1385 [inline] rq_lock kernel/sched/sched.h:1699 [inline] scheduler_tick+0xa1/0x6e0 kernel/sched/core.c:5679 update_process_times+0x202/0x230 kernel/time/timer.c:2481 tick_periodic+0x190/0x220 kernel/time/tick-common.c:100 tick_handle_periodic+0x4a/0x160 kernel/time/tick-common.c:112 timer_interrupt+0x5c/0x70 arch/x86/kernel/time.c:57 __handle_irq_event_percpu+0x28c/0xa30 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0x89/0x1f0 kernel/irq/handle.c:210 handle_level_irq+0x3c5/0x6e0 kernel/irq/chip.c:648 generic_handle_irq_desc include/linux/irqdesc.h:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0x13a/0x230 arch/x86/kernel/irq.c:257 common_interrupt+0xa5/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 __setup_irq+0x1277/0x1cf0 kernel/irq/manage.c:1818 request_threaded_irq+0x2ab/0x380 kernel/irq/manage.c:2202 request_irq include/linux/interrupt.h:168 [inline] setup_default_timer_irq+0x25/0x60 arch/x86/kernel/time.c:70 x86_late_time_init+0x66/0xc0 arch/x86/kernel/time.c:94 start_kernel+0x3f3/0x500 init/main.c:1039 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 IN-SOFTIRQ-W at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559 raw_spin_rq_lock kernel/sched/sched.h:1385 [inline] rq_lock kernel/sched/sched.h:1699 [inline] ttwu_queue kernel/sched/core.c:4055 [inline] try_to_wake_up+0x7d3/0x1470 kernel/sched/core.c:4378 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_nested+0x31/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:559 raw_spin_rq_lock kernel/sched/sched.h:1385 [inline] _raw_spin_rq_lock_irqsave kernel/sched/sched.h:1404 [inline] rq_lock_irqsave kernel/sched/sched.h:1683 [inline] rq_attach_root+0xee/0x540 kernel/sched/topology.c:494 sched_init+0x64e/0xc30 kernel/sched/core.c:10031 start_kernel+0x1ab/0x500 init/main.c:948 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: [] sched_init.__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_update_common+0x1b6/0x5b0 net/core/sock_map.c:490 sock_map_update_elem_sys+0x55f/0x910 net/core/sock_map.c:579 map_update_elem+0x53a/0x6f0 kernel/bpf/syscall.c:1641 __sys_bpf+0x76f/0x810 kernel/bpf/syscall.c:5619 __do_sys_bpf kernel/bpf/syscall.c:5738 [inline] __se_sys_bpf kernel/bpf/syscall.c:5736 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5736 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 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_update_common+0x1b6/0x5b0 net/core/sock_map.c:490 sock_map_update_elem_sys+0x55f/0x910 net/core/sock_map.c:579 map_update_elem+0x53a/0x6f0 kernel/bpf/syscall.c:1641 __sys_bpf+0x76f/0x810 kernel/bpf/syscall.c:5619 __do_sys_bpf kernel/bpf/syscall.c:5738 [inline] __se_sys_bpf kernel/bpf/syscall.c:5736 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5736 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 } ... key at: [] 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_tlb_flush+0xfa/0x120 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x7cb/0xae0 context_switch kernel/sched/core.c:5393 [inline] __schedule+0x1054/0x4a20 kernel/sched/core.c:6736 preempt_schedule_irq+0xfb/0x1c0 kernel/sched/core.c:7058 irqentry_exit+0x5e/0x90 kernel/entry/common.c:348 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 check_kcov_mode kernel/kcov.c:173 [inline] write_comp_data kernel/kcov.c:236 [inline] __sanitizer_cov_trace_const_cmp8+0x2f/0x90 kernel/kcov.c:311 get_dump_page+0x1cd/0x2f0 mm/gup.c:2033 dump_user_range+0x14c/0x950 fs/coredump.c:949 elf_core_dump+0x3d5e/0x4630 fs/binfmt_elf.c:2077 do_coredump+0x1bab/0x2b50 fs/coredump.c:764 get_signal+0x146b/0x1850 kernel/signal.c:2893 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:105 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x79/0x270 kernel/entry/common.c:225 exc_page_fault+0x585/0x890 arch/x86/mm/fault.c:1566 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 stack backtrace: CPU: 0 PID: 5874 Comm: syz-executor.3 Not tainted 6.8.0-syzkaller-05236-g443574b03387 #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+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_tlb_flush+0xfa/0x120 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x7cb/0xae0 context_switch kernel/sched/core.c:5393 [inline] __schedule+0x1054/0x4a20 kernel/sched/core.c:6736 preempt_schedule_irq+0xfb/0x1c0 kernel/sched/core.c:7058 irqentry_exit+0x5e/0x90 kernel/entry/common.c:348 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:check_kcov_mode kernel/kcov.c:175 [inline] RIP: 0010:write_comp_data kernel/kcov.c:236 [inline] RIP: 0010:__sanitizer_cov_trace_const_cmp8+0x2f/0x90 kernel/kcov.c:311 Code: 8b 04 24 65 48 8b 0c 25 80 ce 03 00 65 8b 05 20 d9 6e 7e a9 00 01 ff 00 74 10 a9 00 01 00 00 74 57 83 b9 14 16 00 00 00 74 4e <8b> 81 f0 15 00 00 83 f8 03 75 43 48 8b 91 f8 15 00 00 44 8b 89 f4 RSP: 0018:ffffc900058d7298 EFLAGS: 00000246 RAX: 0000000080000000 RBX: 00000000fffffff2 RCX: ffff8880207e5a00 RDX: 0000000000000001 RSI: 00000000fffffff2 RDI: 0000000000000001 RBP: ffffc900058d7370 R08: ffffffff81de517d R09: 1ffff11005ba24e6 R10: dffffc0000000000 R11: ffffed1005ba24e7 R12: 1ffff92000b1ae5c R13: dffffc0000000000 R14: 1ffff92000b1ae58 R15: fffffffffffffff2 get_dump_page+0x1cd/0x2f0 mm/gup.c:2033 dump_user_range+0x14c/0x950 fs/coredump.c:949 elf_core_dump+0x3d5e/0x4630 fs/binfmt_elf.c:2077 do_coredump+0x1bab/0x2b50 fs/coredump.c:764 get_signal+0x146b/0x1850 kernel/signal.c:2893 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:105 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x79/0x270 kernel/entry/common.c:225 exc_page_fault+0x585/0x890 arch/x86/mm/fault.c:1566 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x7f9929028777 Code: Unable to access opcode bytes at 0x7f992902874d. RSP: 002b:00007f9928be01e0 EFLAGS: 00010202 RAX: 0000000000000000 RBX: 000000000000000b RCX: 00007f992907dea9 RDX: 00007f9928be0200 RSI: 00007f9928be0330 RDI: 000000000000000b RBP: 00007f99290ca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 000000000000000b R14: 00007f99291abf80 R15: 00007ffd25592708 ---------------- Code disassembly (best guess): 0: 8b 04 24 mov (%rsp),%eax 3: 65 48 8b 0c 25 80 ce mov %gs:0x3ce80,%rcx a: 03 00 c: 65 8b 05 20 d9 6e 7e mov %gs:0x7e6ed920(%rip),%eax # 0x7e6ed933 13: a9 00 01 ff 00 test $0xff0100,%eax 18: 74 10 je 0x2a 1a: a9 00 01 00 00 test $0x100,%eax 1f: 74 57 je 0x78 21: 83 b9 14 16 00 00 00 cmpl $0x0,0x1614(%rcx) 28: 74 4e je 0x78 * 2a: 8b 81 f0 15 00 00 mov 0x15f0(%rcx),%eax <-- trapping instruction 30: 83 f8 03 cmp $0x3,%eax 33: 75 43 jne 0x78 35: 48 8b 91 f8 15 00 00 mov 0x15f8(%rcx),%rdx 3c: 44 rex.R 3d: 8b .byte 0x8b 3e: 89 f4 mov %esi,%esp