All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: David Howells <dhowells@redhat.com>,
	denkenz@gmail.com, jejb@linux.vnet.ibm.com,
	keyrings@vger.kernel.org, linux-integrity@vger.kernel.org,
	tpmdd-devel@lists.sourceforge.net,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH 02/23] TPM: Provide a facility for a userspace TPM emulator
Date: Fri, 24 Aug 2018 06:29:14 +0000	[thread overview]
Message-ID: <20180824062914.GD3584@linux.intel.com> (raw)
In-Reply-To: <20180821183140.GD25543@ziepe.ca>

On Tue, Aug 21, 2018 at 12:31:40PM -0600, Jason Gunthorpe wrote:
> On Tue, Aug 21, 2018 at 04:57:03PM +0100, David Howells wrote:
> > Provide a misc device file (/dev/tpm_emul) by which a userspace TPM emulator
> > can set up a virtual TPM device under the control of the TPM frontend.  The
> > way this works is:
> > 
> >  (1) The emulator opens /dev/tpm_emul which is provided by the tpm_user
> >      driver.
> > 
> >  (2) tpm_user registers a TPM device and the tpm driver creates a /dev/tpmN
> >      misc device for the trousers package and suchlike to access.
> > 
> >  (3) The emulator sits in read() on the emulator device waiting for a command
> >      to come through.
> > 
> >  (4) tpm_user passes requests from /dev/tpmN to the emulator's read() call.
> > 
> >  (5) The emulator processes the request.
> > 
> >  (6) The emulator either write()'s the reply or calls ioctl(fd,0,0) to cancel
> >      the command.
> > 
> >  (7) The emulator goes back to read() to wait for the next command.
> > 
> >  (8) tpm_user passes the reply back to the tpm driver which passes it back to
> >      /dev/tpmN.
> > 
> > When the emulator closes /dev/tpm_emul, the TPM driver is unregistered and the
> > /dev/tpmN misc device is then removed.  Any outstanding requests are aborted
> > and -EIO will be returned from then on.  Multiple TPMs can be registered.
> > 
> > Signed-off-by: David Howells <dhowells@redhat.com>
> > ---
> > 
> >  drivers/char/tpm/Kconfig         |   13 +
> >  drivers/char/tpm/Makefile        |    1 
> >  drivers/char/tpm/tpm_user_emul.c |  672 ++++++++++++++++++++++++++++++++++++++
> >  include/linux/wait.h             |   11 +
> >  4 files changed, 697 insertions(+)
> >  create mode 100644 drivers/char/tpm/tpm_user_emul.c
> 
> This looks to duplicate the vtpm stuff...

Yeah, this is a duplicate to tpm_vtpm_proxy.

> 
> Jason

/Jarkko

WARNING: multiple messages have this Message-ID (diff)
From: jarkko.sakkinen@linux.intel.com (Jarkko Sakkinen)
To: linux-security-module@vger.kernel.org
Subject: [PATCH 02/23] TPM: Provide a facility for a userspace TPM emulator
Date: Fri, 24 Aug 2018 09:29:14 +0300	[thread overview]
Message-ID: <20180824062914.GD3584@linux.intel.com> (raw)
In-Reply-To: <20180821183140.GD25543@ziepe.ca>

On Tue, Aug 21, 2018 at 12:31:40PM -0600, Jason Gunthorpe wrote:
> On Tue, Aug 21, 2018 at 04:57:03PM +0100, David Howells wrote:
> > Provide a misc device file (/dev/tpm_emul) by which a userspace TPM emulator
> > can set up a virtual TPM device under the control of the TPM frontend.  The
> > way this works is:
> > 
> >  (1) The emulator opens /dev/tpm_emul which is provided by the tpm_user
> >      driver.
> > 
> >  (2) tpm_user registers a TPM device and the tpm driver creates a /dev/tpmN
> >      misc device for the trousers package and suchlike to access.
> > 
> >  (3) The emulator sits in read() on the emulator device waiting for a command
> >      to come through.
> > 
> >  (4) tpm_user passes requests from /dev/tpmN to the emulator's read() call.
> > 
> >  (5) The emulator processes the request.
> > 
> >  (6) The emulator either write()'s the reply or calls ioctl(fd,0,0) to cancel
> >      the command.
> > 
> >  (7) The emulator goes back to read() to wait for the next command.
> > 
> >  (8) tpm_user passes the reply back to the tpm driver which passes it back to
> >      /dev/tpmN.
> > 
> > When the emulator closes /dev/tpm_emul, the TPM driver is unregistered and the
> > /dev/tpmN misc device is then removed.  Any outstanding requests are aborted
> > and -EIO will be returned from then on.  Multiple TPMs can be registered.
> > 
> > Signed-off-by: David Howells <dhowells@redhat.com>
> > ---
> > 
> >  drivers/char/tpm/Kconfig         |   13 +
> >  drivers/char/tpm/Makefile        |    1 
> >  drivers/char/tpm/tpm_user_emul.c |  672 ++++++++++++++++++++++++++++++++++++++
> >  include/linux/wait.h             |   11 +
> >  4 files changed, 697 insertions(+)
> >  create mode 100644 drivers/char/tpm/tpm_user_emul.c
> 
> This looks to duplicate the vtpm stuff...

