CVE-2025-39941: zram: fix slot write race condition
In the Linux kernel, the following vulnerability has been resolved:
zram: fix slot write race condition
Parallel concurrent writes to the same zram index result in leaked zsmalloc handles. Schematically we can have something like this:
CPU0 CPU1 zramslotlock() zsfree(handle) zramslotlock() zramslotlock() zsfree(handle) zramslotlock()
compress compress handle = zsmalloc() handle = zsmalloc() zramslotlock zramsethandle(handle) zramslotlock zramslotlock zramsethandle(handle) zramslotlock
Either CPU0 or CPU1 zsmalloc handle will leak because zsfree() is done too early. In fact, we need to reset zram entry right before we set its new handle, all under the same slot lock scope.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-39941?
CVE-2025-39941 is classified as a moderate severity vulnerability due to its potential impact on concurrent writes in the zram module.
How do I fix CVE-2025-39941?
To fix CVE-2025-39941, upgrade to the latest stable version of the Linux kernel where this vulnerability has been addressed.
What is the nature of CVE-2025-39941?
CVE-2025-39941 involves a race condition in the zram module that can lead to the leaking of zsmalloc handles during concurrent writes.
Who is affected by CVE-2025-39941?
All users running vulnerable versions of the Linux kernel that utilize the zram module are affected by CVE-2025-39941.
Is CVE-2025-39941 actively exploited?
As of now, there is no public evidence to suggest that CVE-2025-39941 is being actively exploited in the wild.