From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: "Huang, Kai" <kai.huang@intel.com>
Cc: "corbet@lwn.net" <corbet@lwn.net>,
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"shuah@kernel.org" <shuah@kernel.org>,
	"Yu, Guorui" <guorui.yu@linux.alibaba.com>,
	"Luck, Tony" <tony.luck@intel.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"joey.gouly@arm.com" <joey.gouly@arm.com>,
	"dionnaglaze@google.com" <dionnaglaze@google.com>,
	"qinkun@apache.org" <qinkun@apache.org>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Du, Fan" <fan.du@intel.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"wander@redhat.com" <wander@redhat.com>,
	"atishp@rivosinc.com" <atishp@rivosinc.com>,
	"Aktas, Erdem" <erdemaktas@google.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"chongc@google.com" <chongc@google.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	"sathyanarayanan.kuppuswamy@linux.intel.com"
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	"brijesh.singh@amd.com" <brijesh.singh@amd.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"dhowells@redhat.com" <dhowells@redhat.com>
Subject: Re: [PATCH v3 3/3] selftests/tdx: Test GetQuote TDX attestation feature
Date: Wed, 28 Jun 2023 11:02:30 +0200	[thread overview]
Message-ID: <2023062825-rebel-happily-09fd@gregkh> (raw)
In-Reply-To: <e30fb40d736ccc60672316c5d20aaf1ab7c94dcf.camel@intel.com>
On Wed, Jun 28, 2023 at 08:56:30AM +0000, Huang, Kai wrote:
> On Wed, 2023-06-28 at 08:46 +0200, gregkh@linuxfoundation.org wrote:
> > On Wed, Jun 28, 2023 at 02:16:45AM +0000, Huang, Kai wrote:
> > > > You really shouldn't be putting attestation validation logic in the
> > > > kernel.
> > > 
> > > Agreed.  The data blob for remote verification should be just some data blob to
> > > the kernel.  I think the kernel shouldn't even try to understand the data blob
> > > is for which architecture.  From the kernel's perspective, it should be just
> > > some data blob that the kernel gets from hardware/firmware or whatever embedded
> > > in the root-of-trust in the hardware after taking some input from usrspace for
> > > the unique identity of the blob that can be used to, e.g., mitigate replay-
> > > attack, etc.
> > 
> > Great, then use the common "data blob" api that we have in the kernel
> > for a very long time now, the "firwmare download" api, or the sysfs
> > binary file api.  Both of them just use the kernel as a pass-through and
> > do not touch the data at all.  No need for crazy custom ioctls and all
> > that mess :)
> > 
> 
> I guess I was talking about from "kernel shouldn't try to parse attestation data
> blob" perspective.  Looking at AMD's attestation flow (I have no deep
> understanding of AMD's attestation flow), the assumption of "one remote
> verifiable data blob" isn't even true -- AMD can return "attestation report"
> (remote verifiable) and the "certificate" to verify it separately:
> 
> https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snp-attestation.html
> 
> On the other hand, AFAICT Intel SGX-based attestation doesn't have a mechanism
> "for the kernel" to return certificate(s), but choose to embed the
> certificate(s) to the Quote itself.  I believe we can add such mechanism (e.g.,
> another TDVMCALL) for the kernel to get certificate(s) separately, but AFAICT it
> doesn't exist yet.
> 
> Btw, getting "remote verifiable blob" is only one step of the attestation flow.
> For instance, before the blob can be generated, there must be a step to
> establish the attestation key between the machine and the attestation service. 
> And the flow to do this could be very different between vendors too.
> 
> That being said, while I believe all those differences can be unified in some
> way, I think the question is whether it is worth to put such effort to try to
> unify attestation flow for all vendors.  As Erdem Aktas mentioned earlier, "the
> number of CPU vendors for confidential computing seems manageable".
So you think that there should be a custom user/kernel api for every
single different CPU vendor?  That's not how kernel development works,
sorry.  Let's try to unify them to make both the kernel, and userspace,
sane.
And Dan is right, if this is handling keys, then the key subsystem needs
to be used here instead of custom ioctls.
thanks,
greg k-h
next prev parent reply	other threads:[~2023-06-28  9:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1684048511.git.sathyanarayanan.kuppuswamy@linux.intel.com>
     [not found] ` <972e1d5c5ec53e2757fb17a586558c5385e987dd.1684048511.git.sathyanarayanan.kuppuswamy@linux.intel.com>
     [not found]   ` <64876bf6c30e2_1433ac29415@dwillia2-xfh.jf.intel.com.notmuch>
     [not found]     ` <64961c3baf8ce_142af829436@dwillia2-xfh.jf.intel.com.notmuch>
     [not found]       ` <9437b176-e15a-3cec-e5cb-68ff57dbc25c@linux.intel.com>
2023-06-26 18:57         ` [PATCH v3 3/3] selftests/tdx: Test GetQuote TDX attestation feature Dionna Amalie Glaze
2023-06-27  0:39           ` Sathyanarayanan Kuppuswamy
2023-06-28 15:41             ` Samuel Ortiz
2023-06-28 15:55               ` Sathyanarayanan Kuppuswamy
2023-06-28  0:11           ` Dan Williams
2023-06-28  1:36             ` Dionna Amalie Glaze
2023-06-28  2:16               ` Huang, Kai
2023-06-28  6:46                 ` gregkh
2023-06-28  8:56                   ` Huang, Kai
2023-06-28  9:02                     ` gregkh [this message]
2023-06-28  9:45                       ` Huang, Kai
2023-06-28  2:52               ` Dan Williams
2023-06-29 16:25                 ` Dionna Amalie Glaze
2023-06-28 15:31               ` Samuel Ortiz
2023-06-28 15:24             ` Samuel Ortiz
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=2023062825-rebel-happily-09fd@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=atishp@rivosinc.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=chongc@google.com \
    --cc=corbet@lwn.net \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dhowells@redhat.com \
    --cc=dionnaglaze@google.com \
    --cc=erdemaktas@google.com \
    --cc=fan.du@intel.com \
    --cc=guorui.yu@linux.alibaba.com \
    --cc=hpa@zytor.com \
    --cc=joey.gouly@arm.com \
    --cc=kai.huang@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=qinkun@apache.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=wander@redhat.com \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).