summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGunnar Kudrjavets <gunnarku@amazon.com>2026-04-09 17:20:54 +0000
committerJarkko Sakkinen <jarkko@kernel.org>2026-04-21 18:54:28 +0300
commitc424d2664f08c77f08b4580b5f0cbaabf7c229b2 (patch)
treedb919f7f875c90e0acbcdcda056fae0e1a61f480 /include/linux
parentf0f75a3d98b7959a8677b6363e23190f3018636b (diff)
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. Cc: stable@vger.kernel.org # v6.10+ Fixes: 699e3efd6c64 ("tpm: Add HMAC session start and end functions") Signed-off-by: Gunnar Kudrjavets <gunnarku@amazon.com> Reviewed-by: Justinien Bouron <jbouron@amazon.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions