tpm: Mask TPM RC in tpm2_start_auth_session()
authorJarkko Sakkinen <jarkko@kernel.org>
Mon, 7 Apr 2025 12:28:05 +0000 (15:28 +0300)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 15 May 2025 01:47:14 +0000 (04:47 +0300)
commit539fbab37881e32ba6a708a100de6db19e1e7e7d
treef300cf7d29c5146c8eaab8a49ed9599646539d3a
parent74a6325597464e940a33e56e98f6899ef77728d8
tpm: Mask TPM RC in tpm2_start_auth_session()

tpm2_start_auth_session() does not mask TPM RC correctly from the callers:

[   28.766528] tpm tpm0: A TPM error (2307) occurred start auth session

Process TPM RCs inside tpm2_start_auth_session(), and map them to POSIX
error codes.

Cc: stable@vger.kernel.org # v6.10+
Fixes: 699e3efd6c64 ("tpm: Add HMAC session start and end functions")
Reported-by: Herbert Xu <herbert@gondor.apana.org.au>
Closes: https://lore.kernel.org/linux-integrity/Z_NgdRHuTKP6JK--@gondor.apana.org.au/
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm2-sessions.c
include/linux/tpm.h