BUG: workqueue leaked atomic, lock or RCU: syz-executor[NUM] (2)

Status: moderation: reported on 2026/11/23 02:22
Subsystems: net
Labels: prio:high
[Documentation on labels]
Reported-by: syzbot+a73d496b2c6919c3f12c@syzkaller.appspotmail.com
First crash: 4d18h, last: 4d18h
✨ 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(), workqueue checks whether a work function leaked locks by verifying lockdep_depth(current) == lockdep_start_depth. Unlike kthread workers where start depth is zero, bottom-half workers (bh_worker, WQ_BH) run in softirq context where current may already hold locks from an interrupted task context or PREEMPT_RT worker callback locks, yielding a non-zero lockdep_start_depth. Because lockdep_depth(tsk) is defined as (debug_locks ? (tsk)->lockdep_depth : 0), disabling debug_locks during work execution causes lockdep_depth(current) to abruptly evaluate to 0. Lacking a check for debug_locks, process_one_work() falsely detects a lock mismatch (e.g. lock=4->0) and emits a spurious "BUG: workqueue leaked atomic, lock or RCU".

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

Root Cause Analysis

1. Components and Functions Involved

2. Mechanism and Lifecycle Violation

In kernel/workqueue.c:process_one_work(), the workqueue subsystem verifies that a work item does not leak atomic context, lockdep locks, or RCU read-side critical sections:

