Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-45950

CVE-2026-45950: Linux Kernel Memory Leak Vulnerability

CVE-2026-45950 is a memory leak flaw in the Linux kernel's StarFive crypto driver that fails to free allocated memory in error paths. This article covers the technical details, affected versions, and mitigation.

Published:

CVE-2026-45950 Overview

CVE-2026-45950 is a memory leak vulnerability in the Linux kernel's StarFive cryptographic driver. The flaw resides in the starfive_aes_aead_do_one_req() function within the AES Authenticated Encryption with Associated Data (AEAD) request handler. The function allocates the rctx->adata buffer using kzalloc() but does not free that allocation when sg_copy_to_buffer() or starfive_aes_hw_init() returns an error. Each failed request leaks kernel memory until the system exhausts available resources.

Critical Impact

Repeated failures along the affected error paths progressively drain kernel memory, which can degrade system stability on StarFive RISC-V platforms that rely on the hardware AES accelerator.

Affected Products

  • Linux kernel versions containing the StarFive crypto driver prior to the fix
  • StarFive RISC-V based platforms using the hardware AES AEAD accelerator
  • Distributions packaging the unpatched crypto: starfive driver

Discovery Timeline

  • 2026-05-27 - CVE-2026-45950 published to the National Vulnerability Database
  • 2026-05-27 - Last updated in NVD database

Technical Details for CVE-2026-45950

Vulnerability Analysis

The defect sits in the StarFive AES driver path that handles AEAD requests. When starfive_aes_aead_do_one_req() begins processing a request, it allocates a working buffer at rctx->adata with kzalloc() to stage associated data. Subsequent steps call sg_copy_to_buffer() to populate that buffer and starfive_aes_hw_init() to prepare the accelerator. If either call fails, the function returns immediately without releasing rctx->adata.

The successful path frees rctx->adata unconditionally after the write_adata operations complete. The error paths bypass that cleanup, leaving the kernel allocation orphaned. Memory leaks of this type fall under Missing Release of Memory After Effective Lifetime [CWE-401].

The issue was identified through a prototype static analysis tool combined with manual code review, and the fix was compile-tested by the maintainers.

Root Cause

The root cause is asymmetric error handling. The function uses a single allocation site but multiple early-return error branches, none of which call kfree() on rctx->adata before returning. The cleanup logic placed after the write_adata work is unreachable when these early failures occur.

Attack Vector

Triggering the leak requires the ability to submit AEAD crypto requests that exercise the StarFive accelerator and force failures in sg_copy_to_buffer() or starfive_aes_hw_init(). A local user or workload that issues repeated failing crypto operations can incrementally exhaust kernel memory, leading to a denial-of-service condition. The vulnerability does not provide code execution or information disclosure.

No public proof-of-concept exploit code is referenced in the advisory, and no exploitation in the wild has been reported.

Detection Methods for CVE-2026-45950

Indicators of Compromise

  • Steady, unexplained growth in kernel slab allocations on StarFive RISC-V hosts using the hardware crypto driver
  • Repeated errors from sg_copy_to_buffer() or starfive_aes_hw_init() in dmesg correlated with rising memory usage
  • Out-of-memory kills or allocation failures on systems with long uptime running AEAD-heavy workloads

Detection Strategies

  • Compare the running kernel version against the fixed commits 38d80307, 4869d0e4, 5f2c964a, and ccb679fd referenced in the kernel git history
  • Monitor /proc/slabinfo and /proc/meminfo for sustained kernel memory growth that does not correlate with workload changes
  • Use kmemleak on test systems exercising the StarFive AES AEAD path to confirm leaks from starfive_aes_aead_do_one_req

Monitoring Recommendations

  • Track kernel memory consumption baselines on affected RISC-V hardware and alert on deviations
  • Audit crypto subsystem error rates through kernel logs forwarded to a central log platform
  • Inventory hosts that load the starfive crypto module and prioritize them for patch validation

How to Mitigate CVE-2026-45950

Immediate Actions Required

Patch Information

The fix adds explicit kfree(rctx->adata) calls in the error paths returned from sg_copy_to_buffer() and starfive_aes_hw_init() so that the buffer is released regardless of which exit path the function takes. Backports are available across multiple stable kernel branches through the four referenced commits.

Workarounds

  • Unload the StarFive AES module with modprobe -r on systems where the hardware accelerator is not required, falling back to software crypto
  • Reduce exposure by restricting unprivileged workloads from issuing high volumes of failing AEAD operations
  • Reboot affected hosts on a defined schedule until the patched kernel is deployed to reclaim leaked memory
bash
# Configuration example
# Verify whether the StarFive crypto driver is loaded
lsmod | grep starfive

# Temporarily unload the affected module if hardware crypto is not required
sudo modprobe -r starfive_aes

# Confirm the running kernel version against patched stable branches
uname -r

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.