]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tpm: Lazily flush the auth session
authorJarkko Sakkinen <jarkko@kernel.org>
Mon, 28 Oct 2024 05:50:01 +0000 (07:50 +0200)
committerJarkko Sakkinen <jarkko@kernel.org>
Mon, 28 Oct 2024 22:46:20 +0000 (00:46 +0200)
commitdf745e25098dcb2f706399c0d06dd8d1bab6b6ec
tree8e1ffbedaaedd115b4f072bd10237d38297618e0
parentcc7d8594342a25693d40fe96f97e5c6c29ee609c
tpm: Lazily flush the auth session

Move the allocation of chip->auth to tpm2_start_auth_session() so that this
field can be used as flag to tell whether auth session is active or not.

Instead of flushing and reloading the auth session for every transaction
separately, keep the session open unless /dev/tpm0 is used.

Reported-by: Pengyu Ma <mapengyu@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219229
Cc: stable@vger.kernel.org # v6.10+
Fixes: 7ca110f2679b ("tpm: Address !chip->auth in tpm_buf_append_hmac_session*()")
Tested-by: Pengyu Ma <mapengyu@gmail.com>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm-chip.c
drivers/char/tpm/tpm-dev-common.c
drivers/char/tpm/tpm-interface.c
drivers/char/tpm/tpm2-sessions.c