# CVE-2024-36967: KEYS: trusted: Fix memory leak in tpm2_key_encode()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 12% of CVEs (2026-12-01)
- Published: 2024-06-08T12:52:59.895Z
- Modified: 2026-06-17T07:37:28.523Z
- Weaknesses: CWE-401
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

KEYS: trusted: Fix memory leak in tpm2_key_encode()

'scratch' is never freed. Fix this by calling kfree() in the success, and
in the error case.

(As written by CVE List.)

## Affected

- Linux Linux: from f2219745250f388edacabe6cca73654131c67d0a before 1e6914fa8e7798bcf3ce4a5b96ea4ac1d5571cdf; from f2219745250f388edacabe6cca73654131c67d0a before 5d91238b590bd883c86ba7707c5c9096469c08b7; from f2219745250f388edacabe6cca73654131c67d0a before e62835264d0352be6086975f18fdfed2b5520b13; from f2219745250f388edacabe6cca73654131c67d0a before 189c768932d435045b1fae12bf63e53866f06a28; from f2219745250f388edacabe6cca73654131c67d0a before cf26a92f560eed5d6ddc3d441cc645950cbabc56; from f2219745250f388edacabe6cca73654131c67d0a before ffcaa2172cc1a85ddb8b783de96d38ca8855e248; 5.13 (not affected: before 5.13; from 5.15.160 up to 5.15.*; from 6.1.92 up to 6.1.*; from 6.6.32 up to 6.6.*; from 6.8.11 up to 6.8.*; from 6.9.2 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: from 5.13 before 5.15.160; from 5.16 before 6.1.92; from 6.2 before 6.6.32; from 6.7 before 6.8.11; from 6.9 before 6.9.2

## References

- <https://git.kernel.org/stable/c/1e6914fa8e7798bcf3ce4a5b96ea4ac1d5571cdf> (patch)
- <https://git.kernel.org/stable/c/5d91238b590bd883c86ba7707c5c9096469c08b7> (patch)
- <https://git.kernel.org/stable/c/e62835264d0352be6086975f18fdfed2b5520b13> (patch)
- <https://git.kernel.org/stable/c/189c768932d435045b1fae12bf63e53866f06a28> (patch)
- <https://git.kernel.org/stable/c/cf26a92f560eed5d6ddc3d441cc645950cbabc56> (patch)
- <https://git.kernel.org/stable/c/ffcaa2172cc1a85ddb8b783de96d38ca8855e248> (patch)

## Sources

- CVE List: [CVE-2024-36967](https://www.cve.org/CVERecord?id=CVE-2024-36967), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2024-36967](https://nvd.nist.gov/vuln/detail/CVE-2024-36967), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-36967 · Whole record: https://cve.day/CVE-2024-36967.json · Rebuilt by cve.day 2026-11-25T22:58:41.562Z
