CVE-2024-35797
Description
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 get_shadow_from_swap_cache() on it will result in an out-of-bounds access to swapper_spaces[]. Validate the entry with non_swap_entry() 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 __remove_mapping; swapin, invalidation, or swapoff have removed the shadow from swapcache after we saw the shmem swap entry. This will send a NULL to workingset_test_recent(). 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 get_shadow_from_swap_cache() returning NULL.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ if you've already worked around this in production โ publish your fix to the community-verified tier.
โ Propose a mitigation on Community โ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
OS impact
| OS | Version | Status | Fixed in |
|---|---|---|---|
| rhel | 9 | fixed | |
| sles | affected | | |
| rocky | 9 | fixed | |
| debian | bookworm | fixed | 0 |
| debian | bullseye | fixed | 0 |
| debian | forky | fixed | 6.7.12-1 |
| debian | sid | fixed | 6.7.12-1 |
| debian | trixie | fixed | 6.7.12-1 |
| almalinux | 9 | fixed | kernel-headers-5.14.0-427.35.1.el9_4.aarch64.rpm |
References
- https://access.redhat.com/errata/RHSA-2024:6567
- https://www.suse.com/security/cve/CVE-2024-35797.html
- https://errata.rockylinux.org/RXSA-2024:6567
- https://errata.rockylinux.org/RLSA-2024:6567
- https://security-tracker.debian.org/tracker/CVE-2024-35797
- https://bugzilla.redhat.com/2265797
- https://bugzilla.redhat.com/2269434
- https://bugzilla.redhat.com/2269436
- https://bugzilla.redhat.com/2273141
- https://bugzilla.redhat.com/2275678
- https://bugzilla.redhat.com/2278206
- https://bugzilla.redhat.com/2281052
- https://bugzilla.redhat.com/2281151
- https://bugzilla.redhat.com/2281727
- https://bugzilla.redhat.com/2281968
- https://bugzilla.redhat.com/2282709
- https://bugzilla.redhat.com/2284271
- https://bugzilla.redhat.com/2284402
- https://bugzilla.redhat.com/2293273
- https://bugzilla.redhat.com/2293276
- https://bugzilla.redhat.com/2293440
- https://bugzilla.redhat.com/2297511
- https://bugzilla.redhat.com/2297520
- https://bugzilla.redhat.com/2300409
- https://bugzilla.redhat.com/2300414
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.