CVE-2026-46253: pstore/ram: fix buffer overflow in persistent_ram_save_old()
In the Linux kernel, the following vulnerability has been resolved:
pstore/ram: fix buffer overflow in persistentramsaveold()
persistentramsaveold() can be called multiple times for the same persistentramzone (e.g., via ramoopspstoreread -> ramoopsgetnextprz for PSTORETYPEDMESG records).
Currently, the function only allocates prz->oldlog when it is NULL, but it unconditionally updates prz->oldlogsize to the current buffer size and then performs memcpyfromio() using this new size. If the buffer size has grown since the first allocation (which can happen across different kernel boot cycles), this leads to:
1. A heap buffer overflow (OOB write) in the memcpyfromio() calls 2. A subsequent OOB read when ramoopspstoreread() accesses the buffer using the incorrect (larger) oldlogsize
The KASAN splat would look similar to: BUG: KASAN: slab-out-of-bounds in ramoopspstoreread+0x... Read of size N at addr ... by task ...
The conditions are likely extremely hard to hit:
0. Crash with a ramoops write of less-than-record-max-size bytes. 1. Reboot: ramoops registers, pstoregetrecords(0) reads old crash, allocates oldlog with size X 2. Crash handler registered, timer started (if pstoreupdatems >= 0) 3. Oops happens (non-fatal, system continues) 4. pstoredump() writes oops via ramoopspstorewrite() size Y (>X) 5. pstorenewentry = 1, pstoretimerkick() called 6. System continues running (not a panic oops) 7. Timer fires after pstoreupdatems milliseconds 8. pstoretimefunc() → schedulework() → pstoredowork() → pstoregetrecords(1) 9. ramoopsgetnextprz() → persistentramsaveold() 10. buffersize() returns Y, but oldlog is X bytes 11. Y > X: memcpyfromio() overflows heap
Requirements: - a prior crash record exists that did not fill the record size (almost impossible since the crash handler writes as much as it can possibly fit into the record, capped by max record size and the kmsg buffer almost always exceeds the max record size) - pstoreupdatems >= 0 (disabled by default) - Non-fatal oops (system survives)
Free and reallocate the buffer when the new size differs from the previously allocated size. This ensures oldlog always has sufficient space for the data being copied.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-46253?
The severity of CVE-2026-46253 is rated as high with a CVSS score of 7.8.
How do I fix CVE-2026-46253?
To fix CVE-2026-46253, update the Linux kernel to a version that includes the patch for the buffer overflow in persistent_ram_save_old().
What type of vulnerability is CVE-2026-46253?
CVE-2026-46253 is classified as a buffer overflow vulnerability in the Linux kernel.
What impact does CVE-2026-46253 have on my system?
CVE-2026-46253 can lead to data corruption and possible execution of arbitrary code due to a buffer overflow.
When was CVE-2026-46253 published?
CVE-2026-46253 was published on June 3, 2026.