CVE-2026-98728 in Linuxinfo

Summary

by MITRE • 10/18/2026

In the Linux kernel, the following vulnerability has been resolved:

tpm: fix off-by-four bounds check in tpm2_get_random()

When the response carries the TPM2_ST_SESSIONS tag, tpm2_get_random() skips the 4-byte parameter size field before locating the random data, but the bounds check still validates the response length against TPM_HEADER_SIZE. A truncated response can pass the check and make memcpy() read up to 4 bytes past the response end, so stale buffer contents end up in the caller's random bytes.

Fix this by checking the response length against 'offset', which already includes the skipped parameter size field.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 10/19/2026

The vulnerability identified as a fix for an off-by-four bounds check within the tpm2_get_random function of the Linux kernel represents a critical memory safety issue rooted in improper validation of input data lengths during Trusted Platform Module operations. The TPM subsystem is responsible for handling cryptographic keys and random number generation, making its integrity paramount to system security. In this specific scenario, the code path handles responses tagged with TPM2_ST_SESSIONS, which indicates that the response includes a session header followed by parameter-specific data. To correctly locate the actual random bytes within the buffer, the implementation first skips over a four-byte field designated for parameter size. However, the subsequent bounds check erroneously validates the total response length against TPM_HEADER_SIZE rather than accounting for this skipped offset. This discrepancy creates a scenario where a truncated or malformed response can pass the validation step because its length appears sufficient relative to the base header size, even though it is insufficient when considering the full context of the data structure being parsed.

This logical error leads directly to an out-of-bounds read condition that allows the kernel to access memory beyond the intended buffer boundaries. Specifically, after skipping the four-byte parameter field, the code proceeds to copy random data into a caller-provided buffer using memcpy. Because the initial length check did not account for the four bytes already consumed by the offset logic, it fails to detect when the remaining response is too short to satisfy the requested amount of randomness or even the basic structure requirements. Consequently, the memory access operation reads up to four bytes past the end of the valid response buffer. This results in stale kernel heap contents being copied into the caller's random byte array rather than actual TPM-generated entropy. The presence of this uninitialized or residual data introduces a significant weakness in the randomness source, potentially compromising cryptographic operations that rely on high-quality entropy for key generation, nonce creation, or session token establishment.

From an industry standards perspective, this vulnerability aligns with CWE-193 Off-by-One Error and more broadly CWE-787 Out-of-bounds Read, as it involves accessing memory outside the intended buffer due to incorrect boundary calculations. The exploitation vector relates to CWE-20 Improper Input Validation, where the system fails to correctly validate inputs that could alter expected program flow or data handling. In terms of attack techniques, this flaw can be leveraged within the context of ATT&CK technique T1583 Acquire Infrastructure if an attacker seeks to establish a foothold via compromised cryptographic primitives, though more directly it falls under information disclosure principles where sensitive memory contents are exposed. The impact is primarily informational but carries severe implications for confidentiality and integrity in security-sensitive applications such as disk encryption, secure boot processes, or authenticated communication channels that depend on the TPM for key material generation.

Mitigation strategies must focus on ensuring strict adherence to buffer length validation relative to all consumed offsets before performing memory copy operations. The primary remediation involves correcting the bounds check logic so that it compares the response length against a calculated offset that includes both the standard header size and any additional fields skipped during parsing, such as the four-byte parameter size field in this case. Developers should implement rigorous input validation routines that account for all structural components of protocol messages before extracting payload data. Additionally, employing static analysis tools configured to detect off-by-one errors and out-of-bounds reads can help identify similar flaws in other parts of the kernel codebase. System administrators should apply the latest security patches provided by their distribution vendors to ensure this specific logic error is resolved. Regular auditing of cryptographic subsystems for proper memory management practices remains essential to maintaining the integrity of hardware-backed security features within Linux environments.

Responsible

Linux

Reservation

09/25/2026

Disclosure

10/18/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!