All of lore.kernel.org
 help / color / mirror / Atom feed
* Unbalanced TPM2 HMAC session calls
@ 2025-03-06 15:15 Jonathan McDowell
  2025-03-06 18:59 ` Mimi Zohar
  2025-03-06 21:39 ` Jarkko Sakkinen
  0 siblings, 2 replies; 12+ messages in thread
From: Jonathan McDowell @ 2025-03-06 15:15 UTC (permalink / raw)
  To: James Bottomley, Jarkko Sakkinen; +Cc: linux-integrity

We're seeing a lot of:

tpm tpm0: auth session is active

messages in our logs. This is emitted (once per boot) by 
tpm2_start_auth_session() if the auth sessions is already active when it 
is called.

Investigating I think this is because tpm2_pcr_extend() calls 
tpm_buf_append_hmac_session() which sets TPM2_SA_CONTINUE_SESSION so 
tpm_buf_check_hmac_response() does not cleanup the auth session, but 
then doesn't call tpm2_end_auth_session().

Looking at tpm2_get_random() it uses TPM2_SA_CONTINUE_SESSION but *also* 
cleans up with tpm2_end_auth_session().

I'd be sending a patch proposing the addition of tpm2_end_auth_session() 
to the end of tpm2_pcr_extend() but I recall a bunch of discussion 
about trying to cache the HMAC session to improve IMA performance, so I 
don't know if perhaps we should be dropping the warning instead?

(As an aside, I'm not clear dropping the warning is enough, as I can't 
see where the session otherwise gets cleaned up other than by accident 
when the RNG tries to get more randomness.)

J.

-- 
I've got a trigger inside.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-03-07 19:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-06 15:15 Unbalanced TPM2 HMAC session calls Jonathan McDowell
2025-03-06 18:59 ` Mimi Zohar
2025-03-06 19:30   ` James Bottomley
2025-03-06 19:43     ` Mimi Zohar
2025-03-06 21:39     ` Jarkko Sakkinen
2025-03-06 21:39 ` Jarkko Sakkinen
2025-03-07 10:56   ` [PATCH] tpm: Drop warning when an auth session is active Jonathan McDowell
2025-03-07 16:36     ` Jarkko Sakkinen
2025-03-07 17:25       ` Jonathan McDowell
2025-03-07 19:49         ` Jarkko Sakkinen
2025-03-07 10:58   ` [PATCH] tpm: Lazily flush auth session when getting random data Jonathan McDowell
2025-03-07 16:34     ` Jarkko Sakkinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.