mbox series

[RFC/RFT,v3,0/3] KEYS: trusted: Add generic trusted keys framework

Message ID 1565098640-12536-1-git-send-email-sumit.garg@linaro.org
Headers show
Series KEYS: trusted: Add generic trusted keys framework | expand

Message

Sumit Garg Aug. 6, 2019, 1:37 p.m. UTC
This patch-set is an outcome of discussion here [1].

I have tested this framework with trusted keys support provided via TEE
but I wasn't able to test it with a TPM device as I don't possess one. It
would be really helpful if others could test this patch-set using a TPM
device.

[1] https://www.mail-archive.com/linux-doc@vger.kernel.org/msg30591.html

Changes in v3:

Move TPM2 trusted keys code to trusted keys subsystem.

Changes in v2:

Split trusted keys abstraction patch for ease of review.

Sumit Garg (3):
  KEYS: trusted: create trusted keys subsystem
  KEYS: trusted: move tpm2 trusted keys code
  KEYS: trusted: Add generic trusted keys framework

 crypto/asymmetric_keys/asym_tpm.c                  |   2 +-
 drivers/char/tpm/tpm-interface.c                   |  56 ---
 drivers/char/tpm/tpm.h                             | 224 ------------
 drivers/char/tpm/tpm2-cmd.c                        | 307 -----------------
 include/keys/trusted-type.h                        |  45 +++
 include/keys/{trusted.h => trusted_tpm.h}          |  42 +--
 include/linux/tpm.h                                | 264 +++++++++++++-
 security/keys/Makefile                             |   2 +-
 security/keys/trusted-keys/Makefile                |   8 +
 .../keys/{trusted.c => trusted-keys/trusted-tpm.c} | 363 ++++----------------
 security/keys/trusted-keys/trusted-tpm2.c          | 378 +++++++++++++++++++++
 security/keys/trusted-keys/trusted.c               | 343 +++++++++++++++++++
 12 files changed, 1109 insertions(+), 925 deletions(-)
 rename include/keys/{trusted.h => trusted_tpm.h} (72%)
 create mode 100644 security/keys/trusted-keys/Makefile
 rename security/keys/{trusted.c => trusted-keys/trusted-tpm.c} (76%)
 create mode 100644 security/keys/trusted-keys/trusted-tpm2.c
 create mode 100644 security/keys/trusted-keys/trusted.c

-- 
2.7.4

Comments

Jarkko Sakkinen Aug. 7, 2019, 6:59 p.m. UTC | #1
On Tue, Aug 06, 2019 at 07:07:18PM +0530, Sumit Garg wrote:
> Move existing code to trusted keys subsystem. Also, rename files with

> "tpm" as suffix which provides the underlying implementation.

> 

> Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>


The name for should be still trusted.ko even if new backends are added.
Must be done in order not to break user space.

Situation is quite similar as when new backends were added to tpm_tis
some time ago: MMIO backed implementation was kept as tpm_tis.ko, the
core module was named as tpm_tis_core and SPI backed implementation was
named as tpm_tis_spi.ko.

/Jarkko
Sumit Garg Aug. 8, 2019, 12:26 p.m. UTC | #2
On Thu, 8 Aug 2019 at 00:29, Jarkko Sakkinen
<jarkko.sakkinen@linux.intel.com> wrote:
>

> On Tue, Aug 06, 2019 at 07:07:18PM +0530, Sumit Garg wrote:

> > Move existing code to trusted keys subsystem. Also, rename files with

> > "tpm" as suffix which provides the underlying implementation.

> >

> > Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

> > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>

>

> The name for should be still trusted.ko even if new backends are added.

> Must be done in order not to break user space.


Agree. I think I need to update Makefile as follows:

obj-$(CONFIG_TRUSTED_KEYS) += trusted.o
trusted-y += trusted-tpm.o

-Sumit

>

> Situation is quite similar as when new backends were added to tpm_tis

> some time ago: MMIO backed implementation was kept as tpm_tis.ko, the

> core module was named as tpm_tis_core and SPI backed implementation was

> named as tpm_tis_spi.ko.

>

> /Jarkko