CVE-2026-139658: pstore: reject persistent RAM zones too small for the buffer header
In the Linux kernel, the following vulnerability has been resolved:
pstore: reject persistent RAM zones too small for the buffer header
persistentrambuffermap() computes
prz->buffersize = size - sizeof(struct persistentrambuffer);
without checking that size is large enough to hold the header. A ramoops zone configured with a tiny size (e.g. ramoops.pmsgsize=1) underflows buffersize to a huge value, which defeats every bounds check in persistentramwrite() and persistentramwriteuser(); a write to /dev/pmsg0 then copies user data far past the end of the zone and corrupts kernel memory.
Reject zones that are not larger than the buffer header.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Configure ramoops.pmsg_size to be larger than the persistent RAM buffer header; do not set it to a tiny size such as 1.
ramoops pmsg_size = larger than the persistent RAM buffer header
Event History
Frequently Asked Questions
Who can exploit this issue?
An attacker needs the ability to write to /dev/pmsg0 on a system whose ramoops persistent RAM zone is configured too small for the persistent RAM buffer header. The described example is ramoops.pmsg_size=1.
Are systems affected in the default configuration?
The available information does not state whether the default ramoops configuration creates an undersized zone. Exposure depends on a persistent RAM zone being configured at or below the size needed for the buffer header.
What can be done before applying the fix?
Avoid configuring tiny ramoops persistent RAM zones, particularly a pmsg zone such as ramoops.pmsg_size=1. Ensure each configured zone is larger than the persistent RAM buffer header and restrict access to /dev/pmsg0 where possible.
How can I determine whether a system is at risk?
Review the ramoops zone configuration, including ramoops.pmsg_size, for zones too small to hold the persistent RAM buffer header. Affected configurations allow writes to /dev/pmsg0 to copy data beyond the configured zone.