Yeah, this is a duplicate to tpm_vtpm_proxy.

> 
> Jason

/Jarkko

WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: David Howells <dhowells@redhat.com>,
	denkenz@gmail.com, jejb@linux.vnet.ibm.com,
	keyrings@vger.kernel.org, linux-integrity@vger.kernel.org,
	tpmdd-devel@lists.sourceforge.net,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH 02/23] TPM: Provide a facility for a userspace TPM emulator
Date: Fri, 24 Aug 2018 09:29:14 +0300	[thread overview]
Message-ID: <20180824062914.GD3584@linux.intel.com> (raw)
In-Reply-To: <20180821183140.GD25543@ziepe.ca>

On Tue, Aug 21, 2018 at 12:31:40PM -0600, Jason Gunthorpe wrote:
> On Tue, Aug 21, 2018 at 04:57:03PM +0100, David Howells wrote:
> > Provide a misc device file (/dev/tpm_emul) by which a userspace TPM emulator
> > can set up a virtual TPM device under the control of the TPM frontend.  The
> > way this works is:
> > 
> >  (1) The emulator opens /dev/tpm_emul which is provided by the tpm_user
> >      driver.
> > 
> >  (2) tpm_user registers a TPM device and the tpm driver creates a /dev/tpmN
> >      misc device for the trousers package and suchlike to access.
> > 
> >  (3) The emulator sits in read() on the emulator device waiting for a command
> >      to come through.
> > 
> >  (4) tpm_user passes requests from /dev/tpmN to the emulator's read() call.
> > 
> >  (5) The emulator processes the request.
> > 
> >  (6) The emulator either write()'s the reply or calls ioctl(fd,0,0) to cancel
> >      the command.
> > 
> >  (7) The emulator goes back to read() to wait for the next command.
> > 
> >  (8) tpm_user passes the reply back to the tpm driver which passes it back to
> >      /dev/tpmN.
> > 
> > When the emulator closes /dev/tpm_emul, the TPM driver is unregistered and the
> > /dev/tpmN misc device is then removed.  Any outstanding requests are aborted
> > and -EIO will be returned from then on.  Multiple TPMs can be registered.
> > 
> > Signed-off-by: David Howells <dhowells@redhat.com>
> > ---
> > 
> >  drivers/char/tpm/Kconfig         |   13 +
> >  drivers/char/tpm/Makefile        |    1 
> >  drivers/char/tpm/tpm_user_emul.c |  672 ++++++++++++++++++++++++++++++++++++++
> >  include/linux/wait.h             |   11 +
> >  4 files changed, 697 insertions(+)
> >  create mode 100644 drivers/char/tpm/tpm_user_emul.c
> 
> This looks to duplicate the vtpm stuff...

Yeah, this is a duplicate to tpm_vtpm_proxy.

> 
> Jason

/Jarkko

WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
Cc: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	keyrings-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-integrity-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	denkenz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH 02/23] TPM: Provide a facility for a userspace TPM emulator
Date: Fri, 24 Aug 2018 09:29:14 +0300	[thread overview]
Message-ID: <20180824062914.GD3584@linux.intel.com> (raw)
In-Reply-To: <20180821183140.GD25543-uk2M96/98Pc@public.gmane.org>

