CVE-2025-21777: ring-buffer: Validate the persistent meta data subbuf array
In the Linux kernel, the following vulnerability has been resolved:
ring-buffer: Validate the persistent meta data subbuf array
The meta data for a mapped ring buffer contains an array of indexes of all the subbuffers. The first entry is the reader page, and the rest of the entries lay out the order of the subbuffers in how the ring buffer link list is to be created.
The validator currently makes sure that all the entries are within the range of 0 and nrsubbufs. But it does not check if there are any duplicates.
While working on the ring buffer, I corrupted this array, where I added duplicates. The validator did not catch it and created the ring buffer link list on top of it. Luckily, the corruption was only that the reader page was also in the writer path and only presented corrupted data but did not crash the kernel. But if there were duplicates in the writer side, then it could corrupt the ring buffer link list and cause a crash.
Create a bitmask array with the size of the number of subbuffers. Then clear it. When walking through the subbuf array checking to see if the entries are within the range, test if its bit is already set in the subbufmask. If it is, then there is duplicates and fail the validation. If not, set the corresponding bit and continue.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Apply the kernel fix described in the text for: "ring-buffer: Validate the persistent meta data subbuf array subbuf_mask" to ensure the validator detects duplicate subbuffer indexes (fail validation when a duplicate bit is already set) and prevents corruption of the ring buffer link list that could crash the kernel.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-21777?
CVE-2025-21777 has been assigned a moderate severity rating due to potential exploitation leading to information disclosure.
How do I fix CVE-2025-21777?
To remediate CVE-2025-21777, update your Linux kernel to the latest version that includes the fix.
What systems are affected by CVE-2025-21777?
CVE-2025-21777 affects various versions of the Linux kernel, particularly those using the ring-buffer feature.
What are the potential consequences of CVE-2025-21777?
Exploitation of CVE-2025-21777 could lead to unauthorized access to sensitive information in subbuffers.
When was CVE-2025-21777 disclosed?
CVE-2025-21777 was disclosed as part of a routine update to the Linux kernel addressing security vulnerabilities.