Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-98842 Overview
CVE-2026-98842 is a Linux kernel vulnerability in the module loader. When codetag_load_module() fails during module loading, the err variable is not updated to reflect the failure. As a result, load_module() returns 0 (success) even though the module has already been torn down. For livepatch modules, the mod->klp_info structure allocated by copy_module_elf() leaks on the same error path. The fix sets the error code correctly and introduces a livepatch_cleanup label to release klp_info before exiting.
Critical Impact
The module loader can report success after a failed load, leaving userspace with inconsistent state and leaking kernel memory when loading livepatch modules.
Affected Products
- Linux kernel versions containing the codetag_load_module() call path in load_module()
- Kernel builds with livepatch (CONFIG_LIVEPATCH) support exposed to the memory leak path
- Distributions shipping the affected stable kernel branches referenced in the upstream commits
Discovery Timeline
- 2026-10-18 - CVE-2026-98842 published to the National Vulnerability Database (NVD)
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-98842
Vulnerability Analysis
The defect sits in the Linux kernel module loading path. load_module() calls codetag_load_module() late in the initialization sequence. If that call fails, the surrounding code tears down the partially initialized module but does not propagate the error into the local err variable. load_module() therefore returns 0, signaling success to the caller even though the module no longer exists in a usable state.
A second issue affects livepatch modules. The structure referenced by mod->klp_info, allocated by copy_module_elf(), is not released on this failure path. Each failed load of a livepatch module leaks the allocation. The upstream fix introduces a dedicated livepatch_cleanup label that frees klp_info before jumping to the shared error exit.
The condition is a kernel-side correctness bug rather than a direct code execution primitive. Impact includes inconsistent module state visible to userspace, follow-on errors in tools that interpret a 0 return as a successful load, and gradual kernel memory exhaustion when livepatch loads fail repeatedly.
Root Cause
The root cause is a missing assignment to the err variable after codetag_load_module() returns a non-zero error. The error path also lacks cleanup for the livepatch-specific allocation held in mod->klp_info, producing a memory leak in addition to the lost status code.
Attack Vector
Triggering the condition requires the ability to invoke module loading, typically restricted to privileged users holding CAP_SYS_MODULE. An attacker or buggy automation that repeatedly loads a module which fails inside codetag_load_module() can cause the kernel to report success for each failure and, for livepatch modules, consume additional kernel memory on each attempt.
See the upstream commits for the exact patch content: Linux Kernel Commit 258310d5, Linux Kernel Commit bfc721ee, and Linux Kernel Commit c79cf15e.
Detection Methods for CVE-2026-98842
Indicators of Compromise
- insmod or modprobe returning success while the target module is absent from /proc/modules and lsmod output
- Kernel log messages tied to codetag_load_module() failures without a matching failure return to userspace
- Growing slab consumption correlated with repeated livepatch module load attempts
Detection Strategies
- Compare the return status of module load syscalls against the post-load state of /sys/module/<name> to detect lost error codes.
- Monitor dmesg for codetag subsystem warnings during module initialization and alert when they occur without a userspace-visible error.
- Track kernel memory consumption on hosts running livepatch workflows and flag unexplained growth tied to livepatch load activity.
Monitoring Recommendations
- Audit init_module and finit_module syscalls through the kernel audit subsystem and correlate with the resulting module list.
- Collect kernel ring buffer output into a central log pipeline so anomalies in module loader behavior are retained for review.
- Alert on repeated livepatch load attempts from the same process or orchestration job.
How to Mitigate CVE-2026-98842
Immediate Actions Required
- Apply the upstream kernel patches referenced in the stable commits and rebuild or update affected kernels.
- Restrict CAP_SYS_MODULE to trusted administrative accounts and automation only.
- Review livepatch deployment pipelines for retry loops that could amplify the memory leak before patching completes.
Patch Information
The fix is distributed across three upstream commits: Linux Kernel Commit 258310d5, Linux Kernel Commit bfc721ee, and Linux Kernel Commit c79cf15e. The patches set err to the value returned by codetag_load_module() and add a livepatch_cleanup label that frees mod->klp_info before taking the shared error exit. Consume the fixed kernel from your distribution vendor once it is published for your supported stable branch.
Workarounds
- Lock down module loading using kernel.modules_disabled=1 on systems that do not require runtime module loads after boot.
- Sign and allow-list kernel modules so unexpected modules cannot reach the failing code path.
- Pause automated livepatch rollout on affected kernels until the stable update is installed to avoid the klp_info leak.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

