===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 5.15.153-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.1/4737 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire: ffff8880631c39c0 (&stab->lock){+.-.}-{2:2}, at: __sock_map_delete net/core/sock_map.c:416 [inline] ffff8880631c39c0 (&stab->lock){+.-.}-{2:2}, at: sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448 and this task is already holding: ffff88801a6f1298 (&sighand->siglock){-...}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] ffff88801a6f1298 (&sighand->siglock){-...}-{2:2}, at: __exit_signal kernel/exit.c:149 [inline] ffff88801a6f1298 (&sighand->siglock){-...}-{2:2}, at: release_task+0x5e3/0x1750 kernel/exit.c:246 which would create a new lock dependency: (&sighand->siglock){-...}-{2:2} -> (&stab->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: (&stab->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_map_delete net/core/sock_map.c:416 [inline] sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448 bpf_prog_2c29ac5cdc6b1842+0x82e/0xe68 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 do_sys_openat2+0x434/0x500 fs/open.c:1220 do_sys_open fs/open.c:1227 [inline] __do_sys_openat fs/open.c:1243 [inline] __se_sys_openat fs/open.c:1238 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1238 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 other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&stab->lock); local_irq_disable(); lock(&sighand->siglock); lock(&stab->lock); lock(&sighand->siglock); *** DEADLOCK *** 3 locks held by syz-executor.1/4737: #0: ffffffff8c60a058 (tasklist_lock){.+.+}-{2:2}, at: release_task+0x39e/0x1750 kernel/exit.c:243 #1: ffff88801a6f1298 (&sighand->siglock){-...}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #1: ffff88801a6f1298 (&sighand->siglock){-...}-{2:2}, at: __exit_signal kernel/exit.c:149 [inline] #1: ffff88801a6f1298 (&sighand->siglock){-...}-{2:2}, at: release_task+0x5e3/0x1750 kernel/exit.c:246 #2: 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 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: -> (&stab->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_map_delete net/core/sock_map.c:416 [inline] sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448 bpf_prog_2c29ac5cdc6b1842+0x82e/0xe68 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 do_sys_openat2+0x434/0x500 fs/open.c:1220 do_sys_open fs/open.c:1227 [inline] __do_sys_openat fs/open.c:1243 [inline] __se_sys_openat fs/open.c:1238 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1238 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_bh include/linux/spinlock_api_smp.h:135 [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+0x82e/0xe68 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 rcu_do_batch kernel/rcu/tree.c:2523 [inline] rcu_core+0xa15/0x1650 kernel/rcu/tree.c:2763 __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 check_kcov_mode kernel/kcov.c:165 [inline] write_comp_data kernel/kcov.c:218 [inline] __sanitizer_cov_trace_const_cmp1+0x30/0x80 kernel/kcov.c:270 variable_test_bit arch/x86/include/asm/bitops.h:214 [inline] test_bit include/asm-generic/bitops/instrumented-non-atomic.h:135 [inline] tomoyo_check_acl+0x302/0x410 security/tomoyo/domain.c:184 tomoyo_path_permission+0x1af/0x360 security/tomoyo/file.c:586 tomoyo_path_perm+0x41a/0x6b0 security/tomoyo/file.c:838 tomoyo_path_symlink+0xda/0x110 security/tomoyo/tomoyo.c:199 security_path_symlink+0xd9/0x130 security/security.c:1179 do_symlinkat+0x129/0x600 fs/namei.c:4453 __do_sys_symlink fs/namei.c:4480 [inline] __se_sys_symlink fs/namei.c:4478 [inline] __x64_sys_symlink+0x7a/0x90 fs/namei.c:4478 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 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_map_delete net/core/sock_map.c:416 [inline] sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448 bpf_prog_2c29ac5cdc6b1842+0x82e/0xe68 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 jbd2_free_handle include/linux/jbd2.h:1602 [inline] jbd2_journal_stop+0x8d9/0xd70 fs/jbd2/transaction.c:1964 __ext4_journal_stop+0xf8/0x190 fs/ext4/ext4_jbd2.c:127 ext4_truncate+0xc1c/0x1130 fs/ext4/inode.c:4264 ext4_setattr+0xf96/0x1990 fs/ext4/inode.c:5536 notify_change+0xc6d/0xf50 fs/attr.c:505 do_truncate+0x21c/0x300 fs/open.c:65 handle_truncate fs/namei.c:3265 [inline] do_open fs/namei.c:3612 [inline] path_openat+0x28a0/0x2f20 fs/namei.c:3742 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x500 fs/open.c:1211 do_sys_open fs/open.c:1227 [inline] __do_sys_openat fs/open.c:1243 [inline] __se_sys_openat fs/open.c:1238 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1238 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 } ... key at: [] sock_map_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_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/0xe68 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] flush_sigqueue+0x1ae/0x210 kernel/signal.c:469 __exit_signal kernel/exit.c:202 [inline] release_task+0x11c8/0x1750 kernel/exit.c:246 exit_notify kernel/exit.c:746 [inline] do_exit+0x1781/0x2480 kernel/exit.c:892 do_group_exit+0x144/0x310 kernel/exit.c:994 get_signal+0xc66/0x14e0 kernel/signal.c:2889 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 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb stack backtrace: CPU: 0 PID: 4737 Comm: syz-executor.1 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_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/0xe68 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] flush_sigqueue+0x1ae/0x210 kernel/signal.c:469 __exit_signal kernel/exit.c:202 [inline] release_task+0x11c8/0x1750 kernel/exit.c:246 exit_notify kernel/exit.c:746 [inline] do_exit+0x1781/0x2480 kernel/exit.c:892 do_group_exit+0x144/0x310 kernel/exit.c:994 get_signal+0xc66/0x14e0 kernel/signal.c:2889 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 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f40192eada9 Code: Unable to access opcode bytes at RIP 0x7f40192ead7f. RSP: 002b:00007f401784a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: 0000000000020000 RBX: 00007f4019419050 RCX: 00007f40192eada9 RDX: 00000000fffffecc RSI: 0000000020000540 RDI: 0000000000000004 RBP: 00007f401933747a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f4019419050 R15: 00007ffca809cc58