======================================================== WARNING: possible irq lock inversion dependency detected 6.7.0-rc1-next-20231117-syzkaller #0 Not tainted -------------------------------------------------------- syz-executor.5/13138 just changed the state of lock: ffff8880214bc038 (&new_timer->it_lock){-...}-{2:2}, at: posix_timer_fn+0x2d/0x3d0 kernel/time/posix-timers.c:318 but this lock took another, HARDIRQ-unsafe lock in the past: (&sighand->siglock){+.+.}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sighand->siglock); local_irq_disable(); lock(&new_timer->it_lock); lock(&sighand->siglock); lock(&new_timer->it_lock); *** DEADLOCK *** 1 lock held by syz-executor.5/13138: #0: ffffffff8ea92950 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x2d4/0x670 net/core/net_namespace.c:487 the shortest dependencies between 2nd lock and 1st lock: -> (&sighand->siglock){+.+.}-{2:2} { HARDIRQ-ON-W at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] class_spinlock_constructor include/linux/spinlock.h:530 [inline] ptrace_set_stopped kernel/ptrace.c:391 [inline] ptrace_attach+0x401/0x650 kernel/ptrace.c:478 __do_sys_ptrace+0x204/0x230 kernel/ptrace.c:1290 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a SOFTIRQ-ON-W at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] class_spinlock_constructor include/linux/spinlock.h:530 [inline] ptrace_set_stopped kernel/ptrace.c:391 [inline] ptrace_attach+0x401/0x650 kernel/ptrace.c:478 __do_sys_ptrace+0x204/0x230 kernel/ptrace.c:1290 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a INITIAL USE at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x36/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:376 [inline] calculate_sigpending+0x44/0xa0 kernel/signal.c:197 ret_from_fork+0x23/0x80 arch/x86/kernel/process.c:143 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 } ... key at: [] __key.341+0x0/0x40 ... acquired at: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] __do_sys_timer_delete kernel/time/posix-timers.c:1023 [inline] __se_sys_timer_delete kernel/time/posix-timers.c:1006 [inline] __x64_sys_timer_delete+0x16a/0x3e0 kernel/time/posix-timers.c:1006 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a -> (&new_timer->it_lock){-...}-{2:2} { IN-HARDIRQ-W at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 posix_timer_fn+0x2d/0x3d0 kernel/time/posix-timers.c:318 __run_hrtimer kernel/time/hrtimer.c:1688 [inline] __hrtimer_run_queues+0x20c/0xc20 kernel/time/hrtimer.c:1752 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1814 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline] __sysvec_apic_timer_interrupt+0x10c/0x410 arch/x86/kernel/apic/apic.c:1082 sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 check_kcov_mode kernel/kcov.c:173 [inline] write_comp_data+0x2e/0x80 kernel/kcov.c:236 unwind_next_frame+0x601/0x2390 arch/x86/kernel/unwind_orc.c:508 arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x24/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc+0x59/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:721 [inline] ops_init+0x16b/0x650 net/core/net_namespace.c:126 setup_net+0x422/0xa40 net/core/net_namespace.c:339 copy_net_ns+0x2f9/0x670 net/core/net_namespace.c:491 create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x441/0x9a0 kernel/fork.c:3451 __do_sys_unshare kernel/fork.c:3522 [inline] __se_sys_unshare kernel/fork.c:3520 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3520 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a INITIAL USE at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 __lock_timer+0x20d/0x4c0 kernel/time/posix-timers.c:595 do_timer_settime+0x197/0x2f0 kernel/time/posix-timers.c:916 __do_sys_timer_settime kernel/time/posix-timers.c:954 [inline] __se_sys_timer_settime kernel/time/posix-timers.c:940 [inline] __x64_sys_timer_settime+0x266/0x2c0 kernel/time/posix-timers.c:940 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a } ... key at: [] __key.0+0x0/0x40 ... acquired at: mark_usage kernel/locking/lockdep.c:4563 [inline] __lock_acquire+0x1347/0x3b10 kernel/locking/lockdep.c:5090 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 posix_timer_fn+0x2d/0x3d0 kernel/time/posix-timers.c:318 __run_hrtimer kernel/time/hrtimer.c:1688 [inline] __hrtimer_run_queues+0x20c/0xc20 kernel/time/hrtimer.c:1752 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1814 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline] __sysvec_apic_timer_interrupt+0x10c/0x410 arch/x86/kernel/apic/apic.c:1082 sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 check_kcov_mode kernel/kcov.c:173 [inline] write_comp_data+0x2e/0x80 kernel/kcov.c:236 unwind_next_frame+0x601/0x2390 arch/x86/kernel/unwind_orc.c:508 arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x24/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc+0x59/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:721 [inline] ops_init+0x16b/0x650 net/core/net_namespace.c:126 setup_net+0x422/0xa40 net/core/net_namespace.c:339 copy_net_ns+0x2f9/0x670 net/core/net_namespace.c:491 create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x441/0x9a0 kernel/fork.c:3451 __do_sys_unshare kernel/fork.c:3522 [inline] __se_sys_unshare kernel/fork.c:3520 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3520 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a stack backtrace: CPU: 0 PID: 13138 Comm: syz-executor.5 Not tainted 6.7.0-rc1-next-20231117-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_irq_inversion_bug.part.0+0x3e1/0x590 kernel/locking/lockdep.c:4079 print_irq_inversion_bug kernel/locking/lockdep.c:4032 [inline] check_usage_forwards kernel/locking/lockdep.c:4110 [inline] mark_lock_irq kernel/locking/lockdep.c:4242 [inline] mark_lock+0x570/0xc50 kernel/locking/lockdep.c:4677 mark_usage kernel/locking/lockdep.c:4563 [inline] __lock_acquire+0x1347/0x3b10 kernel/locking/lockdep.c:5090 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 posix_timer_fn+0x2d/0x3d0 kernel/time/posix-timers.c:318 __run_hrtimer kernel/time/hrtimer.c:1688 [inline] __hrtimer_run_queues+0x20c/0xc20 kernel/time/hrtimer.c:1752 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1814 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline] __sysvec_apic_timer_interrupt+0x10c/0x410 arch/x86/kernel/apic/apic.c:1082 sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:check_kcov_mode kernel/kcov.c:175 [inline] RIP: 0010:write_comp_data+0x2e/0x80 kernel/kcov.c:236 Code: 89 f8 49 89 f1 65 48 8b 15 6f b3 7b 7e 65 8b 05 70 b3 7b 7e a9 00 01 ff 00 74 0f f6 c4 01 74 59 8b 82 fc 15 00 00 85 c0 74 4f <8b> 82 d8 15 00 00 83 f8 03 75 44 48 8b 82 e0 15 00 00 8b 92 dc 15 RSP: 0018:ffffc9000a9ff838 EFLAGS: 00000246 RAX: 0000000080000001 RBX: ffffc9000a9ff8c0 RCX: ffffffff813a3c21 RDX: ffff8880215f8000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000002 R11: 0000000000000002 R12: ffffffff904cdc0c R13: ffffffff904cdc11 R14: 0000000000000002 R15: ffffc9000a9ff8f5 unwind_next_frame+0x601/0x2390 arch/x86/kernel/unwind_orc.c:508 arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x24/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc+0x59/0x90 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:721 [inline] ops_init+0x16b/0x650 net/core/net_namespace.c:126 setup_net+0x422/0xa40 net/core/net_namespace.c:339 copy_net_ns+0x2f9/0x670 net/core/net_namespace.c:491 create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x441/0x9a0 kernel/fork.c:3451 __do_sys_unshare kernel/fork.c:3522 [inline] __se_sys_unshare kernel/fork.c:3520 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3520 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a RIP: 0033:0x7f36dd27cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f36ddf1f0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 00007f36dd39bf80 RCX: 00007f36dd27cae9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000 RBP: 00007f36dd2c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f36dd39bf80 R15: 00007ffe6059a518 ---------------- Code disassembly (best guess): 0: 89 f8 mov %edi,%eax 2: 49 89 f1 mov %rsi,%r9 5: 65 48 8b 15 6f b3 7b mov %gs:0x7e7bb36f(%rip),%rdx # 0x7e7bb37c c: 7e d: 65 8b 05 70 b3 7b 7e mov %gs:0x7e7bb370(%rip),%eax # 0x7e7bb384 14: a9 00 01 ff 00 test $0xff0100,%eax 19: 74 0f je 0x2a 1b: f6 c4 01 test $0x1,%ah 1e: 74 59 je 0x79 20: 8b 82 fc 15 00 00 mov 0x15fc(%rdx),%eax 26: 85 c0 test %eax,%eax 28: 74 4f je 0x79 * 2a: 8b 82 d8 15 00 00 mov 0x15d8(%rdx),%eax <-- trapping instruction 30: 83 f8 03 cmp $0x3,%eax 33: 75 44 jne 0x79 35: 48 8b 82 e0 15 00 00 mov 0x15e0(%rdx),%rax 3c: 8b .byte 0x8b 3d: 92 xchg %eax,%edx 3e: dc .byte 0xdc 3f: 15 .byte 0x15