CVE-2026-98222
NoneCVSS
—
EPSS
0.2%
Published
Oct 6, 2026
CISA due date
—
Cloudanix analysis
A bug in the Linux kernel's handling of encrypted keys can let a local user corrupt internal memory structures, which may allow them to gain higher privileges on the machine.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Moderate
- Impact
- Privilege Gain
- Component
- OS kernel
- Class
- Buffer Overflow
- Remediation
- Patch
- Effort
- Medium
- Patch risk
- Low
What it actually does
Integer overflow in encrypted_key_alloc() truncates datablob_len and key->datalen to u16, resulting in undersized kzalloc and subsequent slab-out-of-bounds write when copying master key material.
Why it matters to the business
Local attackers can corrupt kernel memory, potentially leading to privilege escalation or denial of service on any system using the encrypted keys subsystem; the flaw affects the core Linux kernel so impact is widespread across servers, containers, and embedded devices.
How an attack unfolds
An attacker with the ability to create or load an encrypted key supplies crafted payload and description lengths whose sum exceeds 65535; the truncated allocation size causes __ekey_init() to write beyond the buffer, triggering KASAN-detected out-of-bounds access that can be turned into arbitrary kernel write.
How to fix it
Upgrade to a kernel containing the fix that replaces direct length calculations with check_add_overflow() and uses kzalloc_flex() for the flexible array; apply the vendor-supplied patch or newer mainline release that enforces proper size checks before allocation.
How to confirm the fix worked
Confirm the running kernel source contains the check_add_overflow() guard and kzalloc_flex() call in encrypted_key_alloc(); recompile and boot-test with a synthetic key whose total length exceeds U16_MAX to verify rejection rather than truncation.
Typical attack path
- Obtain local code execution or shell on target system
- Invoke add_key() or keyctl() with encrypted key type and oversized description/payload
- Trigger integer overflow in datablob_len calculation
- Cause undersized allocation and subsequent out-of-bounds write
- Leverage resulting memory corruption for privilege escalation
How to detect it
Review kernel audit logs and KASAN reports for slab-out-of-bounds writes originating from __ekey_init() or encrypted_key_alloc(); correlate with keyctl or add_key system-call records showing unusually large description or payload arguments.
What your security team should do
- Prioritize kernel updates on all systems that compile or run the encrypted keys module
- Restrict unprivileged key creation via keyctl and user namespaces where possible
- Monitor for future CVEs in the KEYS subsystem given repeated integer-handling issues
- Include kernel version checks in vulnerability scanning pipelines
The record
In the Linux kernel, the following vulnerability has been resolved: KEYS: encrypted: fix integer overflow of datablob_len encrypted_key_alloc() stores datablob_len in a u16. It is computed from multiple string and payload lengths. If the result exceeds U16_MAX, the assignment truncates the allocation size. KASAN reports a 32760-byte slab-out-of-bounds write when __ekey_init() copies the master key description into the undersized buffer. The total payload length stored in key->datalen is also a u16. Use check_add_overflow() to reject values that do not fit either destination, and use kzalloc_flex() for the flexible-array allocation.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|