[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b56dd2e9f3934e24f08005b9c5588c54b4837ff6.camel@HansenPartnership.com>
Date: Mon, 12 Oct 2020 17:58:04 -0700
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
linux-integrity@...r.kernel.org
Cc: David Howells <dhowells@...hat.com>,
Mimi Zohar <zohar@...ux.ibm.com>, stable@...r.kernel.org,
Sumit Garg <sumit.garg@...aro.org>,
kernel test robot <lkp@...el.com>,
Peter Huewe <peterhuewe@....de>,
Jason Gunthorpe <jgg@...pe.ca>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
James Morris <jmorris@...ei.org>,
"Serge E. Hallyn" <serge@...lyn.com>,
Jerry Snitselaar <jsnitsel@...hat.com>,
Alexey Klimov <aklimov@...hat.com>,
open list <linux-kernel@...r.kernel.org>,
"open list:KEYS-TRUSTED" <keyrings@...r.kernel.org>,
"open list:SECURITY SUBSYSTEM"
<linux-security-module@...r.kernel.org>
Subject: Re: [PATCH v3 3/3] KEYS: trusted: Reserve TPM for seal and unseal
operations
On Tue, 2020-10-13 at 03:28 +0300, Jarkko Sakkinen wrote:
[...]
> diff --git a/include/linux/tpm.h b/include/linux/tpm.h
> index 8f4ff39f51e7..f0ebce14d2f8 100644
> --- a/include/linux/tpm.h
> +++ b/include/linux/tpm.h
> @@ -397,6 +397,10 @@ static inline u32 tpm2_rc_value(u32 rc)
> #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
>
> extern int tpm_is_tpm2(struct tpm_chip *chip);
> +extern __must_check int tpm_try_get_ops(struct tpm_chip *chip);
> +extern void tpm_put_ops(struct tpm_chip *chip);
> +extern ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct
> tpm_buf *buf,
> + size_t min_rsp_body_length, const char
> *desc);
> extern int tpm_pcr_read(struct tpm_chip *chip, u32 pcr_idx,
> struct tpm_digest *digest);
> extern int tpm_pcr_extend(struct tpm_chip *chip, u32 pcr_idx,
> @@ -410,7 +414,18 @@ static inline int tpm_is_tpm2(struct tpm_chip
> *chip)
> {
> return -ENODEV;
> }
> -
> +static inline int tpm_try_get_ops(struct tpm_chip *chip)
> +{
> + return -ENODEV;
> +}
> +static inline void tpm_put_ops(struct tpm_chip *chip)
> +{
> +}
> +static inline ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct
> tpm_buf *buf,
> + size_t min_rsp_body_length,
> const char *desc)
> +{
> + return -ENODEV;
> +}
> static inline int tpm_pcr_read(struct tpm_chip *chip, int pcr_idx,
I don't think we want this, do we? That's only for API access which
should be available when the TPM isn't selected. Given that get/put
are TPM critical operations, they should only appear when inside code
where the TPM has already been selected. If they appear outside TPM
selected code, I think we want the compile to fail, which is why we
don't want these backup definitions.
James
Powered by blists - more mailing lists