CVE-2026-64311 Overview
CVE-2026-64311 affects the Linux kernel loongson-rng driver within the crypto subsystem. The driver contains a use-after-free bug caused by improper use of wait_for_completion_interruptible(). It also fails to provide forward security in its random number generation implementation. Kernel maintainers resolved the issue by removing the broken and unused driver entirely, rather than fixing it forward. The rng_alg framework has no in-kernel consumers and does not feed the Linux RNG, so removal was deemed appropriate.
Critical Impact
A local authenticated attacker can trigger a use-after-free in the kernel loongson-rng driver, leading to high impact on confidentiality, integrity, and availability.
Affected Products
- Linux kernel with the loongson-rng driver enabled
- Loongson platform builds using crypto/loongson-rng
- Kernels prior to the removal commits 037ec83, 43de8b9, and af3d1bb
Discovery Timeline
- 2026-07-25 - CVE-2026-64311 published to the National Vulnerability Database (NVD)
- 2026-07-27 - Last updated in NVD database
Technical Details for CVE-2026-64311
Vulnerability Analysis
The loongson-rng driver registers itself as an rng_alg implementation in the Linux kernel crypto subsystem. During random data generation, the driver calls wait_for_completion_interruptible() to block on hardware completion. When the calling task receives a signal, the function returns early while the underlying request context can still be referenced by asynchronous callbacks or subsequent operations. This creates a classic use-after-free condition where freed memory continues to be accessed by kernel code paths.
A secondary weakness in the driver is the absence of forward security. The RNG state does not properly rotate or destroy prior key material, so compromise of current state can expose previously generated outputs. Because the rng_alg interface has no in-kernel users outside the software algorithms in crypto/drbg.c and crypto/jitterentropy.c, hardware-specific implementations like this one deliver no value while introducing exploitable code.
Root Cause
The root cause is unsafe synchronization in wait_for_completion_interruptible(). The function permits signal-driven early returns without guaranteeing that in-flight hardware operations have released their references to the request buffer. Kernel code then frees or reuses the buffer while the completion path retains a dangling pointer.
Attack Vector
Exploitation requires local access with low privileges on a Loongson system running an affected kernel. An attacker triggers rng_alg operations against the loongson-rng device and delivers signals to interrupt the wait. Careful timing between the interruptible wait and the hardware callback allows the attacker to reuse the freed memory region with attacker-controlled data. Successful exploitation can lead to kernel memory corruption and local privilege escalation.
No public proof-of-concept code is available at this time. Refer to the upstream removal commits for the technical scope of the fix: Kernel Git Commit 037ec83, Kernel Git Commit 43de8b9, and Kernel Git Commit af3d1bb.
Detection Methods for CVE-2026-64311
Indicators of Compromise
- Unexpected kernel oops or panic messages referencing loongson_rng, crypto_rng, or wait_for_completion_interruptible in dmesg.
- KASAN (Kernel Address Sanitizer) reports flagging use-after-free events in the crypto RNG subsystem on Loongson hardware.
- Unprivileged processes repeatedly opening /dev/crypto style interfaces and issuing signals to interrupt syscalls.
Detection Strategies
- Enumerate loaded kernel modules with lsmod | grep loongson_rng and inventory kernel versions across Loongson fleet assets.
- Enable KASAN and lockdep on test kernels to surface latent use-after-free conditions during regression testing.
- Monitor audit logs for repeated signal-driven interruption of syscalls targeting crypto RNG interfaces from low-privilege users.
Monitoring Recommendations
- Collect and forward dmesg and journalctl -k output to a central log platform to identify kernel crash signatures tied to this driver.
- Track kernel version drift against the fixed baseline containing commit af3d1bb and downstream stable backports.
- Alert on kernel module load events for loongson_rng on production systems where the driver should not be present.
How to Mitigate CVE-2026-64311
Immediate Actions Required
- Update the Linux kernel to a version that includes the removal commits 037ec83, 43de8b9, or af3d1bb.
- Unload the driver on running systems with modprobe -r loongson_rng where a kernel update cannot be applied immediately.
- Restrict local shell access to Loongson systems to trusted administrators until patches are deployed.
Patch Information
The upstream fix removes the loongson-rng driver entirely rather than patching the individual defects. The relevant stable tree commits are 037ec83, 43de8b9, and af3d1bb. Distribution vendors shipping Loongson kernels should rebase to a stable release containing these commits. Systems requiring true random number functionality on Loongson hardware should migrate to a dedicated hwrng driver if the platform exposes a TRNG.
Workarounds
- Blacklist the driver by adding blacklist loongson_rng to /etc/modprobe.d/ configuration files.
- Rebuild custom kernels with CONFIG_CRYPTO_DEV_LOONGSON_RNG disabled to eliminate the vulnerable code path.
- Limit access to /dev/random and crypto API interfaces via kernel lockdown mode where feasible.
# Configuration example
# Blacklist the vulnerable driver
echo 'blacklist loongson_rng' | sudo tee /etc/modprobe.d/cve-2026-64311.conf
# Unload the module if currently loaded
sudo modprobe -r loongson_rng
# Verify the module is not loaded
lsmod | grep loongson_rng
# Confirm running kernel version includes the fix
uname -r
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

