From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Alexander Graf <graf@amazon.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Herbert Xu <herbert@gondor.apana.org.au>,
Olivia Mackall <olivia@selenic.com>,
Petre Eftime <petre.eftime@gmail.com>,
Erdem Meydanlli <meydanli@amazon.nl>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
David Woodhouse <dwmw@amazon.co.uk>,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Subject: Re: [PATCH v2 1/2] misc: Add Nitro Secure Module driver
Date: Sat, 30 Sep 2023 08:20:49 +0200 [thread overview]
Message-ID: <2023093054-swimming-whoopee-7ef8@gregkh> (raw)
In-Reply-To: <a44a2df0-beb9-4a43-ade4-267ad819729e@amazon.com>
On Fri, Sep 29, 2023 at 09:26:16PM +0200, Alexander Graf wrote:
> Hi Arnd!
>
> On 29.09.23 19:28, Arnd Bergmann wrote:
> > On Fri, Sep 29, 2023, at 09:33, Alexander Graf wrote:
> > > When running Linux inside a Nitro Enclave, the hypervisor provides a
> > > special virtio device called "NSM". This device has 2 main functions:
> > >
> > > 1) Provide attestation reports
> > > 2) Modify PCR state
> > > 3) Provide entropy
> > >
> > > This patch adds the core NSM driver that exposes a /dev/nsm device node
> > > which user space can use to request attestation documents and influence
> > > PCR states. A follow up patch will add a hwrng driver to feed its entropy
> > > into the kernel.
> > >
> > > Originally-by: Petre Eftime <petre.eftime@gmail.com>
> > > Signed-off-by: Alexander Graf <graf@amazon.com>
> > Hi Alex,
> >
> > I've taken a first look at this driver and have some minor comments.
>
>
> Thanks a bunch!
>
>
> > The main point here is that I think we need to look at possible
> > alternatives for the user space interface, and (if possible) change
> > to a set of higher-level ioctl commands from the simple passthrough.
>
>
> I'm slightly torn on that bit. I think in hindsight the NSM device probably
> should have been a reserved vsock CID and the hwrng one should have just
> been virtio-rng.
>
> The problem is that Nitro Enclaves were launched in 2020 and since an
> ecosystem developed in multiple languages to support building code inside:
>
> https://github.com/aws/aws-nitro-enclaves-nsm-api/blob/main/src/driver/mod.rs#L66
> https://github.com/donkersgoed/aws-nsm-interface/blob/main/aws_nsm_interface/__init__.py#L264-L274
> https://github.com/hf/nsm/blob/main/nsm.go#L99-L129
>
>
> All of these use the (downstream) ioctl that this patch also implements. We
> could change it, but instead of making it easier for user space to adapt the
> device node, it would probably hurt more.
>
> I agree that this is not a great place to be in. This driver absolutely
> should have been upstreamed 3 years ago. But I can't turn back time (yet)
> :).
As you know, this is no excuse to put an api in the kernel that isn't
correct or good for the long-term. Just because people do foolish
things outside of the kernel tree never means we have to accept them in
our tree. Instead we can ask them to fix them properly as part of us
taking the code.
So please, work on doing this right.
thanks,
greg k-h
next prev parent reply other threads:[~2023-09-30 6:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-29 13:33 [PATCH v2 0/2] Add Nitro Secure Module support Alexander Graf
2023-09-29 13:33 ` [PATCH v2 1/2] misc: Add Nitro Secure Module driver Alexander Graf
2023-09-29 17:28 ` Arnd Bergmann
2023-09-29 19:26 ` Alexander Graf
2023-09-30 6:20 ` Greg Kroah-Hartman [this message]
2023-10-02 12:28 ` Alexander Graf
2023-10-03 16:47 ` Arnd Bergmann
2023-10-03 17:48 ` Arnd Bergmann
2023-09-29 13:33 ` [PATCH v2 2/2] hwrng: Add support for Nitro Secure Module Alexander Graf
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=2023093054-swimming-whoopee-7ef8@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=dwmw@amazon.co.uk \
--cc=graf@amazon.com \
--cc=herbert@gondor.apana.org.au \
--cc=jasowang@redhat.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=meydanli@amazon.nl \
--cc=mst@redhat.com \
--cc=olivia@selenic.com \
--cc=petre.eftime@gmail.com \
--cc=xuanzhuo@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox