tpm: Use kfree_sensitive() to free auth session in tpm_dev_release()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tpm: Use kfree_sensitive() to free auth session in tpm_dev_release()
tpm_dev_release() uses plain kfree() to free chip->auth, which contains sensitive cryptographic material including HMAC session keys, nonces, and passphrase data (struct tpm2_auth).
Every other code path that frees this structure uses kfree_sensitive() to zero the memory before releasing it: both tpm2_end_auth_session() and tpm_buf_check_hmac_response() do so. The tpm_dev_release() path is the only one that does not, leaving key material in freed slab memory until it is eventually overwritten.
Use kfree_sensitive() for consistency with the rest of the driver and to ensure session keys are scrubbed during device teardown.
From the CVE record · Linux
The Linux kernel’s TPM device release path frees authentication session data without first clearing it. HMAC session keys, nonces, and passphrase data can remain in freed kernel memory until overwritten; the input does not specify how an attacker could access that memory or whether authentication or user interaction is required.
Engineers running Linux kernels with the affected TPM device release path should check their deployments; affected versions are not specified.