===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.1.84-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.3/3562 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire: ffff88807c263a40 (&stab->lock ){+...}-{2:2} , at: __sock_map_delete net/core/sock_map.c:416 [inline] , at: sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448 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} -> ( &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+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_edge_irq+0x245/0xbf0 kernel/irq/chip.c:819 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 console_emit_next_record+0xd67/0x1000 kernel/printk/printk.c:2786 console_unlock+0x278/0x7c0 kernel/printk/printk.c:2906 vprintk_emit+0x523/0x740 kernel/printk/printk.c:2303 _printk+0xd1/0x111 kernel/printk/printk.c:2328 spectre_v2_select_mitigation+0x53f/0x7d3 arch/x86/kernel/cpu/bugs.c:1698 cpu_select_mitigations+0x3d/0x8f arch/x86/kernel/cpu/bugs.c:148 arch_cpu_finalize_init+0xf/0x81 arch/x86/kernel/cpu/common.c:2449 start_kernel+0x423/0x53f init/main.c:1106 secondary_startup_64_no_verify+0xcf/0xdb to a HARDIRQ-irq-unsafe lock: ( &stab->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_map_update_common+0x1b6/0x5b0 net/core/sock_map.c:492 sock_map_update_elem_sys+0x55b/0x910 net/core/sock_map.c:581 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(&stab->lock ); local_irq_disable(); lock(&rq->__lock ); lock( &stab->lock); lock(&rq->__lock ); *** DEADLOCK *** 3 locks held by syz-executor.3/3562: #0: ffffffff8d7184a8 (tomoyo_ss ){....}-{0:0} , at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] , at: srcu_read_lock include/linux/srcu.h:165 [inline] , at: tomoyo_read_lock security/tomoyo/common.h:1110 [inline] , at: tomoyo_path_perm+0x272/0x710 security/tomoyo/file.c:821 #1: ffff8880b983aa18 ( &rq->__lock){-.-.}-{2:2} , at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 #2: ffffffff8d12a980 (rcu_read_lock ){....}-{1:2} , at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] , at: rcu_read_lock include/linux/rcupdate.h:791 [inline] , at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] , at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312 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_edge_irq+0x245/0xbf0 kernel/irq/chip.c:819 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 console_emit_next_record+0xd67/0x1000 kernel/printk/printk.c:2786 console_unlock+0x278/0x7c0 kernel/printk/printk.c:2906 vprintk_emit+0x523/0x740 kernel/printk/printk.c:2303 _printk+0xd1/0x111 kernel/printk/printk.c:2328 spectre_v2_select_mitigation+0x53f/0x7d3 arch/x86/kernel/cpu/bugs.c:1698 cpu_select_mitigations+0x3d/0x8f arch/x86/kernel/cpu/bugs.c:148 arch_cpu_finalize_init+0xf/0x81 arch/x86/kernel/cpu/common.c:2449 start_kernel+0x423/0x53f init/main.c:1106 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: -> (&stab->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_map_update_common+0x1b6/0x5b0 net/core/sock_map.c:492 sock_map_update_elem_sys+0x55b/0x910 net/core/sock_map.c:581 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_map_update_common+0x1b6/0x5b0 net/core/sock_map.c:492 sock_map_update_elem_sys+0x55b/0x910 net/core/sock_map.c:581 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_map_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_map_delete net/core/sock_map.c:416 [inline] sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448 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_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 trace_tlb_flush+0x151/0x1a0 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x84a/0xc20 context_switch kernel/sched/core.c:5230 [inline] __schedule+0x1140/0x4550 kernel/sched/core.c:6558 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6870 irqentry_exit+0x53/0x80 kernel/entry/common.c:439 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 variable_test_bit arch/x86/include/asm/bitops.h:228 [inline] arch_test_bit arch/x86/include/asm/bitops.h:240 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] tomoyo_check_acl+0x2ce/0x3e0 security/tomoyo/domain.c:184 tomoyo_path_permission+0x1af/0x360 security/tomoyo/file.c:586 tomoyo_path_perm+0x478/0x710 security/tomoyo/file.c:838 security_inode_getattr+0xcf/0x120 security/security.c:1361 vfs_getattr+0x26/0x360 fs/stat.c:158 vfs_statx+0x194/0x4b0 fs/stat.c:233 vfs_fstatat fs/stat.c:267 [inline] __do_sys_newfstatat fs/stat.c:437 [inline] __se_sys_newfstatat fs/stat.c:431 [inline] __x64_sys_newfstatat+0x151/0x1e0 fs/stat.c:431 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: 3562 Comm: syz-executor.3 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_map_delete net/core/sock_map.c:416 [inline] sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448 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_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 trace_tlb_flush+0x151/0x1a0 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x84a/0xc20 context_switch kernel/sched/core.c:5230 [inline] __schedule+0x1140/0x4550 kernel/sched/core.c:6558 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6870 irqentry_exit+0x53/0x80 kernel/entry/common.c:439 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 RIP: 0010:variable_test_bit arch/x86/include/asm/bitops.h:228 [inline] RIP: 0010:arch_test_bit arch/x86/include/asm/bitops.h:240 [inline] RIP: 0010:_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline] RIP: 0010:tomoyo_check_acl+0x2ce/0x3e0 security/tomoyo/domain.c:184 Code: 10 0f 83 1b 01 00 00 49 ff c4 49 8d 5c 24 ff 48 89 d8 48 c1 e8 06 49 8d 3c c6 be 08 00 00 00 e8 c8 aa ef fd 31 f6 49 0f a3 1e <40> 0f 93 c5 40 0f 92 c6 bf 02 00 00 00 e8 f0 34 98 fd 40 84 ed 74 RSP: 0018:ffffc90004e67918 EFLAGS: 00000246 RAX: 0000000000000001 RBX: 00000000000000fa RCX: ffffffff83f25448 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88802060d848 RBP: ffff88802843de01 R08: dffffc0000000000 R09: ffffed10040c1b0a R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000000000fb R13: dffffc0000000000 R14: ffff88802060d830 R15: ffff88802060d810 tomoyo_path_permission+0x1af/0x360 security/tomoyo/file.c:586 tomoyo_path_perm+0x478/0x710 security/tomoyo/file.c:838 security_inode_getattr+0xcf/0x120 security/security.c:1361 vfs_getattr+0x26/0x360 fs/stat.c:158 vfs_statx+0x194/0x4b0 fs/stat.c:233 vfs_fstatat fs/stat.c:267 [inline] __do_sys_newfstatat fs/stat.c:437 [inline] __se_sys_newfstatat fs/stat.c:431 [inline] __x64_sys_newfstatat+0x151/0x1e0 fs/stat.c:431 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:0x7f1e9c47c90a Code: Unable to access opcode bytes at 0x7f1e9c47c8e0. RSP: 002b:00007ffc4a906768 EFLAGS: 00000286 ORIG_RAX: 0000000000000106 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f1e9c47c90a RDX: 00007ffc4a906790 RSI: 00007ffc4a906820 RDI: 00000000ffffff9c RBP: 00007ffc4a906820 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000286 R12: 00007ffc4a9078e0 R13: 00007f1e9c4c93b9 R14: 000000000000f96d R15: 0000000000000007 ---------------- Code disassembly (best guess): 0: 10 0f adc %cl,(%rdi) 2: 83 1b 01 sbbl $0x1,(%rbx) 5: 00 00 add %al,(%rax) 7: 49 ff c4 inc %r12 a: 49 8d 5c 24 ff lea -0x1(%r12),%rbx f: 48 89 d8 mov %rbx,%rax 12: 48 c1 e8 06 shr $0x6,%rax 16: 49 8d 3c c6 lea (%r14,%rax,8),%rdi 1a: be 08 00 00 00 mov $0x8,%esi 1f: e8 c8 aa ef fd call 0xfdefaaec 24: 31 f6 xor %esi,%esi 26: 49 0f a3 1e bt %rbx,(%r14) * 2a: 40 0f 93 c5 setae %bpl <-- trapping instruction 2e: 40 0f 92 c6 setb %sil 32: bf 02 00 00 00 mov $0x2,%edi 37: e8 f0 34 98 fd call 0xfd98352c 3c: 40 84 ed test %bpl,%bpl 3f: 74 .byte 0x74