Potential Use-After-Free Vulnerability in Linux Kernel's ZRAM Package
Summary
CVE-2025-21671: In the Linux kernel, the following vulnerability has been resolved: zram: fix potential UAF of zram table If zram_meta_alloc failed early, it frees allocated zram->table without setting it NULL. Affects linux versions < 6.1.128-1. Fixed in 6.1.128-1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Linux kernel is the core component of many operating systems, including Debian. It manages system resources and hardware interactions, providing essential services for software applications. The ZRAM feature in the Linux kernel allows for the creation of compressed block devices in RAM, enhancing memory efficiency. However, vulnerabilities in the kernel can lead to severe security risks, including unauthorized access and system instability.
Vulnerability Detail
In the Linux kernel, a vulnerability has been identified in the ZRAM implementation. Specifically, if the zram_meta_alloc function fails early, it can lead to a use-after-free (UAF) condition. This occurs because the allocated zram->table is freed without being set to NULL, which can result in zram_meta_free accessing an uninitialized and potentially freed memory area. This flaw can be exploited by an attacker to cause system crashes or execute arbitrary code, posing a significant risk to system integrity and security.
How To Fix
Minimum fixed version
6.1.128-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade linux
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
Currently, there are no specific workarounds provided for this vulnerability. The best course of action is to apply the patch as soon as it becomes available.
Conclusion
The identified vulnerability in the Linux kernel's ZRAM implementation poses a significant risk due to the potential for use-after-free conditions. Users are advised to update their systems to the latest patched versions to mitigate this risk. Regular updates and monitoring for vulnerabilities are crucial for maintaining system security.
See every vulnerability recorded for linux →
FAQ
A use-after-free vulnerability occurs when a program continues to use a memory reference after it has been freed, potentially allowing an attacker to manipulate the freed memory.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. By uploading a manifest file like package-lock.json, you can check if your application is affected by this vulnerability.
Exploitation of this vulnerability can lead to system crashes, unauthorized access, or execution of arbitrary code, compromising system security.
The vulnerability affects the Linux kernel versions in Debian 12 and 13, specifically those that utilize the ZRAM feature.
It is recommended to regularly check for updates and apply them promptly to ensure your system is protected against known vulnerabilities.
Related vulnerabilities
Recent vulnerabilities recorded for linux.