3466:		rcu_start_depth = rcu_preempt_depth();
3467:		lockdep_start_depth = lockdep_depth(current);
...
3495:		worker->current_func(work);
...
3506:		if (unlikely((worker->task && in_atomic()) ||
3507:			     lockdep_depth(current) != lockdep_start_depth ||
3508:			     rcu_preempt_depth() != rcu_start_depth)) {
3509:			pr_err("BUG: workqueue leaked atomic, lock or RCU: %s[%d]\n"
...

In include/linux/lockdep.h:279, lockdep_depth is defined as:

#define lockdep_depth(tsk)	(debug_locks ? (tsk)->lockdep_depth : 0)
  1. Difference between standard kthread workers and bottom-half workers (bh_worker):

    • For standard workqueue kthread workers (worker_thread), work items run on dedicated kthreads where no outer locks are held when process_one_work() begins (lockdep_start_depth == 0). If debug_locks turns off during work execution, lockdep_depth(current) evaluates to 0, which matches lockdep_start_depth == 0.
    • Bottom-half workers (bh_worker for WQ_BH), introduced to run work items in bottom-half / softirq context, run in softirq context on whatever task happened to trigger softirqs (e.g., syz-executor during local_bh_enable() inside __alloc_skb()). That task may already hold locks from its syscall context (e.g., rtnl_mutex in rtnetlink_rcv_msg()), RCU read-side critical sections, and on CONFIG_PREEMPT_RT, bh_worker()'s callback lock pool->cb_lock (worker_lock_callback()). As a result, lockdep_start_depth is legitimately non-zero (recorded as 4 in this report).
  2. Triggering the false-positive BUG:

    • During the execution of worker->current_func(work) (here usb_giveback_urb_bh), debug_locks was turned off (for example, due to a lockdep internal table/depth limit being reached such as in alloc_list_entry(), save_trace(), or add_chain_cache() calling debug_locks_off_graph_unlock(), or a concurrent debug_locks_off()).
    • When debug_locks becomes 0, lockdep_depth(current) macro evaluates to 0 regardless of the actual number of held locks.
    • Because RCU=2->2, the RCU critical sections were not leaked. However, kernel/workqueue.c:3507 evaluates:
      lockdep_depth(current) != lockdep_start_depth // (0 != 4) -> true
      
      without first checking whether debug_locks is still active.
    • Consequently, process_one_work() assumes that locks were improperly released or leaked (lock=4->0) and prints BUG: workqueue leaked atomic, lock or RCU: syz-executor[6626], followed by debug_show_held_locks() printing INFO: lockdep is turned off..
▶ ▼ ✨ AI Jobs (3)
ID Workflow Result Correct Bug Created Started Finished Revision
fd23ac6c repro-c 💥 BUG: workqueue leaked atomic, lock or RCU: syz-executor[NUM] (2) 2026/11/21 06:12 2026/11/21 06:12 2026/11/21 14:21 b2c69459
ed42e2c2 bisect-cause ❓ BUG: workqueue leaked atomic, lock or RCU: syz-executor[NUM] (2) 2026/11/19 01:33 2026/11/19 01:33 2026/11/19 02:32 2006bdcc
9f13d71f assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ✅ UserNamespace: ✅ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ BUG: workqueue leaked atomic, lock or RCU: syz-executor[NUM] (2) 2026/11/19 01:31 2026/11/19 01:31 2026/11/19 02:19 2006bdcc
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: workqueue leaked atomic, lock or RCU: syz-executor[NUM] usb -1 1 959d 955d 0/29 auto-obsoleted due to no activity on 2024/07/06 20:30

Sample crash report:
BUG: workqueue leaked atomic, lock or RCU: syz-executor[6626]
     preempt=0x00000000 lock=4->0 RCU=2->2 workfn=usb_giveback_urb_bh
INFO: lockdep is turned off.
CPU: 0 UID: 0 PID: 6626 Comm: syz-executor 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_hi_action+0xf/0x70 kernel/softirq.c:1028
 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]
 __alloc_skb+0x1b1/0x7a0 net/core/skbuff.c:700
 alloc_skb include/linux/skbuff.h:1390 [inline]
 nlmsg_new include/net/netlink.h:1055 [inline]
 rtmsg_fib+0xda/0x440 net/ipv4/fib_semantics.c:584
 fib_table_insert+0xd54/0x1b10 net/ipv4/fib_trie.c:1381
 fib_magic+0x43b/0x530 net/ipv4/fib_frontend.c:1147
 fib_add_ifaddr+0x376/0x5d0 net/ipv4/fib_frontend.c:1184
 fib_netdev_event+0x382/0x490 net/ipv4/fib_frontend.c:1529
 notifier_call_chain+0x1a5/0x3d0 kernel/notifier.c:86
 call_netdevice_notifiers_extack net/core/dev.c:2351 [inline]
 call_netdevice_notifiers net/core/dev.c:2365 [inline]
 __dev_notify_flags+0x31e/0x510 net/core/dev.c:10063
 netif_change_flags+0xde/0x1b0 net/core/dev.c:10092
 do_setlink+0xdd6/0x47a0 net/core/rtnetlink.c:3294
 rtnl_changelink net/core/rtnetlink.c:3942 [inline]
 __rtnl_newlink net/core/rtnetlink.c:4113 [inline]
 rtnl_newlink+0x15b0/0x1c30 net/core/rtnetlink.c:4252
 rtnetlink_rcv_msg+0x802/0xc00 net/core/rtnetlink.c:7169
 netlink_rcv_skb+0x226/0x4a0 net/netlink/af_netlink.c:2585
 netlink_unicast_kernel net/netlink/af_netlink.c:1336 [inline]
 netlink_unicast+0x90c/0xac0 net/netlink/af_netlink.c:1362
 netlink_sendmsg+0x7f0/0xb20 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec+0x14e/0x190 net/socket.c:800
 __sock_sendmsg net/socket.c:818 [inline]
 __sys_sendto+0x41e/0x5d0 net/socket.c:2283
 __do_sys_sendto net/socket.c:2290 [inline]
 __se_sys_sendto net/socket.c:2286 [inline]
 __x64_sys_sendto+0xde/0x100 net/socket.c:2286
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa34ec39d8e
Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
RSP: 002b:00007fff60930748 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 000055557a5b1500 RCX: 00007fa34ec39d8e
RDX: 000000000000002c RSI: 00007fa34fa24670 RDI: 0000000000000003
RBP: 0000000000000001 R08: 00007fff609307c4 R09: 000000000000000c
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000000 R14: 00007fa34fa24670 R15: 0000000000000000
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/18 08:37 upstream 20eef29b7c84 eb4895d7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: workqueue leaked atomic, lock or RCU: syz-executor[NUM]
* Struck through repros no longer work on HEAD.