Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-36477 Overview
CVE-2024-36477 is an out-of-bounds access vulnerability in the Linux kernel's tpm_tis_spi driver [CWE-125]. The driver computes the maximum SPI transfer length and allocates the transfer buffer using MAX_SPI_FRAMESIZE, but does not account for the 4-byte SPI header prepended to each data frame. The resulting mismatch allows out-of-bounds reads during Trusted Platform Module (TPM) SPI transfers, a condition confirmed with the Kernel Address Sanitizer (KASAN). The fix introduces SPI_HDRSIZE and uses it when sizing the transfer buffer. The flaw affects local attack vectors on systems using TPM over SPI.
Critical Impact
Local low-privileged users on systems with the affected tpm_tis_spi driver can trigger out-of-bounds memory access, potentially impacting confidentiality, integrity, and availability of the kernel.
Affected Products
- Linux Kernel (upstream)
- Linux Kernel 6.10-rc1
- Linux distributions shipping the tpm_tis_spi driver prior to the fixing commits
Discovery Timeline
- 2024-06-21 - CVE-2024-36477 published to NVD
- 2026-08-04 - Last updated in NVD database
Technical Details for CVE-2024-36477
Vulnerability Analysis
The tpm_tis_spi driver implements the Serial Peripheral Interface (SPI) transport for Trusted Platform Module (TPM) 1.2 and 2.0 devices. Each TPM SPI transaction is composed of a 4-byte protocol header followed by a payload. The driver sizes its transfer buffer and limits transaction length using the MAX_SPI_FRAMESIZE constant, which represents only the payload capacity. Because the 4 bytes of header are prepended at transfer time but never added to the allocation, a maximum-sized payload drives the SPI engine to read past the end of the allocated buffer. KASAN flagged this as an out-of-bounds access during transfer.
Root Cause
The root cause is an allocation sizing error. The transfer buffer should hold both the payload and the 4-byte SPI framing header, but the original code only reserved MAX_SPI_FRAMESIZE bytes. The fix introduces a dedicated SPI_HDRSIZE constant and uses MAX_SPI_FRAMESIZE + SPI_HDRSIZE when allocating the buffer and bounding transfer length, aligning buffer size with the actual on-wire frame.
Attack Vector
Exploitation requires local access with permission to drive TPM SPI operations. An attacker invoking crafted TPM commands can force transfers that touch memory beyond the allocated buffer. The resulting out-of-bounds access can corrupt adjacent kernel slab objects or expose kernel memory, impacting system integrity and availability. No network path exists for this flaw.
No public exploit code is available. The upstream fixes are referenced in the kernel git commits 1547183852dc, 195aba96b8, and de13c56f99.
Detection Methods for CVE-2024-36477
Indicators of Compromise
- KASAN splats in dmesg referencing tpm_tis_spi_transfer or adjacent SPI transfer paths.
- Kernel oops, slab corruption warnings, or TPM command failures on systems with SPI-attached TPMs.
- Unexpected TPM driver reinitialization or system instability during TPM operations such as attestation or key sealing.
Detection Strategies
- Inventory hosts running vulnerable kernel versions that include the tpm_tis_spi module, particularly embedded devices and servers using discrete TPMs over SPI.
- Enable KASAN in test or staging kernels to confirm the presence of the out-of-bounds access before patching production fleets.
- Correlate TPM subsystem warnings with workload events that invoke /dev/tpm0 or /dev/tpmrm0.
Monitoring Recommendations
- Forward kernel logs to a centralized logging platform and alert on KASAN reports, slab-out-of-bounds messages, and TPM driver errors.
- Monitor processes accessing TPM character devices and correlate with privilege context.
- Track kernel package versions across the fleet to confirm patch deployment.
How to Mitigate CVE-2024-36477
Immediate Actions Required
- Upgrade to a Linux kernel that includes the tpm_tis_spi buffer sizing fix referenced by the upstream commits.
- Apply distribution-provided kernel updates and reboot affected hosts to load the patched module.
- Restrict access to TPM character devices (/dev/tpm0, /dev/tpmrm0) to trusted service accounts only.
Patch Information
The upstream fix adds SPI_HDRSIZE to the buffer allocation inside the tpm_tis_spi driver so that the transfer buffer accommodates the 4-byte SPI header. The patch is distributed across the kernel git commits 1547183852dc, 195aba96b8, and de13c56f99, covering mainline and stable branches.
Workarounds
- Where TPM functionality is not required, unload the tpm_tis_spi module and blacklist it until the kernel is patched.
- Enforce strict permissions on TPM device nodes and limit which services can issue TPM commands.
- Isolate workloads that heavily exercise the TPM on hardened, patched kernels to reduce exposure of unpatched systems.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