On Tue, Aug 21, 2018 at 12:31:40PM -0600, Jason Gunthorpe wrote:
> On Tue, Aug 21, 2018 at 04:57:03PM +0100, David Howells wrote:
> > Provide a misc device file (/dev/tpm_emul) by which a userspace TPM emulator
> > can set up a virtual TPM device under the control of the TPM frontend.  The
> > way this works is:
> > 
> >  (1) The emulator opens /dev/tpm_emul which is provided by the tpm_user
> >      driver.
> > 
> >  (2) tpm_user registers a TPM device and the tpm driver creates a /dev/tpmN
> >      misc device for the trousers package and suchlike to access.
> > 
> >  (3) The emulator sits in read() on the emulator device waiting for a command
> >      to come through.
> > 
> >  (4) tpm_user passes requests from /dev/tpmN to the emulator's read() call.
> > 
> >  (5) The emulator processes the request.
> > 
> >  (6) The emulator either write()'s the reply or calls ioctl(fd,0,0) to cancel
> >      the command.
> > 
> >  (7) The emulator goes back to read() to wait for the next command.
> > 
> >  (8) tpm_user passes the reply back to the tpm driver which passes it back to
> >      /dev/tpmN.
> > 
> > When the emulator closes /dev/tpm_emul, the TPM driver is unregistered and the
> > /dev/tpmN misc device is then removed.  Any outstanding requests are aborted
> > and -EIO will be returned from then on.  Multiple TPMs can be registered.
> > 
> > Signed-off-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > ---
> > 
> >  drivers/char/tpm/Kconfig         |   13 +
> >  drivers/char/tpm/Makefile        |    1 
> >  drivers/char/tpm/tpm_user_emul.c |  672 ++++++++++++++++++++++++++++++++++++++
> >  include/linux/wait.h             |   11 +
> >  4 files changed, 697 insertions(+)
> >  create mode 100644 drivers/char/tpm/tpm_user_emul.c
> 
> This looks to duplicate the vtpm stuff...

Yeah, this is a duplicate to tpm_vtpm_proxy.

> 
> Jason

/Jarkko


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

  reply	other threads:[~2018-08-24  6:29 UTC|newest]

