===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.1.84-syzkaller #0 Not tainted ----------------------------------------------------- syz-fuzzer/3650 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire: ffff88807a357020 (&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: ffff8880278c1bd8 (&sighand->siglock){-.-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline] ffff8880278c1bd8 (&sighand->siglock){-.-.}-{2:2}, at: get_signal+0x242/0x17d0 kernel/signal.c:2655 which would create a new lock dependency: (&sighand->siglock){-.-.}-{2:2} -> (&htab->buckets[i].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+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __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+0x145/0x2d0 kernel/signal.c:1410 lock_task_sighand include/linux/sched/signal.h:745 [inline] send_sigqueue+0x1de/0x720 kernel/signal.c:1978 posix_timer_event kernel/time/posix-timers.c:354 [inline] posix_timer_fn+0x186/0x390 kernel/time/posix-timers.c:380 __run_hrtimer kernel/time/hrtimer.c:1686 [inline] __hrtimer_run_queues+0x5e5/0xe50 kernel/time/hrtimer.c:1750 hrtimer_interrupt+0x392/0x980 kernel/time/hrtimer.c:1812 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1095 [inline] __sysvec_apic_timer_interrupt+0x156/0x580 arch/x86/kernel/apic/apic.c:1112 sysvec_apic_timer_interrupt+0x8c/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] unlock_timer kernel/time/posix-timers.c:166 [inline] do_timer_settime+0x2d2/0x330 kernel/time/posix-timers.c:936 __do_sys_timer_settime kernel/time/posix-timers.c:956 [inline] __se_sys_timer_settime kernel/time/posix-timers.c:942 [inline] __x64_sys_timer_settime+0x1a2/0x250 kernel/time/posix-timers.c:942 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 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( &sighand->siglock); lock(&htab->buckets[i].lock ); lock(&sighand->siglock); *** DEADLOCK *** 2 locks held by syz-fuzzer/3650: #0: ffff8880278c1bd8 (&sighand->siglock){-.-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline] ffff8880278c1bd8 (&sighand->siglock){-.-.}-{2:2}, at: get_signal+0x242/0x17d0 kernel/signal.c:2655 #1: 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_run3+0x146/0x440 kernel/trace/bpf_trace.c:2313 the dependencies between HARDIRQ-irq-safe lock and the holding lock: -> (&sighand->siglock ){-.-.}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __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+0x145/0x2d0 kernel/signal.c:1410 lock_task_sighand include/linux/sched/signal.h:745 [inline] send_sigqueue+0x1de/0x720 kernel/signal.c:1978 posix_timer_event kernel/time/posix-timers.c:354 [inline] posix_timer_fn+0x186/0x390 kernel/time/posix-timers.c:380 __run_hrtimer kernel/time/hrtimer.c:1686 [inline] __hrtimer_run_queues+0x5e5/0xe50 kernel/time/hrtimer.c:1750 hrtimer_interrupt+0x392/0x980 kernel/time/hrtimer.c:1812 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1095 [inline] __sysvec_apic_timer_interrupt+0x156/0x580 arch/x86/kernel/apic/apic.c:1112 sysvec_apic_timer_interrupt+0x8c/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] unlock_timer kernel/time/posix-timers.c:166 [inline] do_timer_settime+0x2d2/0x330 kernel/time/posix-timers.c:936 __do_sys_timer_settime kernel/time/posix-timers.c:956 [inline] __se_sys_timer_settime kernel/time/posix-timers.c:942 [inline] __x64_sys_timer_settime+0x1a2/0x250 kernel/time/posix-timers.c:942 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 IN-SOFTIRQ-W at: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __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+0x145/0x2d0 kernel/signal.c:1410 lock_task_sighand include/linux/sched/signal.h:745 [inline] send_sigqueue+0x1de/0x720 kernel/signal.c:1978 posix_timer_event kernel/time/posix-timers.c:354 [inline] posix_timer_fn+0x186/0x390 kernel/time/posix-timers.c:380 __run_hrtimer kernel/time/hrtimer.c:1686 [inline] __hrtimer_run_queues+0x5e5/0xe50 kernel/time/hrtimer.c:1750 hrtimer_interrupt+0x392/0x980 kernel/time/hrtimer.c:1812 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1095 [inline] __sysvec_apic_timer_interrupt+0x156/0x580 arch/x86/kernel/apic/apic.c:1112 sysvec_apic_timer_interrupt+0x3e/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202 expire_timers kernel/time/timer.c:1548 [inline] __run_timers+0x66c/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 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 ntfs_printk+0x30c/0x350 fs/ntfs3/super.c:68 ntfs_init_from_boot fs/ntfs3/super.c:758 [inline] ntfs_fill_super+0xebc/0x4410 fs/ntfs3/super.c:935 get_tree_bdev+0x3fe/0x620 fs/super.c:1355 vfs_get_tree+0x88/0x270 fs/super.c:1562 do_new_mount+0x2ba/0xb40 fs/namespace.c:3051 do_mount fs/namespace.c:3394 [inline] __do_sys_mount fs/namespace.c:3602 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3579 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_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:376 [inline] calculate_sigpending+0x4a/0x80 kernel/signal.c:195 ret_from_fork+0x8/0x30 arch/x86/entry/entry_64.S:292 } ... key at: [] sighand_ctor.__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 IN-SOFTIRQ-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_delete_elem+0xac/0x2f0 net/core/sock_map.c:932 0xffffffffa000206a 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_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:114 trace_kmem_cache_free include/trace/events/kmem.h:114 [inline] kmem_cache_free+0x418/0x510 mm/slub.c:3682 tcp_clean_rtx_queue net/ipv4/tcp_input.c:3347 [inline] tcp_ack+0x246c/0x6e80 net/ipv4/tcp_input.c:3906 tcp_rcv_established+0xf53/0x1f00 net/ipv4/tcp_input.c:5937 tcp_v4_do_rcv+0x487/0xb00 net/ipv4/tcp_ipv4.c:1677 tcp_v4_rcv+0x29e0/0x3250 net/ipv4/tcp_ipv4.c:2099 ip_protocol_deliver_rcu+0x381/0x740 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2b4/0x4f0 net/ipv4/ip_input.c:233 NF_HOOK+0x39d/0x450 include/linux/netfilter.h:302 dst_input include/net/dst.h:454 [inline] ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline] ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline] ip_sublist_rcv+0xaf9/0xe70 net/ipv4/ip_input.c:639 ip_list_rcv+0x422/0x470 net/ipv4/ip_input.c:674 __netif_receive_skb_list_ptype net/core/dev.c:5571 [inline] __netif_receive_skb_list_core+0x6b1/0x890 net/core/dev.c:5619 __netif_receive_skb_list net/core/dev.c:5671 [inline] netif_receive_skb_list_internal+0xa0d/0xe20 net/core/dev.c:5762 gro_normal_list include/net/gro.h:433 [inline] napi_complete_done+0x352/0x820 net/core/dev.c:6103 virtqueue_napi_complete drivers/net/virtio_net.c:403 [inline] virtnet_poll+0xc85/0x1470 drivers/net/virtio_net.c:1687 __napi_poll+0xc7/0x470 net/core/dev.c:6537 napi_poll net/core/dev.c:6604 [inline] net_rx_action+0x70f/0xeb0 net/core/dev.c:6718 __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 common_interrupt+0xa4/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644 native_irq_enable arch/x86/include/asm/irqflags.h:45 [inline] arch_local_irq_enable arch/x86/include/asm/irqflags.h:80 [inline] arch_local_irq_restore arch/x86/include/asm/irqflags.h:138 [inline] __free_object+0x9aa/0xa80 lib/debugobjects.c:414 free_object lib/debugobjects.c:423 [inline] debug_object_free+0x2c1/0x460 lib/debugobjects.c:855 futex_wait+0x4c7/0x5c0 kernel/futex/waitwake.c:689 do_futex+0x3b5/0x490 kernel/futex/syscalls.c:106 __do_sys_futex kernel/futex/syscalls.c:183 [inline] __se_sys_futex+0x3d7/0x460 kernel/futex/syscalls.c:164 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_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_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:114 trace_kmem_cache_free include/trace/events/kmem.h:114 [inline] kmem_cache_free+0x418/0x510 mm/slub.c:3682 __sigqueue_free kernel/signal.c:458 [inline] collect_signal kernel/signal.c:601 [inline] __dequeue_signal+0x4ac/0x5c0 kernel/signal.c:623 dequeue_signal+0xd4/0x590 kernel/signal.c:643 get_signal+0x5f2/0x17d0 kernel/signal.c:2742 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316 asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:658 stack backtrace: CPU: 0 PID: 3650 Comm: syz-fuzzer 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_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_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:114 trace_kmem_cache_free include/trace/events/kmem.h:114 [inline] kmem_cache_free+0x418/0x510 mm/slub.c:3682 __sigqueue_free kernel/signal.c:458 [inline] collect_signal kernel/signal.c:601 [inline] __dequeue_signal+0x4ac/0x5c0 kernel/signal.c:623 dequeue_signal+0xd4/0x590 kernel/signal.c:643 get_signal+0x5f2/0x17d0 kernel/signal.c:2742 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316 asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:658 RIP: 0033:0x747985 Code: ff eb 62 c1 e0 10 09 d0 c3 44 0f b6 13 41 01 d2 45 8d 1c 02 44 0f b6 63 01 45 01 e2 45 01 d3 44 0f b6 63 02 45 01 e2 45 01 d3 <44> 0f b6 63 03 43 8d 14 14 48 83 c7 fc 49 89 fa 49 f7 da 49 c1 fa RSP: 002b:000000c0008991f8 EFLAGS: 00000202 RAX: 0000000000b39cfc RBX: 000000c00011d8f8 RCX: 0000000000000708 RDX: 0000000000003670 RSI: 0000000000000000 RDI: 0000000000000708 RBP: 000000c000899220 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000003670 R11: 0000000000b4404c R12: 0000000000000000 R13: 0000000000007f3d R14: 000000c0003984e0 R15: 000000000000002f