================================ WARNING: inconsistent lock state 6.7.0-rc1-next-20231117-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. kworker/u4:6/1030 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff888020395c98 (&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: 9468106 hardirqs last enabled at (9468105): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1386 [inline] hardirqs last enabled at (9468105): [] finish_lock_switch kernel/sched/core.c:5153 [inline] hardirqs last enabled at (9468105): [] finish_task_switch.isra.0+0x217/0xcb0 kernel/sched/core.c:5271 hardirqs last disabled at (9468106): [] sysvec_apic_timer_interrupt+0xe/0xb0 arch/x86/kernel/apic/apic.c:1076 softirqs last enabled at (9468096): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (9468096): [] batadv_nc_purge_paths+0x1ce/0x3c0 net/batman-adv/network-coding.c:471 softirqs last disabled at (9468094): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (9468094): [] batadv_nc_purge_paths+0xd3/0x3c0 net/batman-adv/network-coding.c:442 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&sighand->siglock); lock(&sighand->siglock); *** DEADLOCK *** 6 locks held by kworker/u4:6/1030: #0: ffff88814b692138 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_one_work+0x78c/0x15f0 kernel/workqueue.c:2611 #1: ffffc90004b57d80 ((work_completion)(&(&bat_priv->nc.work)->work)){+.+.}-{0:0}, at: process_one_work+0x7f6/0x15f0 kernel/workqueue.c:2612 #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: batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline] #2: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: batadv_nc_worker+0x168/0x10e0 net/batman-adv/network-coding.c:719 #3: ffff88807290c790 (&new_timer->it_lock){-...}-{2:2}, at: posix_timer_fn+0x2d/0x3d0 kernel/time/posix-timers.c:318 #4: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline] #4: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline] #4: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: send_sigqueue+0x10c/0x840 kernel/signal.c:1978 #5: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline] #5: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline] #5: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: __lock_task_sighand+0x3f/0x340 kernel/signal.c:1405 stack backtrace: CPU: 1 PID: 1030 Comm: kworker/u4:6 Not tainted 6.7.0-rc1-next-20231117-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Workqueue: bat_events batadv_nc_worker 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: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:ffffc90004b57ab8 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: 1ffff9200096af59 RCX: 0000000087a6b094 RDX: 0000000000000001 RSI: ffffffff8accc2e0 RDI: ffffffff8b2f1520 RBP: 0000000000000200 R08: 0000000000000000 R09: fffffbfff23e33e8 R10: ffffffff91f19f47 R11: 0000000000000002 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] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline] batadv_nc_worker+0x16e/0x10e0 net/batman-adv/network-coding.c:719 process_one_work+0x8a4/0x15f0 kernel/workqueue.c:2636 process_scheduled_works kernel/workqueue.c:2709 [inline] worker_thread+0x8b6/0x1290 kernel/workqueue.c:2790 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 ---------------- 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