BUG: workqueue leaked atomic, lock or RCU: irq/NUM-virtio1-[NUM] (2)

Status: moderation: reported on 2026/11/21 00:01
Subsystems: kernel
Labels: prio:high
[Documentation on labels]
Reported-by: syzbot+6cfe03029e888d5bb5f6@syzkaller.appspotmail.com
First crash: 6d08h, last: 6d08h
✨ AI cause bisection: introduced by (AI job) :
commit c35aea39d1e106f61fd2130f0d32a3bac8bd4570
Author: Tejun Heo <tj@kernel.org>
Date: Sun Feb 4 21:28:06 2024 +0000

  workqueue: Update lock debugging code

✨ AI-generated root cause summary:

In process_one_work() (kernel/workqueue.c), lockdep_start_depth records current->lockdep_depth before running a work item and validates lockdep_depth(current) == lockdep_start_depth after execution. When executing on bottom-half workqueues (WQ_BH) under CONFIG_PREEMPT_RT, bh_worker() runs with locks legitimately held (such as pool->cb_lock and softirq contexts), yielding a non-zero initial depth (lockdep_start_depth == 3). If debug_locks is disabled while the work function (here tcp_tsq_workfn) executes, lockdep_depth(current) evaluates to 0 because include/linux/lockdep.h defines lockdep_depth(tsk) as (debug_locks ? (tsk)->lockdep_depth : 0). Because process_one_work() fails to check whether debug_locks is still set before checking lockdep_depth(current) != lockdep_start_depth, it interprets the 0 return value as a lock leak (lock=3->0) and prints a false-positive BUG warning.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit aacb77975041:

Root Cause Analysis

1. Mechanism and Involved Entities

In kernel/workqueue.c:process_one_work():

	rcu_start_depth = rcu_preempt_depth();
	lockdep_start_depth = lockdep_depth(current);
	...
	worker->current_func(work);
	...
	if (unlikely((worker->task && in_atomic()) ||
		     lockdep_depth(current) != lockdep_start_depth ||
		     rcu_preempt_depth() != rcu_start_depth)) {
		pr_err("BUG: workqueue leaked atomic, lock or RCU: %s[%d]\n"
		       "     preempt=0x%08x lock=%d->%d RCU=%d->%d workfn=%ps\n",
		       current->comm, task_pid_nr(current), preempt_count(),
		       lockdep_start_depth, lockdep_depth(current),
		       rcu_start_depth, rcu_preempt_depth(),
		       worker->current_func);
		debug_show_held_locks(current);
		dump_stack();
	}

In include/linux/lockdep.h:

#define lockdep_depth(tsk)	(debug_locks ? (tsk)->lockdep_depth : 0)

2. Triggering Sequence & Invariant Violation

  1. Initial non-zero lock depth in BH workers: On standard workqueues executed by dedicated kthreads (worker_thread()), workers enter process_one_work() with zero locks held (lockdep_start_depth == 0). However, for bottom-half workqueues (WQ_BH), work items are dispatched through bh_worker() directly from softirq processing (in this trace: irq_forced_thread_fn -> local_bh_enable -> __do_softirq -> handle_softirqs -> tasklet_action -> workqueue_softirq_action -> bh_worker). On kernels built with CONFIG_PREEMPT_RT=y, bh_worker() legitimately holds outer locks across work item execution (specifically pool->cb_lock via worker_lock_callback(pool) at line 3865, alongside the surrounding softirq context). Hence, lockdep_depth(current) at work function entry records lockdep_start_depth = 3.

  2. Disabling of lockdep during work item execution: While the work item tcp_tsq_workfn is executing (or concurrently on another CPU), lockdep gets deactivated (debug_locks = 0 via debug_locks_off()). This can occur due to lockdep internal table limits (e.g., MAX_LOCK_DEPTH, MAX_LOCK_CHAINS) or another lockdep check failing elsewhere in the kernel.

  3. False-positive lock leak detection: When process_one_work() completes worker->current_func(work) and executes the post-condition check:

    • lockdep_depth(current) evaluates debug_locks ? current->lockdep_depth : 0.
    • Because debug_locks == 0, lockdep_depth(current) returns 0.
    • For standard kworkers where lockdep_start_depth == 0, 0 != 0 evaluated to false. But for bh_worker, lockdep_depth(current) != lockdep_start_depth evaluates to 0 != 3 (true).
    • process_one_work() does not guard the depth comparison with a check for debug_locks (unlike other kernel sanity checks such as WARN_ON_ONCE(debug_locks && p->lockdep_depth) in kernel/freezer.c).
    • As a result, it reports a spurious lock leak: preempt=0x00000000 lock=3->0 RCU=2->2 workfn=tcp_tsq_workfn
    • Immediately following this, debug_show_held_locks(current) is called, which confirms that lockdep was shut off by printing: INFO: lockdep is turned off.
▶ ▼ ✨ AI Jobs (3)
ID Workflow Result Correct Bug Created Started Finished Revision
5abddc82 bisect-cause ❓ BUG: workqueue leaked atomic, lock or RCU: irq/NUM-virtio1-[NUM] (2) 2026/11/18 22:38 2026/11/18 22:38 2026/11/18 23:12 2006bdcc
4e9d5b4d repro-c 💥 BUG: workqueue leaked atomic, lock or RCU: irq/NUM-virtio1-[NUM] (2) 2026/11/17 06:13 2026/11/17 06:13 2026/11/17 12:59 a3e64cfc
064885d1 assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ✅ UserNamespace: ✅ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ BUG: workqueue leaked atomic, lock or RCU: irq/NUM-virtio1-[NUM] (2) 2026/11/15 00:26 2026/11/15 00:26 2026/11/15 01:16 819ebe34
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: workqueue leaked atomic, lock or RCU: irq/NUM-virtio1-[NUM] kernel -1 1 221d 221d 0/29 closed as invalid on 2026/04/23 02:33

Sample crash report:
BUG: workqueue leaked atomic, lock or RCU: irq/34-virtio1-[1200]
     preempt=0x00000000 lock=3->0 RCU=2->2 workfn=tcp_tsq_workfn
INFO: lockdep is turned off.
CPU: 1 UID: 0 PID: 1200 Comm: irq/34-virtio1- Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 process_one_work kernel/workqueue.c:3516 [inline]
 process_scheduled_works+0x12c2/0x1630 kernel/workqueue.c:3578
 bh_worker+0x4b3/0xbb0 kernel/workqueue.c:3885
 tasklet_action+0xc/0x70 kernel/softirq.c:1022
 handle_softirqs+0x1d4/0x6c0 kernel/softirq.c:669
 __do_softirq kernel/softirq.c:703 [inline]
 __local_bh_enable_ip+0x16f/0x2b0 kernel/softirq.c:325
 local_bh_enable include/linux/bottom_half.h:33 [inline]
 irq_forced_thread_fn+0xe9/0x120 kernel/irq/manage.c:1170
 irq_thread+0x460/0x6d0 kernel/irq/manage.c:1278
 kthread+0x38b/0x470 kernel/kthread.c:436
 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/15 00:26 upstream aacb77975041 819ebe34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: workqueue leaked atomic, lock or RCU: irq/NUM-virtio1-[NUM]
* Struck through repros no longer work on HEAD.