======================================================== WARNING: possible irq lock inversion dependency detected 6.7.0-rc1-next-20231117-syzkaller #0 Not tainted -------------------------------------------------------- syz-executor.2/15066 just changed the state of lock: ffff888029730038 (&new_timer->it_lock){-...}-{2:2}, at: alarm_handle_timer+0x2d/0x2e0 kernel/time/alarmtimer.c:579 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 *** 4 locks held by syz-executor.2/15066: #0: ffff88801e2c4490 (&q->debugfs_mutex){+.+.}-{3:3}, at: blk_trace_ioctl+0xc9/0x290 kernel/trace/blktrace.c:736 #1: ffffffff8d01c2e8 (relay_channels_mutex){+.+.}-{3:3}, at: relay_open+0x38f/0xab0 kernel/relay.c:515 #2: ffff88801b64cb70 (&sb->s_type->i_mutex_key#3){++++}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline] #2: ffff88801b64cb70 (&sb->s_type->i_mutex_key#3){++++}-{3:3}, at: start_creating.part.0+0xb0/0x3a0 fs/debugfs/inode.c:370 #3: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline] #3: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline] #3: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: is_bpf_text_address+0x30/0x1a0 kernel/bpf/core.c:733 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 alarm_handle_timer+0x2d/0x2e0 kernel/time/alarmtimer.c:579 alarmtimer_fired+0x132/0x550 kernel/time/alarmtimer.c:209 __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 lock_acquire+0x1f2/0x530 kernel/locking/lockdep.c:5721 rcu_lock_acquire include/linux/rcupdate.h:301 [inline] rcu_read_lock include/linux/rcupdate.h:747 [inline] is_bpf_text_address+0x36/0x1a0 kernel/bpf/core.c:733 kernel_text_address kernel/extable.c:125 [inline] kernel_text_address+0x85/0xf0 kernel/extable.c:94 __kernel_text_address+0xd/0x30 kernel/extable.c:79 unwind_get_return_address+0x78/0xe0 arch/x86/kernel/unwind_orc.c:369 arch_stack_walk+0xbe/0x170 arch/x86/kernel/stacktrace.c:26 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_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc_lru+0x219/0x6f0 mm/slub.c:3483 alloc_inode_sb include/linux/fs.h:2953 [inline] alloc_inode+0xb3/0x220 fs/inode.c:261 new_inode_pseudo fs/inode.c:1004 [inline] new_inode+0x22/0x260 fs/inode.c:1030 debugfs_get_inode fs/debugfs/inode.c:72 [inline] __debugfs_create_file+0x11a/0x620 fs/debugfs/inode.c:429 relay_create_buf_file+0xf0/0x170 kernel/relay.c:360 relay_open_buf.part.0+0x77e/0xba0 kernel/relay.c:389 relay_open_buf kernel/relay.c:536 [inline] relay_open+0x641/0xab0 kernel/relay.c:517 do_blk_trace_setup+0x4a9/0xaa0 kernel/trace/blktrace.c:591 __blk_trace_setup+0xd8/0x180 kernel/trace/blktrace.c:631 blk_trace_ioctl+0x163/0x290 kernel/trace/blktrace.c:741 blkdev_ioctl+0x111/0x770 block/ioctl.c:622 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 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 itimer_delete kernel/time/posix-timers.c:1048 [inline] exit_itimers+0x255/0x560 kernel/time/posix-timers.c:1109 do_exit+0x629/0x2ad0 kernel/exit.c:845 do_group_exit+0xd3/0x2a0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1030 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 alarm_handle_timer+0x2d/0x2e0 kernel/time/alarmtimer.c:579 alarmtimer_fired+0x132/0x550 kernel/time/alarmtimer.c:209 __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 lock_acquire+0x1f2/0x530 kernel/locking/lockdep.c:5721 rcu_lock_acquire include/linux/rcupdate.h:301 [inline] rcu_read_lock include/linux/rcupdate.h:747 [inline] is_bpf_text_address+0x36/0x1a0 kernel/bpf/core.c:733 kernel_text_address kernel/extable.c:125 [inline] kernel_text_address+0x85/0xf0 kernel/extable.c:94 __kernel_text_address+0xd/0x30 kernel/extable.c:79 unwind_get_return_address+0x78/0xe0 arch/x86/kernel/unwind_orc.c:369 arch_stack_walk+0xbe/0x170 arch/x86/kernel/stacktrace.c:26 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_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc_lru+0x219/0x6f0 mm/slub.c:3483 alloc_inode_sb include/linux/fs.h:2953 [inline] alloc_inode+0xb3/0x220 fs/inode.c:261 new_inode_pseudo fs/inode.c:1004 [inline] new_inode+0x22/0x260 fs/inode.c:1030 debugfs_get_inode fs/debugfs/inode.c:72 [inline] __debugfs_create_file+0x11a/0x620 fs/debugfs/inode.c:429 relay_create_buf_file+0xf0/0x170 kernel/relay.c:360 relay_open_buf.part.0+0x77e/0xba0 kernel/relay.c:389 relay_open_buf kernel/relay.c:536 [inline] relay_open+0x641/0xab0 kernel/relay.c:517 do_blk_trace_setup+0x4a9/0xaa0 kernel/trace/blktrace.c:591 __blk_trace_setup+0xd8/0x180 kernel/trace/blktrace.c:631 blk_trace_ioctl+0x163/0x290 kernel/trace/blktrace.c:741 blkdev_ioctl+0x111/0x770 block/ioctl.c:622 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 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: 1 PID: 15066 Comm: syz-executor.2 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 alarm_handle_timer+0x2d/0x2e0 kernel/time/alarmtimer.c:579 alarmtimer_fired+0x132/0x550 kernel/time/alarmtimer.c:209 __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:lock_acquire+0x1f2/0x530 kernel/locking/lockdep.c:5721 Code: c1 05 fa 0c 9a 7e 83 f8 01 0f 85 c4 02 00 00 9c 58 f6 c4 02 0f 85 af 02 00 00 48 85 ed 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24 RSP: 0018:ffffc90015597520 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: 1ffff92002ab2ea6 RCX: 0000000021bd2661 RDX: 0000000000000001 RSI: ffffffff8accc2e0 RDI: ffffffff8b2f1520 RBP: 0000000000000200 R08: 0000000000000000 R09: fffffbfff23e33e8 R10: ffffffff91f19f47 R11: 0000000000000003 R12: 0000000000000000 R13: 0000000000000000 R14: ffffffff8cfad060 R15: 0000000000000000 rcu_lock_acquire include/linux/rcupdate.h:301 [inline] rcu_read_lock include/linux/rcupdate.h:747 [inline] is_bpf_text_address+0x36/0x1a0 kernel/bpf/core.c:733 kernel_text_address kernel/extable.c:125 [inline] kernel_text_address+0x85/0xf0 kernel/extable.c:94 __kernel_text_address+0xd/0x30 kernel/extable.c:79 unwind_get_return_address+0x78/0xe0 arch/x86/kernel/unwind_orc.c:369 arch_stack_walk+0xbe/0x170 arch/x86/kernel/stacktrace.c:26 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_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc_lru+0x219/0x6f0 mm/slub.c:3483 alloc_inode_sb include/linux/fs.h:2953 [inline] alloc_inode+0xb3/0x220 fs/inode.c:261 new_inode_pseudo fs/inode.c:1004 [inline] new_inode+0x22/0x260 fs/inode.c:1030 debugfs_get_inode fs/debugfs/inode.c:72 [inline] __debugfs_create_file+0x11a/0x620 fs/debugfs/inode.c:429 relay_create_buf_file+0xf0/0x170 kernel/relay.c:360 relay_open_buf.part.0+0x77e/0xba0 kernel/relay.c:389 relay_open_buf kernel/relay.c:536 [inline] relay_open+0x641/0xab0 kernel/relay.c:517 do_blk_trace_setup+0x4a9/0xaa0 kernel/trace/blktrace.c:591 __blk_trace_setup+0xd8/0x180 kernel/trace/blktrace.c:631 blk_trace_ioctl+0x163/0x290 kernel/trace/blktrace.c:741 blkdev_ioctl+0x111/0x770 block/ioctl.c:622 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 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:0x7fa6a587cae9 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:00007fa6a66770c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fa6a599bf80 RCX: 00007fa6a587cae9 RDX: 0000000020000340 RSI: 00000000c0481273 RDI: 0000000000000005 RBP: 00007fa6a58c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fa6a599bf80 R15: 00007ffd12af9ec8 ---------------- Code disassembly (best guess): 0: c1 05 fa 0c 9a 7e 83 roll $0x83,0x7e9a0cfa(%rip) # 0x7e9a0d01 7: f8 clc 8: 01 0f add %ecx,(%rdi) a: 85 c4 test %eax,%esp c: 02 00 add (%rax),%al e: 00 9c 58 f6 c4 02 0f add %bl,0xf02c4f6(%rax,%rbx,2) 15: 85 af 02 00 00 48 test %ebp,0x48000002(%rdi) 1b: 85 ed test %ebp,%ebp 1d: 74 01 je 0x20 1f: fb sti 20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 27: fc ff df * 2a: 48 01 c3 add %rax,%rbx <-- trapping instruction 2d: 48 c7 03 00 00 00 00 movq $0x0,(%rbx) 34: 48 c7 43 08 00 00 00 movq $0x0,0x8(%rbx) 3b: 00 3c: 48 rex.W 3d: 8b .byte 0x8b 3e: 84 .byte 0x84 3f: 24 .byte 0x24