===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 5.15.153-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor.2/7155 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire: ffff88807815a0f8 (&htab->buckets[i].lock){+...}-{2:2}, at: sock_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 and this task is already holding: ffff8880b9a3a318 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475 which would create a new lock dependency: (&rq->__lock){-.-.}-{2:2} -> (&htab->buckets[i].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+0x1db/0x4f0 kernel/locking/lockdep.c:5623 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:368 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475 raw_spin_rq_lock kernel/sched/sched.h:1326 [inline] rq_lock kernel/sched/sched.h:1621 [inline] scheduler_tick+0x97/0x500 kernel/sched/core.c:5296 update_process_times+0x1ca/0x200 kernel/time/timer.c:1793 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+0x292/0xa70 kernel/irq/handle.c:156 handle_irq_event_percpu kernel/irq/handle.c:196 [inline] handle_irq_event+0xff/0x2b0 kernel/irq/handle.c:213 handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:822 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:629 orc_ip arch/x86/kernel/unwind_orc.c:30 [inline] __orc_find arch/x86/kernel/unwind_orc.c:52 [inline] orc_find arch/x86/kernel/unwind_orc.c:184 [inline] unwind_next_frame+0xeb0/0x1fa0 arch/x86/kernel/unwind_orc.c:448 arch_stack_walk+0x10d/0x140 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122 kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] kmem_cache_alloc_node+0x121/0x2c0 mm/slub.c:3256 alloc_vmap_area+0x1ba/0x19a0 mm/vmalloc.c:1531 __get_vm_area_node+0x16e/0x2f0 mm/vmalloc.c:2423 __vmalloc_node_range+0xe3/0x8c0 mm/vmalloc.c:3019 __vmalloc_node mm/vmalloc.c:3079 [inline] vzalloc_node+0x7a/0x90 mm/vmalloc.c:3205 gen_pool_add_owner+0x87/0x280 lib/genalloc.c:192 gen_pool_add_virt include/linux/genalloc.h:104 [inline] gen_pool_add include/linux/genalloc.h:122 [inline] mce_gen_pool_create arch/x86/kernel/cpu/mce/genpool.c:128 [inline] mce_gen_pool_init+0x5e/0xa0 arch/x86/kernel/cpu/mce/genpool.c:146 mcheck_cpu_init+0xa14/0x1070 arch/x86/kernel/cpu/mce/core.c:2112 identify_cpu+0x1c69/0x31c0 arch/x86/kernel/cpu/common.c:1767 identify_boot_cpu+0xd/0xb8 arch/x86/kernel/cpu/common.c:1808 arch_cpu_finalize_init+0x5/0x81 arch/x86/kernel/cpu/common.c:2240 start_kernel+0x419/0x535 init/main.c:1105 secondary_startup_64_no_verify+0xb1/0xbb to a HARDIRQ-irq-unsafe lock: (&htab->buckets[i].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_hash_free+0x14c/0x780 net/core/sock_map.c:1154 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&htab->buckets[i].lock); local_irq_disable(); lock(&rq->__lock); lock(&htab->buckets[i].lock); lock(&rq->__lock); *** DEADLOCK *** 3 locks held by syz-executor.2/7155: #0: ffff888013da7128 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff888013da7128 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1329 [inline] #0: ffff888013da7128 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1476 [inline] #0: ffff888013da7128 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x740 arch/x86/mm/fault.c:1532 #1: ffff8880b9a3a318 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475 #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: -> (&rq->__lock){-.-.}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:368 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475 raw_spin_rq_lock kernel/sched/sched.h:1326 [inline] rq_lock kernel/sched/sched.h:1621 [inline] scheduler_tick+0x97/0x500 kernel/sched/core.c:5296 update_process_times+0x1ca/0x200 kernel/time/timer.c:1793 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+0x292/0xa70 kernel/irq/handle.c:156 handle_irq_event_percpu kernel/irq/handle.c:196 [inline] handle_irq_event+0xff/0x2b0 kernel/irq/handle.c:213 handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:822 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:629 orc_ip arch/x86/kernel/unwind_orc.c:30 [inline] __orc_find arch/x86/kernel/unwind_orc.c:52 [inline] orc_find arch/x86/kernel/unwind_orc.c:184 [inline] unwind_next_frame+0xeb0/0x1fa0 arch/x86/kernel/unwind_orc.c:448 arch_stack_walk+0x10d/0x140 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122 kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] kmem_cache_alloc_node+0x121/0x2c0 mm/slub.c:3256 alloc_vmap_area+0x1ba/0x19a0 mm/vmalloc.c:1531 __get_vm_area_node+0x16e/0x2f0 mm/vmalloc.c:2423 __vmalloc_node_range+0xe3/0x8c0 mm/vmalloc.c:3019 __vmalloc_node mm/vmalloc.c:3079 [inline] vzalloc_node+0x7a/0x90 mm/vmalloc.c:3205 gen_pool_add_owner+0x87/0x280 lib/genalloc.c:192 gen_pool_add_virt include/linux/genalloc.h:104 [inline] gen_pool_add include/linux/genalloc.h:122 [inline] mce_gen_pool_create arch/x86/kernel/cpu/mce/genpool.c:128 [inline] mce_gen_pool_init+0x5e/0xa0 arch/x86/kernel/cpu/mce/genpool.c:146 mcheck_cpu_init+0xa14/0x1070 arch/x86/kernel/cpu/mce/core.c:2112 identify_cpu+0x1c69/0x31c0 arch/x86/kernel/cpu/common.c:1767 identify_boot_cpu+0xd/0xb8 arch/x86/kernel/cpu/common.c:1808 arch_cpu_finalize_init+0x5/0x81 arch/x86/kernel/cpu/common.c:2240 start_kernel+0x419/0x535 init/main.c:1105 secondary_startup_64_no_verify+0xb1/0xbb IN-SOFTIRQ-W at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:368 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475 raw_spin_rq_lock kernel/sched/sched.h:1326 [inline] rq_lock kernel/sched/sched.h:1621 [inline] ttwu_queue kernel/sched/core.c:3821 [inline] try_to_wake_up+0x6dd/0x1300 kernel/sched/core.c:4146 call_timer_fn+0x16d/0x560 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1737 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1750 __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 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:717 default_idle_call+0x81/0xc0 kernel/sched/idle.c:112 cpuidle_idle_call kernel/sched/idle.c:194 [inline] do_idle+0x271/0x670 kernel/sched/idle.c:306 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:403 start_kernel+0x48c/0x535 init/main.c:1138 secondary_startup_64_no_verify+0xb1/0xbb INITIAL USE at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:368 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475 raw_spin_rq_lock kernel/sched/sched.h:1326 [inline] _raw_spin_rq_lock_irqsave kernel/sched/sched.h:1345 [inline] rq_attach_root+0xec/0x440 kernel/sched/topology.c:470 sched_init+0x6a4/0xbdd kernel/sched/core.c:9502 start_kernel+0x1b6/0x535 init/main.c:1007 secondary_startup_64_no_verify+0xb1/0xbb } ... key at: [] sched_init.__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+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_hash_free+0x14c/0x780 net/core/sock_map.c:1154 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 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_hash_free+0x14c/0x780 net/core/sock_map.c:1154 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 } ... key at: [] sock_hash_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_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 bpf_prog_2c29ac5cdc6b1842+0x3a/0xd88 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 __traceiter_sched_switch+0x7d/0xb0 include/trace/events/sched.h:220 trace_sched_switch include/trace/events/sched.h:220 [inline] __schedule+0x1e8d/0x45b0 kernel/sched/core.c:6373 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6780 irqentry_exit+0x53/0x80 kernel/entry/common.c:426 asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:643 memory_is_nonzero mm/kasan/generic.c:101 [inline] memory_is_poisoned_n mm/kasan/generic.c:128 [inline] memory_is_poisoned mm/kasan/generic.c:159 [inline] check_region_inline mm/kasan/generic.c:180 [inline] kasan_check_range+0x5f/0x290 mm/kasan/generic.c:189 memset+0x1f/0x40 mm/kasan/shadow.c:44 __handle_mm_fault mm/memory.c:4673 [inline] handle_mm_fault+0x58a/0x5950 mm/memory.c:4854 do_user_addr_fault arch/x86/mm/fault.c:1388 [inline] handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 stack backtrace: CPU: 0 PID: 7155 Comm: syz-executor.2 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_hash_delete_elem+0xac/0x2f0 net/core/sock_map.c:937 bpf_prog_2c29ac5cdc6b1842+0x3a/0xd88 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 __traceiter_sched_switch+0x7d/0xb0 include/trace/events/sched.h:220 trace_sched_switch include/trace/events/sched.h:220 [inline] __schedule+0x1e8d/0x45b0 kernel/sched/core.c:6373 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6780 irqentry_exit+0x53/0x80 kernel/entry/common.c:426 asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:643 RIP: 0010:memory_is_nonzero mm/kasan/generic.c:101 [inline] RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:128 [inline] RIP: 0010:memory_is_poisoned mm/kasan/generic.c:159 [inline] RIP: 0010:check_region_inline mm/kasan/generic.c:180 [inline] RIP: 0010:kasan_check_range+0x5f/0x290 mm/kasan/generic.c:189 Code: eb 03 49 b8 00 00 00 00 00 fc ff df 4e 8d 0c 03 4c 8d 54 37 ff 49 c1 ea 03 49 bb 01 00 00 00 00 fc ff df 4f 8d 34 1a 4c 89 f5 <4c> 29 cd 48 83 fd 10 7f 26 48 85 ed 0f 84 3a 01 00 00 49 f7 d2 49 RSP: 0000:ffffc90002e17bd8 EFLAGS: 00000a07 RAX: 0000000000000201 RBX: 1ffff920005c2fc3 RCX: ffffffff81b911ca RDX: 0000000000000001 RSI: 0000000000000040 RDI: ffffc90002e17e18 RBP: fffff520005c2fcb R08: dffffc0000000000 R09: fffff520005c2fc3 R10: 1ffff920005c2fca R11: dffffc0000000001 R12: ffff88801acf1ae8 R13: ffffc90002e17df8 R14: fffff520005c2fcb R15: ffffc90002e17e10 memset+0x1f/0x40 mm/kasan/shadow.c:44 __handle_mm_fault mm/memory.c:4673 [inline] handle_mm_fault+0x58a/0x5950 mm/memory.c:4854 do_user_addr_fault arch/x86/mm/fault.c:1388 [inline] handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0x7f5026d818f0 Code: 39 4f 08 72 4c 8d 4d ff 85 ed 74 33 66 0f 1f 44 00 00 48 39 f0 72 1b 4d 8b 07 49 89 c1 49 29 f1 47 0f b6 0c 08 45 84 c9 74 08 <45> 88 0c 00 49 8b 47 10 48 83 c0 01 49 89 47 10 83 e9 01 73 d3 41 RSP: 002b:00007f5025347530 EFLAGS: 00010286 RAX: 0000000000135000 RBX: 00007f50253475d0 RCX: 000000000000007f RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00007f5025347670 RBP: 0000000000000102 R08: 00007f501cf28000 R09: 00000000000000ff R10: 0000000000000000 R11: 00007f50253475e0 R12: 0000000000000001 R13: 00007f5026e44e40 R14: 0000000000000000 R15: 00007f5025347670 ---------------- Code disassembly (best guess): 0: eb 03 jmp 0x5 2: 49 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%r8 9: fc ff df c: 4e 8d 0c 03 lea (%rbx,%r8,1),%r9 10: 4c 8d 54 37 ff lea -0x1(%rdi,%rsi,1),%r10 15: 49 c1 ea 03 shr $0x3,%r10 19: 49 bb 01 00 00 00 00 movabs $0xdffffc0000000001,%r11 20: fc ff df 23: 4f 8d 34 1a lea (%r10,%r11,1),%r14 27: 4c 89 f5 mov %r14,%rbp * 2a: 4c 29 cd sub %r9,%rbp <-- trapping instruction 2d: 48 83 fd 10 cmp $0x10,%rbp 31: 7f 26 jg 0x59 33: 48 85 ed test %rbp,%rbp 36: 0f 84 3a 01 00 00 je 0x176 3c: 49 f7 d2 not %r10 3f: 49 rex.WB