CVE-2024-35797: mm: cachestat: fix two shmem bugs
In the Linux kernel, the following vulnerability has been resolved:
mm: cachestat: fix two shmem bugs
The Linux kernel CVE team has assigned CVE-2024-35797 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024051737-CVE-2024-35797-06f6@gregkh/T
Other sources
In the Linux kernel, the following vulnerability has been resolved:
mm: cachestat: fix two shmem bugs
When cachestat on shmem races with swapping and invalidation, there are two possible bugs:
1) A swapin error can have resulted in a poisoned swap entry in the shmem inode's xarray. Calling getshadowfromswapcache() on it will result in an out-of-bounds access to swapperspaces[].
Validate the entry with nonswapentry() before going further.
2) When we find a valid swap entry in the shmem's inode, the shadow entry in the swapcache might not exist yet: swap IO is still in progress and we're before removemapping; swapin, invalidation, or swapoff have removed the shadow from swapcache after we saw the shmem swap entry.
This will send a NULL to workingsettestrecent(). The latter purely operates on pointer bits, so it won't crash - node 0, memcg ID 0, eviction timestamp 0, etc. are all valid inputs - but it's a bogus test. In theory that could result in a false "recently evicted" count.
Such a false positive wouldn't be the end of the world. But for code clarity and (future) robustness, be explicit about this case.
Bail on getshadowfromswapcache() returning NULL.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.22-1Fixed in 6.12.25-1 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.6.24 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.7.12 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.8.3 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.9
Event History
Frequently Asked Questions
What is the severity of CVE-2024-35797?
CVE-2024-35797 has been classified as a moderate severity vulnerability in the Linux kernel.
How do I fix CVE-2024-35797?
To fix CVE-2024-35797, update the Linux kernel to version 6.6.24, 6.7.12, 6.8.3, 6.9, or specific versions provided by Debian such as 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.119-1, 6.12.11-1, or 6.12.12-1.
What systems are affected by CVE-2024-35797?
CVE-2024-35797 affects multiple versions of the Linux kernel, specifically from various Red Hat and Debian releases.
Can CVE-2024-35797 be exploited remotely?
CVE-2024-35797 requires local access to the system, thus it is not classified as a remote exploit vulnerability.
Is there a patch available for CVE-2024-35797?
Yes, patches for CVE-2024-35797 are included in the respective updates for the affected Linux kernel versions.