Description
In the Linux kernel, the following vulnerability has been resolved:

locking/lockdep: Invalidate stale class_cache entries for zapped classes

syzbot reported a lockdep splat hitting DEBUG_LOCKS_WARN_ON(1) in
hlock_class() due to an invalid class_idx:

WARNING: kernel/locking/lockdep.c:238 at __lock_acquire+0x382/0x2cf0 kernel/locking/lockdep.c:5203
Workqueue: wg-crypt-wg0 wg_packet_tx_worker
RIP: 0010:hlock_class kernel/locking/lockdep.c:238 [inline]
RIP: 0010:check_wait_context kernel/locking/lockdep.c:4870 [inline]
RIP: 0010:__lock_acquire+0x389/0x2cf0 kernel/locking/lockdep.c:5203
Call Trace:
<IRQ>
lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5886
_raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:173
tcp_tsq_handler+0x29/0x200 net/ipv4/tcp_output.c:1291
tcp_tsq_workfn+0x384/0x410 net/ipv4/tcp_output.c:1325
...

When a lock class is zapped (e.g. during module unload or key
unregistration), zap_class() clears the class's bit in
lock_classes_in_use and removes it from the class hash table.
However, existing lockdep_map instances embedded in data structures
may still retain a pointer to the zapped class in their class_cache[]
array.

When __lock_acquire() subsequently runs on such a lock, it finds
lock->class_cache[subclass] != NULL, skipping register_lock_class()
and assigning hlock->class_idx to the index of the zapped class. When
check_wait_context() or hlock_class() inspects the held_lock, it finds
!test_bit(class_idx, lock_classes_in_use) and warns. Furthermore, if
the zapped slot is subsequently re-allocated to an unrelated lock key,
the stale class_cache entry would erroneously match the unrelated
class (ABA issue).

Add lock_class_cache_is_valid() to validate that the cached class is
within lock_classes bounds, still allocated in lock_classes_in_use
(using uninstrumented arch_test_bit() in __always_inline context so it
is safe in noinstr contexts like match_held_lock()), and that
class->key matches the expected subkey (taking lockdep_set_subclass()
overrides into account). Also use READ_ONCE()/WRITE_ONCE() when
accessing class_cache[]. If the entry is invalid or stale, fall back
to register_lock_class() / look_up_lock_class().
Published: 2026-10-14
Score: 5.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Kernel instability and excessive lockdep warnings
Action: Patch
AI Analysis

Impact

The vulnerability arises in the Linux kernel’s lockdep subsystem where stale entries in the class_cache array persist after a lock class is deleted. When a lock is subsequently acquired, the stale entry causes the kernel to assign an invalid class index and trigger a DEBUG_LOCKS_WARN_ON warning. The flaw is a memory safety issue (CWE‑825). While the bug does not directly crash the kernel, repeated warnings can degrade performance and, in heavily debugged or heavily loaded environments, may contribute to subtle instability. Based on the description, it is inferred that the underlying weakness stems from inadequate validation of cached class pointers during lock acquisition. There is no evidence of direct user‑space exploitation, and the kernel’s internal lock logic is the primary surface.

Affected Systems

All Linux kernel releases built with CONFIG_LOCKDEP enabled contain this issue. The affected builds are any upstream Linux kernels prior to the commit that added lock_class_cache_is_valid. This includes kernels shipped by all major distributions when lockdep is active, regardless of vendor. No specific vendor or version restriction beyond the timing of the patch.

Risk and Exploitability

The EPSS score is below 1 % and the vulnerability is not listed in CISA’s KEV catalog. A CVSS score of 5.5 indicates moderate severity, but the internal nature of the bug suggests a low probability of exploitation. The most likely trigger involves internal events such as unloading a module or unregistering a key that frees a lock class, which generally requires kernel‑process or root access. For privileged users, repeated warnings and potential instability are the principal risks; for unprivileged users the risk remains low. The likelihood of remote or non‑privileged exploitation is effectively negligible.

Generated by OpenCVE AI on October 16, 2026 at 22:59 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a kernel version that contains the lock_class_cache_is_valid patch
  • If a kernel upgrade is not immediately possible, disable the CONFIG_LOCKDEP option or the DEBUG_LOCKS warning mechanism to prevent warning splats and possible instability
  • Verify that module and key registration code properly cleans up lock classes to avoid leaving stale cache entries

Generated by OpenCVE AI on October 16, 2026 at 22:59 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4841-1 linux security update
Ubuntu USN Ubuntu USN USN-8961-1 Linux kernel vulnerabilities
History

Fri, 16 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-825
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Low


Fri, 16 Oct 2026 00:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

Thu, 15 Oct 2026 06:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

Wed, 14 Oct 2026 13:45:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: locking/lockdep: Invalidate stale class_cache entries for zapped classes syzbot reported a lockdep splat hitting DEBUG_LOCKS_WARN_ON(1) in hlock_class() due to an invalid class_idx: WARNING: kernel/locking/lockdep.c:238 at __lock_acquire+0x382/0x2cf0 kernel/locking/lockdep.c:5203 Workqueue: wg-crypt-wg0 wg_packet_tx_worker RIP: 0010:hlock_class kernel/locking/lockdep.c:238 [inline] RIP: 0010:check_wait_context kernel/locking/lockdep.c:4870 [inline] RIP: 0010:__lock_acquire+0x389/0x2cf0 kernel/locking/lockdep.c:5203 Call Trace: <IRQ> lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5886 _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:173 tcp_tsq_handler+0x29/0x200 net/ipv4/tcp_output.c:1291 tcp_tsq_workfn+0x384/0x410 net/ipv4/tcp_output.c:1325 ... When a lock class is zapped (e.g. during module unload or key unregistration), zap_class() clears the class's bit in lock_classes_in_use and removes it from the class hash table. However, existing lockdep_map instances embedded in data structures may still retain a pointer to the zapped class in their class_cache[] array. When __lock_acquire() subsequently runs on such a lock, it finds lock->class_cache[subclass] != NULL, skipping register_lock_class() and assigning hlock->class_idx to the index of the zapped class. When check_wait_context() or hlock_class() inspects the held_lock, it finds !test_bit(class_idx, lock_classes_in_use) and warns. Furthermore, if the zapped slot is subsequently re-allocated to an unrelated lock key, the stale class_cache entry would erroneously match the unrelated class (ABA issue). Add lock_class_cache_is_valid() to validate that the cached class is within lock_classes bounds, still allocated in lock_classes_in_use (using uninstrumented arch_test_bit() in __always_inline context so it is safe in noinstr contexts like match_held_lock()), and that class->key matches the expected subkey (taking lockdep_set_subclass() overrides into account). Also use READ_ONCE()/WRITE_ONCE() when accessing class_cache[]. If the entry is invalid or stale, fall back to register_lock_class() / look_up_lock_class().
Title locking/lockdep: Invalidate stale class_cache entries for zapped classes
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-10-19T09:18:51.739Z

Reserved: 2026-09-25T10:25:14.346Z

Link: CVE-2026-98398

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-14T14:17:50.760

Modified: 2026-10-19T10:18:44.480

Link: CVE-2026-98398

cve-icon Redhat

Severity : Low

Publid Date: 2026-10-14T00:00:00Z

Links: CVE-2026-98398 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-19T17:30:13Z

Weaknesses
  • CWE-825

    Expired Pointer Dereference