CVE-2026-46096: tpm2-sessions: Fix missing tpm_buf_destroy() in tpm2_read_public()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
tpm2-sessions: Fix missing tpm_buf_destroy() in tpm2_read_public()
tpm2_read_public() calls tpm_buf_init() but fails to call tpm_buf_destroy() on two exit paths, leaking a page allocation:
1. When name_size() returns an error (unrecognized hash algorithm), the function returns directly without destroying the buffer.
2. On the success path, the buffer is never destroyed before returning.
All other error paths in the function correctly call tpm_buf_destroy() before returning.
Fix both by adding the missing tpm_buf_destroy() calls.
The Linux kernel CVE team has assigned CVE-2026-46096 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.18.3 with commit 20eda7c74b69fe9e1caf9b930a5c016bf8d755fa and fixed in 6.18.27 with commit f8775d9d9062da662cc861f9ff7722a65896d4cd Issue introduced in 6.19 with commit bda1cbf73c6e241267c286427f2ed52b5735d872 and fixed in 7.0.4 with commit 2f434be87e256fd58254f60ddf5d7d58e775ca0b Issue introduced in 6.19 with commit bda1cbf73c6e241267c286427f2ed52b5735d872 and fixed in 7.1-rc1 with commit f0f75a3d98b7959a8677b6363e23190f3018636b Issue introduced in 6.12.64 with commit a3b7eb67225c486a2da357c5db3e386f4e64bcde
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-46096
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/char/tpm/tpm2-sessions.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/f8775d9d9062da662cc861f9ff7722a65896d4cd https://git.kernel.org/stable/c/2f434be87e256fd58254f60ddf5d7d58e775ca0b https://git.kernel.org/stable/c/f0f75a3d98b7959a8677b6363e23190f3018636b