All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jordan Hand <jorhand@linux.microsoft.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Mimi Zohar <zohar@linux.ibm.com>
Cc: "Piotr Król" <piotr.krol@3mdeb.com>, linux-integrity@vger.kernel.org
Subject: Re: TPM 2.0 Linux sysfs interface
Date: Tue, 3 Sep 2019 15:40:40 -0700	[thread overview]
Message-ID: <fe908209-3752-19b2-2652-79fb75f69e2b@linux.microsoft.com> (raw)
In-Reply-To: <bc9ab35e-997c-b107-3073-d5150de063d0@intel.com>


On 9/3/19 9:23 AM, Tadeusz Struk wrote:
> On 9/2/19 10:55 PM, Jason Gunthorpe wrote:
>> On Mon, Sep 02, 2019 at 05:35:18PM -0400, Mimi Zohar wrote:
>>> On Mon, 2019-09-02 at 16:26 -0300, Jason Gunthorpe wrote:
>>>> On Fri, Aug 30, 2019 at 02:20:54PM -0700, Tadeusz Struk wrote:
>>>>> On 8/28/19 9:15 AM, Jason Gunthorpe wrote:
>>>>>>>> So exposing PCRs and things through sysfs is not going to happen.
>>>>>>>>
>>>>>>>> If you had some very narrowly defined things like version, then
>>>>>>>> *maybe* but I think a well defined use case is needed for why this
>>>>>>>> needs to be sysfs and can't be done in C as Jarkko explained.
>>>>>>> Piotr's request for a sysfs file to differentiate between TPM 1.2 and
>>>>>>> TPM 2.0 is a reasonable request and probably could be implemented on
>>>>>>> TPM registration.
>>>>>>>
>>>>>>> If exposing the PCRs through sysfs is not acceptable, then perhaps
>>>>>>> suggest an alternative.
>>>>>> Use the char dev, this is exactly what is is for.
>>>>>
>>>>> What about a new /proc entry?
>>>>> Currently there are /proc/cpuinfo, /proc/meminfo, /proc/slabinfo...
>>>>> What about adding a new /proc/tpminfo that would print info like
>>>>> version, number of enabled PCR banks, physical interface [tis|crb],
>>>>> vendor, etc.
>>>>
>>>> I thought we were not really doing new proc entries?
>>>>
>>>> Why this focus on making some textual output?
>>>
>>> I don't really care if we define procfs, sysfs, or securityfs file(s)
>>> or whether those files are ascii or binary.  Whatever is defined,
>>> should be defined for both TPM 1.2 and TPM 2.0 (eg. TPM version).
>>
>> Use an ioctl on the char dev?
> 
> The advantage of /proc/tpminfo would be that it can be a first
> entry point on a system, that would give general overview of the
> system TPM configuration, without the need of poking /dev/tpm<N>
> files, only to find out that the TPM doesn't understand the
> command, because it implements different version of TCG spec.
> It would be a single point of information in case of multiple TPMs.
> It can have some predefined format that could be read by a human
> as well as a machine, e.g.
> 
> tpm0:
>    version: 2.0
>    physical interface: CRB
>    supported PCR banks: SHA1, SHA256
>    ...
>    vendor: <Vendor Name>
>    vendor specific: <Vendor specific output>
>
To me it still feels trivial write an application to do this same thing
in userspace with ioctls to the char device (figure out what interface
the TPM is using, get basic capabilities, etc.). There isn't anything
here that the kernel can do that can't be done from userspace that I can
see. Is this not true? Maybe its less code in the kernel but I don't
know that that's a great reason.

I don't see a clear advantage to putting the code in the kernel, but I
do see disadvantages. Interfaces between kernel and userspace need to be
more rigid to avoid breakage.

Thanks,
Jordan

  reply	other threads:[~2019-09-03 22:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 23:24 TPM 2.0 Linux sysfs interface Piotr Król
2019-08-27  1:05 ` Jason Gunthorpe
2019-08-28 15:53   ` Mimi Zohar
2019-08-28 16:15     ` Jason Gunthorpe
2019-08-30 21:20       ` Tadeusz Struk
2019-09-02 19:26         ` Jason Gunthorpe
2019-09-02 21:35           ` Mimi Zohar
2019-09-03  5:55             ` Jason Gunthorpe
2019-09-03 11:49               ` Mimi Zohar
2019-09-03 13:07                 ` Jason Gunthorpe
2019-09-03 13:23                   ` Mimi Zohar
2019-09-03 16:21                     ` Jarkko Sakkinen
2019-09-03 16:23               ` Tadeusz Struk
2019-09-03 22:40                 ` Jordan Hand [this message]
2019-09-03 23:29                   ` Mimi Zohar
2019-09-04  5:58                     ` Jason Gunthorpe
2019-09-04 11:30                       ` Mimi Zohar
2019-09-04 19:43                         ` Jason Gunthorpe
2019-09-04 20:26                           ` Mimi Zohar
2019-09-06 17:53                           ` Serge E. Hallyn
2019-08-28 15:03 ` Mimi Zohar
2019-08-28 17:15   ` Petr Vorel
2019-08-28 23:22   ` Piotr Król
2019-08-29  7:32     ` Petr Vorel

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=fe908209-3752-19b2-2652-79fb75f69e2b@linux.microsoft.com \
    --to=jorhand@linux.microsoft.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=piotr.krol@3mdeb.com \
    --cc=tadeusz.struk@intel.com \
    --cc=zohar@linux.ibm.com \
    /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.