tpm2-sessions: Fix out of range indexing in name_size
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 |
|
|
6.12.666.18.36.19In the Linux kernel, the following vulnerability has been resolved:
tpm2-sessions: Fix out of range indexing in name_size
'name_size' does not have any range checks, and it just directly indexes with TPM_ALG_ID, which could lead into memory corruption at worst.
Address the issue by only processing known values and returning -EINVAL for unrecognized values.
Make also 'tpm_buf_append_name' and 'tpm_buf_fill_hmac_session' fallible so that errors are detected before causing any spurious TPM traffic.
End also the authorization session on failure in both of the functions, as the session state would be then by definition corrupted.
From the CVE record · Linux
The Linux kernel's tpm2-sessions code can index outside an array when name_size receives an unrecognized TPM_ALG_ID, potentially causing memory corruption. The input does not establish how an attacker could trigger this or whether network access, authentication, or user interaction is required.
Engineers running the Linux kernel should check their versions; affected versions are not specified in the input.