===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 5.15.153-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.3/3528 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire: ffff888022ca55c0 (&stab->lock){+...}-{2:2}, at: __sock_map_delete net/core/sock_map.c:416 [inline] ffff888022ca55c0 (&stab->lock){+...}-{2:2}, at: sock_map_delete_elem+0x97/0x130 net/core/sock_map.c:448 and this task is already holding: ffff888022f81298 (&sighand->siglock){-...}-{2:2}, at: __lock_task_sighand+0x11a/0x290 kernel/signal.c:1404 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 task_rq_unlock kernel/sched/sched.h:1598 [inline] __sched_setscheduler+0xd8a/0x1e20 kernel/sched/core.c:7576 _sched_setscheduler kernel/sched/core.c:7598 [inline] sched_setscheduler_nocheck+0x187/0x2d0 kernel/sched/core.c:7645 __kthread_create_on_node+0x31b/0x3f0 kernel/kthread.c:413 kthread_create_on_node+0xda/0x120 kernel/kthread.c:453 init_rescuer+0x1ab/0x290 kernel/workqueue.c:4293 alloc_workqueue+0xf70/0x13f0 kernel/workqueue.c:4368 __btrfs_alloc_workqueue+0x16f/0x470 btrfs_alloc_workqueue+0x8c/0x180 fs/btrfs/async-thread.c:140 btrfs_init_workqueues+0x476/0x870 fs/btrfs/disk-io.c:2293 open_ctree+0x1630/0x34f2 fs/btrfs/disk-io.c:3400 btrfs_fill_super+0x1c7/0x2d0 fs/btrfs/super.c:1387 btrfs_mount_root+0x803/0x930 fs/btrfs/super.c:1752 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1517 fc_mount fs/namespace.c:1000 [inline] vfs_kern_mount+0xb8/0x150 fs/namespace.c:1030 btrfs_mount+0x395/0xb40 fs/btrfs/super.c:1812 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1517 do_new_mount+0x2ba/0xb40 fs/namespace.c:3005 do_mount fs/namespace.c:3348 [inline] __do_sys_mount fs/namespace.c:3556 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533 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_update_common+0x1b6/0x5b0 net/core/sock_map.c:492 sock_map_update_elem_sys+0x440/0x770 net/core/sock_map.c:585 map_update_elem+0x6a0/0x7c0 kernel/bpf/syscall.c:1185 __sys_bpf+0x2fd/0x670 kernel/bpf/syscall.c:4639 __do_sys_bpf kernel/bpf/syscall.c:4755 [inline] __se_sys_bpf kernel/bpf/syscall.c:4753 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4753 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.3/3528: #0: ffffffff8c91f720 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #1: ffff888022f81298 (&sighand->siglock){-...}-{2:2}, at: __lock_task_sighand+0x11a/0x290 kernel/signal.c:1404 #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 task_rq_unlock kernel/sched/sched.h:1598 [inline] __sched_setscheduler+0xd8a/0x1e20 kernel/sched/core.c:7576 _sched_setscheduler kernel/sched/core.c:7598 [inline] sched_setscheduler_nocheck+0x187/0x2d0 kernel/sched/core.c:7645 __kthread_create_on_node+0x31b/0x3f0 kernel/kthread.c:413 kthread_create_on_node+0xda/0x120 kernel/kthread.c:453 init_rescuer+0x1ab/0x290 kernel/workqueue.c:4293 alloc_workqueue+0xf70/0x13f0 kernel/workqueue.c:4368 __btrfs_alloc_workqueue+0x16f/0x470 btrfs_alloc_workqueue+0x8c/0x180 fs/btrfs/async-thread.c:140 btrfs_init_workqueues+0x476/0x870 fs/btrfs/disk-io.c:2293 open_ctree+0x1630/0x34f2 fs/btrfs/disk-io.c:3400 btrfs_fill_super+0x1c7/0x2d0 fs/btrfs/super.c:1387 btrfs_mount_root+0x803/0x930 fs/btrfs/super.c:1752 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1517 fc_mount fs/namespace.c:1000 [inline] vfs_kern_mount+0xb8/0x150 fs/namespace.c:1030 btrfs_mount+0x395/0xb40 fs/btrfs/super.c:1812 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1517 do_new_mount+0x2ba/0xb40 fs/namespace.c:3005 do_mount fs/namespace.c:3348 [inline] __do_sys_mount fs/namespace.c:3556 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533 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_update_common+0x1b6/0x5b0 net/core/sock_map.c:492 sock_map_update_elem_sys+0x440/0x770 net/core/sock_map.c:585 map_update_elem+0x6a0/0x7c0 kernel/bpf/syscall.c:1185 __sys_bpf+0x2fd/0x670 kernel/bpf/syscall.c:4639 __do_sys_bpf kernel/bpf/syscall.c:4755 [inline] __se_sys_bpf kernel/bpf/syscall.c:4753 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4753 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_update_common+0x1b6/0x5b0 net/core/sock_map.c:492 sock_map_update_elem_sys+0x440/0x770 net/core/sock_map.c:585 map_update_elem+0x6a0/0x7c0 kernel/bpf/syscall.c:1185 __sys_bpf+0x2fd/0x670 kernel/bpf/syscall.c:4639 __do_sys_bpf kernel/bpf/syscall.c:4755 [inline] __se_sys_bpf kernel/bpf/syscall.c:4753 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4753 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/0xb84 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_run5+0x222/0x3e0 kernel/trace/bpf_trace.c:1920 trace_signal_generate+0x182/0x1f0 include/trace/events/signal.h:50 __send_signal+0xadc/0xd40 kernel/signal.c:1184 do_send_sig_info kernel/signal.c:1294 [inline] group_send_sig_info+0x260/0x2d0 kernel/signal.c:1442 bpf_send_signal_common+0x2d8/0x420 kernel/trace/bpf_trace.c:824 ____bpf_send_signal kernel/trace/bpf_trace.c:829 [inline] bpf_send_signal+0x15/0x20 kernel/trace/bpf_trace.c:827 bpf_prog_8cc4ff36b5985b6a+0x15/0x1ec 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_exit+0x60/0x70 include/trace/events/syscalls.h:44 trace_sys_exit include/trace/events/syscalls.h:44 [inline] syscall_exit_work kernel/entry/common.c:252 [inline] syscall_exit_to_user_mode_prepare kernel/entry/common.c:283 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:288 [inline] syscall_exit_to_user_mode+0x21a/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: 3528 Comm: syz-executor.3 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/0xb84 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_run5+0x222/0x3e0 kernel/trace/bpf_trace.c:1920 trace_signal_generate+0x182/0x1f0 include/trace/events/signal.h:50 __send_signal+0xadc/0xd40 kernel/signal.c:1184 do_send_sig_info kernel/signal.c:1294 [inline] group_send_sig_info+0x260/0x2d0 kernel/signal.c:1442 bpf_send_signal_common+0x2d8/0x420 kernel/trace/bpf_trace.c:824 ____bpf_send_signal kernel/trace/bpf_trace.c:829 [inline] bpf_send_signal+0x15/0x20 kernel/trace/bpf_trace.c:827 bpf_prog_8cc4ff36b5985b6a+0x15/0x1ec 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_exit+0x60/0x70 include/trace/events/syscalls.h:44 trace_sys_exit include/trace/events/syscalls.h:44 [inline] syscall_exit_work kernel/entry/common.c:252 [inline] syscall_exit_to_user_mode_prepare kernel/entry/common.c:283 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:288 [inline] syscall_exit_to_user_mode+0x21a/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:0x7fedf65ec275 Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 f6 b9 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 4f ba ff ff 48 8b 04 24 48 83 c4 28 f7 d8 RSP: 002b:00007ffe91e40980 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: 0000000000000000 RBX: 00000000000000b9 RCX: 00007fedf65ec275 RDX: 00007ffe91e409c0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffe91e40a4c R08: 0000000000000000 R09: 0000000000000010 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000032 R13: 0000000000019cf2 R14: 0000000000019cce R15: 0000000000000003