public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: linux-integrity@vger.kernel.org
Cc: Jason Gunthorpe <jgg@nvidia.com>,
	Alejandro Cabrera <alejandro.cabreraaldaya@tuni.fi>,
	Jarkko Sakkinen <jarkko.sakkinen@tuni.fi>,
	stable@vger.kernel.org,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tpm: factor out the user space mm from tpm_vtpm_set_locality()
Date: Wed, 31 May 2023 00:49:21 +0300	[thread overview]
Message-ID: <5d359d2b24670e37b9ff8cac7e922c46af30d3ba.camel@kernel.org> (raw)
In-Reply-To: <20230530205001.1302975-1-jarkko@kernel.org>

On Tue, 2023-05-30 at 23:50 +0300, Jarkko Sakkinen wrote:
> -	if (!(proxy_dev->state & STATE_DRIVER_COMMAND) &&
> -	    vtpm_proxy_is_driver_command(chip, buf, count))
> +	if ((chip->flags & TPM_CHIP_FLAG_TPM2) && ord == TPM2_CC_SET_LOCALITY)
> +		return -EFAULT;
> +
> +	if (ord == TPM_ORD_SET_LOCALITY)
>  		return -EFAULT;

Oops, should really be:

diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c
index 83496742cc19..6da878952a0d 100644
--- a/drivers/char/tpm/tpm_vtpm_proxy.c
+++ b/drivers/char/tpm/tpm_vtpm_proxy.c
@@ -337,8 +337,7 @@ static int vtpm_proxy_tpm_op_send(struct tpm_chip *chip, u8 *buf, size_t count)
 
 	if ((chip->flags & TPM_CHIP_FLAG_TPM2) && ord == TPM2_CC_SET_LOCALITY)
 		return -EFAULT;
-
-	if (ord == TPM_ORD_SET_LOCALITY)
+	else if (ord == TPM_ORD_SET_LOCALITY) /* TPM 1.2 */
 		return -EFAULT;
 
 	mutex_lock(&proxy_dev->buf_lock);


BR, Jarkko

  reply	other threads:[~2023-05-30 21:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 20:50 [PATCH] tpm: factor out the user space mm from tpm_vtpm_set_locality() Jarkko Sakkinen
2023-05-30 21:49 ` Jarkko Sakkinen [this message]
2023-05-31 15:20 ` Stefan Berger
2023-05-31 16:32   ` Jarkko Sakkinen
2023-05-31 16:45     ` Jarkko Sakkinen
2023-05-31 17:01     ` Stefan Berger
2023-06-08 13:14       ` Jarkko Sakkinen
2023-06-08 15:10         ` Stefan Berger
2023-06-08 18:59           ` Jarkko Sakkinen
2023-05-31 15:53 ` Jerry Snitselaar

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=5d359d2b24670e37b9ff8cac7e922c46af30d3ba.camel@kernel.org \
    --to=jarkko@kernel.org \
    --cc=alejandro.cabreraaldaya@tuni.fi \
    --cc=jarkko.sakkinen@tuni.fi \
    --cc=jgg@nvidia.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stefanb@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox