Thread (8 messages) 8 messages, 4 authors, 2024-07-17

Re: [PATCH v3] tpm: Relocate buf->handles to appropriate place

From: James Bottomley <James.Bottomley@HansenPartnership.com>
Date: 2024-07-16 19:32:09
Also in: keyrings, linux-integrity, lkml, stable

On Tue, 2024-07-16 at 21:52 +0300, Jarkko Sakkinen wrote:
[...]
Further, 'handles' was incorrectly place to struct tpm_buf, as tpm-
buf.c does manage its state. It is easy to grep that only piece of
code that actually uses the field is tpm2-sessions.c.

Address the issues by moving the variable to struct tpm_chip.
That's really not a good idea, you should keep counts local to the
structures they're counting, not elsewhere.

tpm_buf->handles counts the number of handles present in the command
encoded in a particular tpm_buf.  Right at the moment we only ever
construct one tpm_buf per tpm (i.e. per tpm_chip) at any one time, so
you can get away with moving handles into tpm_chip.  If we ever
constructed more than one tpm_buf per chip, the handles count would
become corrupted.

James
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help