[PATCH v10 4/4] tpm_vpm_proxy: Use stack for TPM_CC_SET_LOCALITY

Jarkko Sakkinen jarkko at kernel.org
Tue Sep 23 14:30:50 UTC 2025


On Mon, Sep 22, 2025 at 10:46:36AM +0200, Stefano Garzarella wrote:
> On Sun, Sep 21, 2025 at 05:08:04AM +0300, Jarkko Sakkinen wrote:
> > From: Jarkko Sakkinen <jarkko.sakkinen at opinsys.com>
> > 
> > Use stack allocation for TPM_CC_SET_LOCALITY, as it has known fixed size.
> > 
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen at opinsys.com>
> > ---
> > drivers/char/tpm/tpm1-cmd.c       |  2 +-
> > drivers/char/tpm/tpm_vtpm_proxy.c | 12 +++++-------
> > 2 files changed, 6 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/char/tpm/tpm1-cmd.c b/drivers/char/tpm/tpm1-cmd.c
> > index 11c16ad9b2a7..433908cfb4a9 100644
> > --- a/drivers/char/tpm/tpm1-cmd.c
> > +++ b/drivers/char/tpm/tpm1-cmd.c
> > @@ -328,7 +328,7 @@ static int tpm1_startup(struct tpm_chip *chip)
> > 	int rc;
> > 
> > 	dev_info(&chip->dev, "TPM_Startup\n");
> > -	tpm_buf_init(buf, TPM_BUF_INT_SIZE);
> > +	tpm_buf_init(buf, TPM_BUF_MIN_SIZE);
> 
> This change should be squashed in patch 2, right?

Yep, sure thanks :-)

BR, Jarkko



More information about the Linux-security-module-archive mailing list