================================ WARNING: inconsistent lock state 6.7.0-rc1-next-20231117-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. udevd/4512 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff88803e4edc98 (&sighand->siglock){?.+.}-{2:2}, at: __lock_task_sighand+0xc2/0x340 kernel/signal.c:1422 {HARDIRQ-ON-W} state was registered 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 irq event stamp: 2283398 hardirqs last enabled at (2283397): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (2283397): [] _raw_spin_unlock_irqrestore+0x4e/0x70 kernel/locking/spinlock.c:194 hardirqs last disabled at (2283398): [] sysvec_apic_timer_interrupt+0xe/0xb0 arch/x86/kernel/apic/apic.c:1076 softirqs last enabled at (2282738): [] softirq_handle_end kernel/softirq.c:399 [inline] softirqs last enabled at (2282738): [] __do_softirq+0x591/0x8d5 kernel/softirq.c:582 softirqs last disabled at (2282597): [] invoke_softirq kernel/softirq.c:427 [inline] softirqs last disabled at (2282597): [] __irq_exit_rcu kernel/softirq.c:632 [inline] softirqs last disabled at (2282597): [] irq_exit_rcu+0xb5/0x120 kernel/softirq.c:644 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&sighand->siglock); lock(&sighand->siglock); *** DEADLOCK *** 4 locks held by udevd/4512: #0: ffffffff8d8fd6d0 (tomoyo_ss){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:116 [inline] #0: ffffffff8d8fd6d0 (tomoyo_ss){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:215 [inline] #0: ffffffff8d8fd6d0 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_read_lock security/tomoyo/common.h:1108 [inline] #0: ffffffff8d8fd6d0 (tomoyo_ss){.+.+}-{0:0}, at: tomoyo_check_open_permission+0x164/0x3b0 security/tomoyo/file.c:767 #1: ffff888025ec8038 (&new_timer->it_lock){-...}-{2:2}, at: posix_timer_fn+0x2d/0x3d0 kernel/time/posix-timers.c:318 #2: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline] #2: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline] #2: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: send_sigqueue+0x10c/0x840 kernel/signal.c:1978 #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: __lock_task_sighand+0x3f/0x340 kernel/signal.c:1405 stack backtrace: CPU: 1 PID: 4512 Comm: udevd 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_usage_bug kernel/locking/lockdep.c:3970 [inline] valid_state kernel/locking/lockdep.c:4012 [inline] mark_lock_irq kernel/locking/lockdep.c:4215 [inline] mark_lock+0x91a/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 __lock_task_sighand+0xc2/0x340 kernel/signal.c:1422 lock_task_sighand include/linux/sched/signal.h:748 [inline] send_sigqueue+0x1d4/0x840 kernel/signal.c:1996 posix_timer_event kernel/time/posix-timers.c:298 [inline] posix_timer_fn+0x181/0x3d0 kernel/time/posix-timers.c:324 __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:unwind_next_frame+0x664/0x2390 arch/x86/kernel/unwind_orc.c:512 Code: 07 38 ca 0f 9e c1 84 d2 0f 95 c2 84 d1 0f 85 66 19 00 00 41 83 e5 07 44 38 e8 0f 9e c2 84 c0 0f 95 c0 84 c2 0f 85 4f 19 00 00 <4c> 89 fa 45 0f b6 6c 24 05 48 b8 00 00 00 00 00 fc ff df 48 c1 ea RSP: 0018:ffffc900031af340 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffffc900031af3c0 RCX: 0000000000000001 RDX: 0000000000000001 RSI: ffffffff813a3c30 RDI: 0000000000000001 RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000002 R11: 0000000000000001 R12: ffffffff8fb072dc R13: 0000000000000001 R14: ffffffff8fb072e0 R15: ffffc900031af3f5 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_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1809 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1835 slab_free mm/slub.c:3784 [inline] __kmem_cache_free+0xc0/0x180 mm/slub.c:3797 tomoyo_check_open_permission+0x19d/0x3b0 security/tomoyo/file.c:786 tomoyo_file_open security/tomoyo/tomoyo.c:333 [inline] tomoyo_file_open+0xa7/0xd0 security/tomoyo/tomoyo.c:328 security_file_open+0x6a/0xe0 security/security.c:2920 do_dentry_open+0x583/0x18c0 fs/open.c:935 do_open fs/namei.c:3624 [inline] path_openat+0x1e55/0x2c50 fs/namei.c:3781 do_filp_open+0x1dc/0x430 fs/namei.c:3811 do_sys_openat2+0x176/0x1e0 fs/open.c:1440 do_sys_open fs/open.c:1455 [inline] __do_sys_openat fs/open.c:1471 [inline] __se_sys_openat fs/open.c:1466 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1466 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:0x7f7ddab1a477 Code: 10 00 00 00 44 8b 54 24 e0 48 89 44 24 c0 48 8d 44 24 d0 48 89 44 24 c8 44 89 c2 4c 89 ce bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 10 48 8b 15 82 69 0d 00 f7 d8 64 89 02 48 83 RSP: 002b:00007fffdbf9c2d8 EFLAGS: 00000287 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00005630deb02fa0 RCX: 00007f7ddab1a477 RDX: 0000000000090800 RSI: 00005630deaf3a10 RDI: 00000000ffffff9c RBP: 00005630deb1b900 R08: 0000000000090800 R09: 00005630deaf3a10 R10: 0000000000000000 R11: 0000000000000287 R12: 00005630deaf3a10 R13: 00000000000000ff R14: 00005630dcfc41c4 R15: 0000000000000000 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 38 ca cmp %cl,%dl 2: 0f 9e c1 setle %cl 5: 84 d2 test %dl,%dl 7: 0f 95 c2 setne %dl a: 84 d1 test %dl,%cl c: 0f 85 66 19 00 00 jne 0x1978 12: 41 83 e5 07 and $0x7,%r13d 16: 44 38 e8 cmp %r13b,%al 19: 0f 9e c2 setle %dl 1c: 84 c0 test %al,%al 1e: 0f 95 c0 setne %al 21: 84 c2 test %al,%dl 23: 0f 85 4f 19 00 00 jne 0x1978 * 29: 4c 89 fa mov %r15,%rdx <-- trapping instruction 2c: 45 0f b6 6c 24 05 movzbl 0x5(%r12),%r13d 32: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 39: fc ff df 3c: 48 rex.W 3d: c1 .byte 0xc1 3e: ea (bad)