Thread overview: 168+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21 15:56 tpm: Provide a TPM access library David Howells
2018-08-21 15:56 ` David Howells
2018-08-21 15:56 ` David Howells
2018-08-21 15:56 ` David Howells
2018-08-21 15:56 ` [PATCH 01/23] TPM: Add new TPMs to the tail of the list to prevent inadvertent change of dev David Howells
2018-08-21 15:56   ` David Howells
2018-08-21 15:56   ` David Howells
2018-08-21 15:56   ` David Howells
2018-08-21 18:30   ` Jason Gunthorpe
2018-08-21 18:30     ` Jason Gunthorpe
2018-08-21 18:30     ` Jason Gunthorpe
2018-08-21 18:30     ` Jason Gunthorpe
2018-08-24  6:24     ` Jarkko Sakkinen
2018-08-24  6:24       ` Jarkko Sakkinen
2018-08-24  6:24       ` Jarkko Sakkinen
2018-08-24  6:24       ` Jarkko Sakkinen
2018-08-24  6:25       ` Jarkko Sakkinen
2018-08-24  6:25         ` Jarkko Sakkinen
2018-08-24  6:25         ` Jarkko Sakkinen
2018-08-24  6:25         ` Jarkko Sakkinen
2018-08-24 11:22         ` Mimi Zohar
2018-08-24 11:22           ` Mimi Zohar
2018-08-24 11:22           ` Mimi Zohar
2018-08-24 11:22           ` Mimi Zohar
2018-08-24  6:19   ` Jarkko Sakkinen
2018-08-24  6:19     ` Jarkko Sakkinen
2018-08-24  6:19     ` Jarkko Sakkinen
2018-08-24  6:19     ` Jarkko Sakkinen
2018-08-21 15:57 ` [PATCH 02/23] TPM: Provide a facility for a userspace TPM emulator David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 18:31   ` Jason Gunthorpe
2018-08-21 18:31     ` Jason Gunthorpe
2018-08-21 18:31     ` Jason Gunthorpe
2018-08-21 18:31     ` Jason Gunthorpe
2018-08-24  6:29     ` Jarkko Sakkinen [this message]
2018-08-24  6:29       ` Jarkko Sakkinen
2018-08-24  6:29       ` Jarkko Sakkinen
2018-08-24  6:29       ` Jarkko Sakkinen
2018-08-21 15:57 ` [PATCH 03/23] TPM: Provide a platform driver for the user emulator driver David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-24  6:30   ` Jarkko Sakkinen
2018-08-24  6:30     ` Jarkko Sakkinen
2018-08-24  6:30     ` Jarkko Sakkinen
2018-08-24  6:30     ` Jarkko Sakkinen
2018-08-21 15:57 ` [PATCH 04/23] TPM: Expose struct tpm_chip and related find_get and put functions David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 18:31   ` Jason Gunthorpe
2018-08-21 18:31     ` Jason Gunthorpe
2018-08-21 18:31     ` Jason Gunthorpe
2018-08-21 18:31     ` Jason Gunthorpe
2018-08-21 18:35   ` David Howells
2018-08-21 18:35     ` David Howells
2018-08-21 18:35     ` David Howells
2018-08-21 18:35     ` David Howells
2018-08-21 15:57 ` [PATCH 05/23] TPM: Use struct tpm_chip rather than chip number as interface parameter David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-24  7:42   ` Jarkko Sakkinen
2018-08-24  7:42     ` Jarkko Sakkinen
2018-08-24  7:42     ` Jarkko Sakkinen
2018-08-24  7:42     ` Jarkko Sakkinen
2018-08-21 15:57 ` [PATCH 06/23] TPM: Move ordinal values from interface file to header with other ordinals David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57 ` [PATCH 07/23] TPM: Consolidate tpm_send(), transmit_cmd() and tpm_transmit() David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57 ` [PATCH 08/23] TPMLIB: Break TPM bits out of security/keys/trusted.c David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-24  7:52   ` Jarkko Sakkinen
2018-08-24  7:52     ` Jarkko Sakkinen
2018-08-24  7:52     ` Jarkko Sakkinen
2018-08-24  7:52     ` Jarkko Sakkinen
2018-08-24  8:49     ` Jarkko Sakkinen
2018-08-24  8:49       ` Jarkko Sakkinen
2018-08-24  8:49       ` Jarkko Sakkinen
2018-08-24  8:49       ` Jarkko Sakkinen
2018-08-24  9:33     ` David Howells
2018-08-24  9:33       ` David Howells
2018-08-24  9:33       ` David Howells
2018-08-24  9:33       ` David Howells
2018-08-27  8:25       ` Jarkko Sakkinen
2018-08-27  8:25         ` Jarkko Sakkinen
2018-08-27  8:25         ` Jarkko Sakkinen
2018-08-27  8:25         ` Jarkko Sakkinen
2018-08-21 15:57 ` [PATCH 09/23] TPMLIB: Do some source cleanups David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57 ` [PATCH 10/23] TPMLIB: Better format calls to TSS_*hmac*() David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:57   ` David Howells
2018-08-21 15:58 ` [PATCH 11/23] TPMLIB: Put banner comments on public TPM library functions David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58 ` [PATCH 12/23] TPMLIB: Create tpm_{even, odd}_nonce structs to represent nonces David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58 ` [PATCH 13/23] TPMLIB: Rename store8() and storebytes() David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58 ` [PATCH 14/23] TPMLIB: Make store_s() take a void* data argument, not unsigned char* David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58 ` [PATCH 15/23] TPMLIB: Use __be32 rather than int32_t and use cpu_to_beX() and co David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58 ` [PATCH 16/23] TPMLIB: Put more comments into the HMAC generation functions David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58 ` [PATCH 17/23] TPMLIB: Provide a wrapper to load bytes out of the reply David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58 ` [PATCH 18/23] TPMLIB: Encapsulate XOR-based encryption with authkey derivative David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58 ` [PATCH 19/23] TPMLIB: Add some debugging code David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:58   ` David Howells
2018-08-21 15:59 ` [PATCH 20/23] TPMLIB: Implement call to TPM_CreateWrapKey David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59 ` [PATCH 21/23] TPMLIB: Implement call to TPM_LoadKey2 David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59 ` [PATCH 22/23] TPMLIB: Provide call for TPM_FlushSpecific David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59 ` [PATCH 23/23] TPM: Add an asymmetric key subtype for handling TPM-based keys David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59   ` David Howells
2018-08-21 15:59   ` David Howells
2018-08-22 14:19 ` tpm: Provide a TPM access library Jarkko Sakkinen
2018-08-22 14:19   ` Jarkko Sakkinen
2018-08-22 14:19   ` Jarkko Sakkinen
2018-08-22 14:19   ` Jarkko Sakkinen
2018-08-22 14:45 ` David Howells
2018-08-22 14:45   ` David Howells
2018-08-22 14:45   ` David Howells
2018-08-22 14:45   ` David Howells
2018-08-23 22:49   ` Jarkko Sakkinen
2018-08-23 22:49     ` Jarkko Sakkinen
2018-08-23 22:49     ` Jarkko Sakkinen
2018-08-23 22:49     ` Jarkko Sakkinen

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=20180824062914.GD3584@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=denkenz@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jgg@ziepe.ca \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=tpmdd-devel@lists.sourceforge.net \
    /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.