All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Ricardo Schwarzmeier <Ricardo.Schwarzmeier@infineon.com>
Cc: linux-integrity@vger.kernel.org, peterhuewe@gmx.de, jgg@ziepe.ca,
	arnd@arndb.de, gregkh@linuxfoundation.org
Subject: Re: [PATCH] tpm: Return the actual size when receiving an unsupported command
Date: Tue, 19 Jun 2018 15:53:49 +0300	[thread overview]
Message-ID: <20180619125349.GA5609@linux.intel.com> (raw)
In-Reply-To: <20180615121821.23376-1-Ricardo.Schwarzmeier@infineon.com>

On Fri, Jun 15, 2018 at 02:18:21PM +0200, Ricardo Schwarzmeier wrote:
> The command size is computed for the header anyway.
> It can as well indicate the correct number of bytes to read from the driver.
> 
> Signed-off-by: Ricardo Schwarzmeier <Ricardo.Schwarzmeier@infineon.com>
> ---
>  drivers/char/tpm/tpm-interface.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index e32f6e85dc6d..0923e81505a5 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -423,7 +423,7 @@ static ssize_t tpm_try_transmit(struct tpm_chip *chip,
>  		header->tag = cpu_to_be16(TPM2_ST_NO_SESSIONS);
>  		header->return_code = cpu_to_be32(TPM2_RC_COMMAND_CODE |
>  						  TSS2_RESMGR_TPM_RC_LAYER);
> -		return bufsiz;
> +		return header->length;
>  	}
>  
>  	if (bufsiz > TPM_BUFSIZE)
> -- 
> 2.17.1
> 

Isn't this a regression (just came from one week leave might be
overlooking something)? Should always return either error or response
length. If so, please add the fixes tag.

And please send to linux-integrity and CC to linux-integrity and
linux-kernel.

Thanks anyway.

/Jarkko

      reply	other threads:[~2018-06-19 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 12:18 [PATCH] tpm: Return the actual size when receiving an unsupported command Ricardo Schwarzmeier
2018-06-19 12:53 ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180619125349.GA5609@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=Ricardo.Schwarzmeier@infineon.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.