Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1649966 > unrolled thread

[PATCH v6 0/3] Extend the vTPM proxy driver to pass locality

Started byStefan Berger <stefanb@linux.vnet.ibm.com>
First post2017-05-24 23:50 +0200
Last post2017-05-25 01:10 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v6 0/3] Extend the vTPM proxy driver to pass locality Stefan Berger <stefanb@linux.vnet.ibm.com> - 2017-05-24 23:50 +0200
    [PATCH v6 1/3] tpm: Introduce flag TPM_TRANSMIT_RAW Stefan Berger <stefanb@linux.vnet.ibm.com> - 2017-05-24 23:50 +0200
      Re: [PATCH v6 1/3] tpm: Introduce flag TPM_TRANSMIT_RAW Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-25 00:20 +0200
        Re: [PATCH v6 1/3] tpm: Introduce flag TPM_TRANSMIT_RAW Stefan Berger <stefanb@linux.vnet.ibm.com> - 2017-05-25 01:10 +0200

#1649966 — [PATCH v6 0/3] Extend the vTPM proxy driver to pass locality

FromStefan Berger <stefanb@linux.vnet.ibm.com>
Date2017-05-24 23:50 +0200
Subject[PATCH v6 0/3] Extend the vTPM proxy driver to pass locality
Message-ID<tKMki-7HS-9@gated-at.bofh.it>
The purpose of this series of patches is to enable the passing of the locality
a command is executing in to a recipient, i.e., TPM emulator. To enable this we
introduce vendor-specific TPM commands for TPM 1.2 and TPM 2 that the driver
sends to the TPM emulator.

v5->v6:
  - Added patch 3/3.

v4->v5:
  - introduce TPM_TRANSMIT_RAW to be able to call tpm_transmit without
    recursing into requesting the locality.

v3->v4:
  - addressed Jarkko's comments: largely a rewrite of the patches

v2->v3:
  - addressed Jarkko's comments

v1->v2:
  - fixed return value from function in patch 3/3


Stefan Berger (3):
  tpm: Introduce flag TPM_TRANSMIT_RAW
  tpm: vtpm_proxy: Implement request_locality function.
  tpm: vtpm_proxy: Prevent userspace from sending driver command

 drivers/char/tpm/tpm-interface.c  |  4 ++-
 drivers/char/tpm/tpm.h            |  1 +
 drivers/char/tpm/tpm_vtpm_proxy.c | 69 +++++++++++++++++++++++++++++++++++++++
 include/uapi/linux/vtpm_proxy.h   |  4 +++
 4 files changed, 77 insertions(+), 1 deletion(-)

-- 
2.4.3

[toc] | [next] | [standalone]


#1649979 — [PATCH v6 1/3] tpm: Introduce flag TPM_TRANSMIT_RAW

FromStefan Berger <stefanb@linux.vnet.ibm.com>
Date2017-05-24 23:50 +0200
Subject[PATCH v6 1/3] tpm: Introduce flag TPM_TRANSMIT_RAW
Message-ID<tKMkj-7HS-51@gated-at.bofh.it>
In reply to#1649966
Introduce the flag TPM_TRANSMIT_RAW that allows us to transmit
a command without recursing into the requesting of locality.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm-interface.c | 3 ++-
 drivers/char/tpm/tpm.h           | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 4ed08ab..2eacda2 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -416,7 +416,8 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
 	/* Store the decision as chip->locality will be changed. */
 	need_locality = chip->locality == -1;
 
-	if (need_locality && chip->ops->request_locality)  {
+	if (!(flags & TPM_TRANSMIT_RAW) &&
+	    need_locality && chip->ops->request_locality)  {
 		rc = chip->ops->request_locality(chip, 0);
 		if (rc < 0)
 			goto out_no_locality;
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index e81d8c7..25d9858 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -525,6 +525,7 @@ extern struct idr dev_nums_idr;
 
 enum tpm_transmit_flags {
 	TPM_TRANSMIT_UNLOCKED	= BIT(0),
+	TPM_TRANSMIT_RAW	= BIT(1),
 };
 
 ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
-- 
2.4.3

[toc] | [prev] | [next] | [standalone]


#1649997 — Re: [PATCH v6 1/3] tpm: Introduce flag TPM_TRANSMIT_RAW

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2017-05-25 00:20 +0200
SubjectRe: [PATCH v6 1/3] tpm: Introduce flag TPM_TRANSMIT_RAW
Message-ID<tKMNj-87K-1@gated-at.bofh.it>
In reply to#1649979
On Wed, May 24, 2017 at 05:39:39PM -0400, Stefan Berger wrote:
> Introduce the flag TPM_TRANSMIT_RAW that allows us to transmit
> a command without recursing into the requesting of locality.
> 
> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

I'll rename the constant as TPM_TRANSMIT_NO_LOCALITY if you don't mind.

/Jarkko

> ---
>  drivers/char/tpm/tpm-interface.c | 3 ++-
>  drivers/char/tpm/tpm.h           | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index 4ed08ab..2eacda2 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -416,7 +416,8 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
>  	/* Store the decision as chip->locality will be changed. */
>  	need_locality = chip->locality == -1;
>  
> -	if (need_locality && chip->ops->request_locality)  {
> +	if (!(flags & TPM_TRANSMIT_RAW) &&
> +	    need_locality && chip->ops->request_locality)  {
>  		rc = chip->ops->request_locality(chip, 0);
>  		if (rc < 0)
>  			goto out_no_locality;
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index e81d8c7..25d9858 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -525,6 +525,7 @@ extern struct idr dev_nums_idr;
>  
>  enum tpm_transmit_flags {
>  	TPM_TRANSMIT_UNLOCKED	= BIT(0),
> +	TPM_TRANSMIT_RAW	= BIT(1),
>  };
>  
>  ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
> -- 
> 2.4.3
> 

[toc] | [prev] | [next] | [standalone]


#1650010 — Re: [PATCH v6 1/3] tpm: Introduce flag TPM_TRANSMIT_RAW

FromStefan Berger <stefanb@linux.vnet.ibm.com>
Date2017-05-25 01:10 +0200
SubjectRe: [PATCH v6 1/3] tpm: Introduce flag TPM_TRANSMIT_RAW
Message-ID<tKNzH-aF-1@gated-at.bofh.it>
In reply to#1649997
On 05/24/2017 06:18 PM, Jarkko Sakkinen wrote:
> On Wed, May 24, 2017 at 05:39:39PM -0400, Stefan Berger wrote:
>> Introduce the flag TPM_TRANSMIT_RAW that allows us to transmit
>> a command without recursing into the requesting of locality.
>>
>> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
>> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> I'll rename the constant as TPM_TRANSMIT_NO_LOCALITY if you don't mind.

Fine by me.


     Stefan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web