summaryrefslogtreecommitdiff
path: root/include/net/aligned_data.h
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko@kernel.org>2025-11-30 21:07:12 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-01-17 16:31:29 +0100
commit47e676ce4d68f461dfcab906f6aeb254f7276deb (patch)
tree77fd0d11b2df0d529df8a66340928a522b40f497 /include/net/aligned_data.h
parent42440155fe2759da9404d55515b9e96d0818a479 (diff)
tpm2-sessions: Fix out of range indexing in name_size
commit 6e9722e9a7bfe1bbad649937c811076acf86e1fd upstream. '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. Cc: stable@vger.kernel.org # v6.10+ Fixes: 1085b8276bb4 ("tpm: Add the rest of the session HMAC API") Reviewed-by: Jonathan McDowell <noodles@meta.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/net/aligned_data.h')
0 files changed, 0 insertions, 0 deletions