All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/7] Provide support for the software TPM emulator
Date: Wed, 5 Apr 2017 14:00:44 -0400	[thread overview]
Message-ID: <7b090051-40f1-0903-994c-461ec22b0e07@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAJ+F1CLxZ15CnOxEwha6=NQyUSyLmoWh62ZAmr2OJT8TQDOB+A@mail.gmail.com>

On 04/05/2017 01:49 PM, Marc-André Lureau wrote:
> Hi
>
> On Wed, Apr 5, 2017 at 7:32 PM Stefan Berger 
> <stefanb@linux.vnet.ibm.com <mailto:stefanb@linux.vnet.ibm.com>> wrote:
>
>     On 04/05/2017 11:08 AM, Marc-André Lureau wrote:
>     > Hi
>     >
>     > On Wed, Apr 5, 2017 at 5:04 PM Stefan Berger
>     <stefanb@linux.vnet.ibm.com <mailto:stefanb@linux.vnet.ibm.com>>
>     > wrote:
>     >
>     >> On 04/05/2017 03:09 AM, Amarnath Valluri wrote:
>     >>>
>     >>> On 03.04.2017 20 <tel:03%2004%2020%2017%2020>
>     <03%2004%2020%2017%2020>:07, Daniel P. Berrange wrote:
>     >>>> On Fri, Mar 31, 2017 at 04:10:09PM +0300, Amarnath Valluri wrote:
>     >>>>> Briefly, Theses set of patches introduces:
>     >>>>>    - new TPM backend driver to support software TPM
>     emulators(swtpm(1)).
>     >>>>>    - and few supported fixes/enhancements/cleanup to
>     existing tpm
>     >>>>> backend code.
>     >>>>>
>     >>>>> The similar idea was initiated earliar(2) by Stefan Berger(CCed)
>     >>>>> with slightly
>     >>>>> different approach, using CUSE. As swtpm has excellent
>     support for
>     >>>>> unix domain
>     >>>>> sockets, hence this implementation uses unix domain sockets to
>     >>>>> communicate with
>     >>>>> swtpm.
>     >>>>>
>     >>>>> When Qemu is configured with 'emulator' tpm backend, it spawns
>     >>>>> 'swtpm' and
>     >>>>> communicates its via Unix domain sockets.
>     >>>> I'm not convinced that having QEMU spawning swtpm itself is a
>     desirable
>     >>>> approach, as it means QEMU needs to have all the privileges
>     that swtpm
>     >>>> will need, so that swtpm can inherit them. At the very least
>     I think we
>     >>>> need to have a way to disable this spawning, so it can
>     connect to a
>     >>>> pre-existing swtpm process that's been spawned ahead of time.
>     This will
>     >>>> let us have stricter privilege separation.
>     >>> Both spawning inside qemu and connecting to already running
>     swtpm has
>     >>> its own pros, Hence we can make this spawning as backend
>     configuration
>     >>> detail, So it looks like this:
>     >>>
>     >>> -tpmdev
>     >>>
>     >>
>     emulator,id=id,tpmstatedir=dir[,spawn=[on|off],data-path=path,ctrl-path=path,logfile=path,loglevel=number]
>     >>>    Options details:
>     >>>       tpmstatedir - Directory path, which swtpm should  use for
>     >>> storing  TPM state
>     >>>       *spawn      - should spawn new process, defaults to 'off'
>     >>>       *path         - swtpm binary path to spawn, ignored if
>     spawn is off
>     >>>       *data-path - Socket path to use/connect for data messages
>     >>>       *ctrl-path   - Socket path to use/connect for
>     out-of-band control
>     >>> messages
>     >> FD passing would work?
>     >>
>     > Could with /dev/fdset in theory, but it would be better to use
>     chardevs
>     > instead.
>     >
>     > Is there any reason left to have 2 sockets? Couldn't the data be
>     sent as
>     > another message on the "ctrl-path" ?
>
>     Better to keep them separate so whatever comes out of a VM will
>     never be
>     mistaken for a control command.
>
>
> This is a moot argument, there is no reason the code would mix the two,
>
> An alternative to make the setup easier is to pass the data socket 
> through the ctrl socket, perhaps.

Libvirt could open two sockets and pass them via command line. I don't 
think there's a problem in this case.
With command line it may be a bit more typing, but passing the data 
socket through the ctrl socket doesn't seem to work so easily, so one 
may have to resort to typing the paths.

      reply	other threads:[~2017-04-05 18:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 13:10 [Qemu-devel] [PATCH 0/7] Provide support for the software TPM emulator Amarnath Valluri
2017-03-31 13:10 ` [Qemu-devel] [PATCH 1/7] tpm-backend: Remove unneeded member variable from backend class Amarnath Valluri
2017-04-03 17:02   ` Marc-André Lureau
2017-04-04 13:14   ` Philippe Mathieu-Daudé
2017-03-31 13:10 ` [Qemu-devel] [PATCH 2/7] tpm-backend: Move thread handling inside TPMBackend Amarnath Valluri
2017-04-04 10:56   ` Marc-André Lureau
2017-04-04 11:21     ` Amarnath Valluri
2017-03-31 13:10 ` [Qemu-devel] [PATCH 3/7] tpm-backend: Initialize and free data members in it's own methods Amarnath Valluri
2017-04-04 12:57   ` Marc-André Lureau
2017-03-31 13:10 ` [Qemu-devel] [PATCH 4/7] tpm-backend: Call interface methods only if backend implements them Amarnath Valluri
2017-04-04 13:15   ` Marc-André Lureau
2017-03-31 13:10 ` [Qemu-devel] [PATCH 5/7] tmp backend: Add new api to read backend tpm options Amarnath Valluri
2017-04-03 19:24   ` Eric Blake
2017-03-31 13:10 ` [Qemu-devel] [PATCH 6/7] tpm-passthrough: move reusable code to utils Amarnath Valluri
2017-04-04 13:53   ` Marc-André Lureau
2017-03-31 13:10 ` [Qemu-devel] [PATCH 7/7] Added support for TPM emulator Amarnath Valluri
2017-04-03 19:30   ` Eric Blake
2017-03-31 13:10 ` [Qemu-devel] [PATCH 7/7] tpm: New backend driver to support " Amarnath Valluri
2017-04-04 16:23   ` Marc-André Lureau
2017-04-05 15:30   ` Daniel P. Berrange
2017-04-02  8:33 ` [Qemu-devel] [PATCH 0/7] Provide support for the software " no-reply
2017-04-03 17:07 ` Daniel P. Berrange
2017-04-03 17:18   ` Marc-André Lureau
2017-04-04 15:43     ` Daniel P. Berrange
2017-04-04 16:27       ` Stefan Berger
2017-04-03 17:32   ` Patrick Ohly
2017-04-03 17:38     ` Dr. David Alan Gilbert
2017-04-03 19:41       ` Patrick Ohly
2017-04-04  8:02         ` Dr. David Alan Gilbert
2017-04-03 17:34   ` Dr. David Alan Gilbert
2017-04-04 12:08   ` Stefan Berger
2017-04-05  7:09   ` Amarnath Valluri
2017-04-05 15:04     ` Stefan Berger
2017-04-05 15:08       ` Marc-André Lureau
2017-04-05 17:32         ` Stefan Berger
2017-04-05 17:49           ` Marc-André Lureau
2017-04-05 18:00             ` Stefan Berger [this message]

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=7b090051-40f1-0903-994c-461ec22b0e07@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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.