From: Jason Gunthorpe <jgg@nvidia.com>
To: "Reshetova, Elena" <elena.reshetova@intel.com>
Cc: "Jiang, Dave" <dave.jiang@intel.com>,
Xu Yilun <yilun.xu@linux.intel.com>,
"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
Jiri Pirko <jiri@resnulli.us>,
"Tian, Kevin" <kevin.tian@intel.com>,
Alexey Kardashevskiy <aik@amd.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Steven Price <steven.price@arm.com>,
Kiryl Shutsemau <kas@kernel.org>,
"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Jonathan Cameron <jic23@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Ashish Kalra <ashish.kalra@amd.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
John Allen <john.allen@amd.com>, Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
"patches@lists.linux.dev" <patches@lists.linux.dev>
Subject: Re: [RFC PATCH v1 10/11] virt: coco: arm-cca-host: Publish slot zero and establish streams after acceptance
Date: Wed, 11 Nov 2026 10:13:15 -0400 [thread overview]
Message-ID: <20261111141315.GI738765@nvidia.com> (raw)
In-Reply-To: <DS4PPFA84FA90FC31803C37BDCA2C11FCFCE7712@DS4PPFA84FA90FC.namprd11.prod.outlook.com>
On Wed, Nov 11, 2026 at 01:09:43PM +0000, Reshetova, Elena wrote:
> >
> > On Tue, Nov 10, 2026 at 01:15:06PM +0000, Reshetova, Elena wrote:
> > >
> > > > On Mon, Nov 09, 2026 at 01:54:57PM -0700, Dave Jiang wrote:
> > > > > > Why? Seems like another wasted operation..
> > > > >
> > > > > The TDX module runs it as part of the connect and with the current
> > > > > module the host can't skip it. I'll discuss with Elena and see if
> > > > > this can be different.
> > > >
> > > > Does it come out anywhere and become visible to the host or guest?
> > >
> > > Yes, it is visible to the host kernel as part of the initially returned
> > > SPDM_DEVICE_ATTESTATION_INFO_T structure. The guest can get the
> > > reference hash of this structure from the TDX Module/TSM.
> >
> > That's security broken.
> >
> > The guest must never see a measurement from *before* the guest did
> > LOCKED.
>
> While I also personally prefer to do measurement checks after LOCK
> (being a security person, you tend to be pessimistic and require strictest),
> I dont think anything in TDSIP standard says that LOCK formally affects
> measurements. The measurements tell what device/firmware is.
> It is the TDI report that tells it how this particular TDI has
> been configured and locked for assignment.
No, LOCK says the hypervisor can no longer tamper with the device. It
revokes hypervisor access to MMIO registers. Taking a measurement and
then allowing the hypervisor change measured state via MMIO is
entirely security unacceptable.
Exactly how LOCKED works is device specific, but from a security POV
the device must implement LOCKED in a way that excludes a malicious
hypervisor from undetectably tampering with the device.
This is not statement about device firmware integrity, but about the
device *runtime* state.
For example, if the hypervisor tells the device to do a DMA write
after 1 second and then the guest attests and accepts this device
while that command is active, all guest security is lost.
The device's security design is responsible to prevent these kinds of
attacks one way or another. LOCKED is a key part of how the device can
do that.
Broadly there are three device implementation options:
1) A TDISP device MMIO is simply entirely inoperable by hypervisor and
only works under locked. Trivial
2) Entry to LOCKED cleans the device so it is quieted down enough to
be safe
3) Measurements record if the hypervisor did anything with the device
before it was LOCKED.
We cannot know what kind of device we have so the OS must always
collect fresh evidence to support option #3. Or at the very least the
verifier must be aware the evidence is pre-locked and stale.
> Again, you establish a trust in a device at the time of SPDM
> connect.
This only establishes a tunnel to device firmware. It says nothing
about what the device is doing.
The CC locked/measure dance is establishing what the device is doing
at the moment it is allowed to be dma enabled'd.
> Guest can inspect VCA and the cert chain for selected SPDM authentication
> slot that was fixed during SPDM connect and decide whenever it trusts
> this device or not. This decision *might* require to know what are device
> measurements at the time of connect also. This can be needed if guest's
> trust in this device depends on its current measurements, i.e. I trust
> device A with a key B certified by a trusted intermediate C but only if
> its firmware measurement SVN is higher than 12 (because I am aware
> that device manufacturer reported a critical security bug in SVN 11).
> If all these connect time checks are satisfied, guest can trust the device
> *given that manufacturer specified that runtime downgrades of SVN are
> not allowed* not to downgrade its measurements between SPDM connect
> and LOCK, moreover it can trust the device not to downgrade measurements
> while it stays alive (and while corresponding SPDM session stays alive).
> So, the fact that SPDM session stays alive in this case would also guarantee
> security.
> Do you see the logic in this reasoning?
IMHO you have focused too much on the device firmware state and not
enough on the runtime state and the impacts the host can have over the
device while its MMIO is under the control of the hypervisor.
> > The entire security argument of the guest is that it locks the device
> > so the host cannot tamper with it. Collects a post-lock measurement to
> > show what state it is in after locking, then makes a policy decision.
>
> Formally measurements of the device can change even after LOCK if you
> dont explicitly forbid this via LOCK_REQUEST flags.
Yes, but this is something else entirely. We told the device it is
LOCKED so it activates all its defenses against hypervisor
tampering. We take a clean measurement to prove the hypervisor hasn't
left anything behind in the run time state. Now we trust the device
itself to only alow measurment changes that meet its own security
model and the hypervisor cannot interfere. (bugs excluded)
> > Capturing a measurement at SPDM session startup, while in unlocked, and
> > then using TDX module to trick the guest into accepting it as a
> > post-locked measurement is *entirely* unacceptable and I will oppose
> > anything like that in Linux.
>
> There is no tricking, it is specified in TDX that these measurements are for
> SPDM.Connect time and not after LOCK. And if you want to have later
> measurements, then you must use recollection functionality.
I'm am feeling against even exposing early unlocked measurements to
userspace, given how dangerous it could be to ever rely on them.
> > The guest must be able to affimitively say that a fresh measurement
> > was collected after locked and when it gets the reference hash it
> > needs to know it is fresh after locking.
>
> If it wants this, then it must do recollection and we provide this
> functionality. What is missing from this currently is TDX module does
> not refresh the reference hash because the assumption currently
> is that the same key must be used to sign recollection measurements
> that was seen during SPDM connect (and protected by a reference
> hash).
I pointed this out already, this is obviously very bad. Loosing the
direct binding to the SPDM session is a significant security
degradation compared to every other architecture for no purpose.
Updating the digest means that the guest nonce ends up being captured
by the hypervisor and presented to the next VM as the 'initial'
connection measurement. This does not seem like a good choice to me.
ARM's VM boot time mode selection of 'TSM controls nonce' or 'guest
controls nonce' works better, IMHO.
But two digests 'initial' and 'latest this guest collected' might be
the better option.
Jason
next prev parent reply other threads:[~2026-11-11 14:13 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 15:26 [RFC PATCH v1 00/11] PCI/TSM: Add CTLV attestation Aneesh Kumar K.V (Arm)
2026-10-28 15:26 ` [RFC PATCH v1 01/11] attestation: Restrict inherited operations per instance Aneesh Kumar K.V (Arm)
2026-10-30 13:29 ` Jiri Pirko
2026-10-28 15:26 ` [RFC PATCH v1 02/11] attestation: Filter evidence objects " Aneesh Kumar K.V (Arm)
2026-10-30 13:44 ` Jiri Pirko
2026-10-31 6:24 ` Aneesh Kumar K.V
2026-11-02 19:14 ` Jiri Pirko
2026-10-28 15:26 ` [RFC PATCH v1 03/11] attestation: Enter secure operation when evidence is accepted Aneesh Kumar K.V (Arm)
2026-10-30 13:51 ` Jiri Pirko
2026-10-30 15:36 ` Jason Gunthorpe
2026-10-31 4:09 ` Aneesh Kumar K.V
2026-11-02 11:28 ` Jiri Pirko
2026-10-28 15:26 ` [RFC PATCH v1 04/11] attestation: Bind object selection to accepted evidence snapshots Aneesh Kumar K.V (Arm)
2026-10-28 15:26 ` [RFC PATCH v1 05/11] attestation: Make the evidence-get challenge attribute optional Aneesh Kumar K.V (Arm)
2026-10-28 15:26 ` [RFC PATCH v1 06/11] PCI/TSM: Describe the PCI attestation control family Aneesh Kumar K.V (Arm)
2026-10-30 14:01 ` Jiri Pirko
2026-10-30 15:43 ` Jason Gunthorpe
2026-11-02 12:45 ` Jiri Pirko
2026-11-03 15:45 ` Jason Gunthorpe
2026-11-04 9:21 ` Jiri Pirko
2026-11-04 14:00 ` Jason Gunthorpe
2026-10-31 4:05 ` Aneesh Kumar K.V
2026-11-02 11:50 ` Jiri Pirko
2026-11-03 15:35 ` Jason Gunthorpe
2026-10-31 4:22 ` Aneesh Kumar K.V
2026-11-02 11:30 ` Jiri Pirko
2026-11-03 15:39 ` Jason Gunthorpe
2026-10-28 15:26 ` [RFC PATCH v1 07/11] attestation: Add attestation helpers for PCI/TSM integration Aneesh Kumar K.V (Arm)
2026-10-28 15:26 ` [RFC PATCH v1 08/11] PCI/TSM: Bind CTLV attestation to connected and locked contexts Aneesh Kumar K.V (Arm)
2026-10-28 22:56 ` Dave Jiang
2026-10-29 5:30 ` Aneesh Kumar K.V
2026-10-29 12:41 ` Jason Gunthorpe
2026-10-30 14:04 ` Jiri Pirko
2026-10-30 14:08 ` Jiri Pirko
2026-10-30 15:39 ` Jason Gunthorpe
2026-11-02 12:11 ` Jiri Pirko
2026-11-03 15:41 ` Jason Gunthorpe
2026-10-28 15:26 ` [RFC PATCH v1 09/11] crypto/ccp: Defer SEV-TIO link setup until evidence acceptance Aneesh Kumar K.V (Arm)
2026-11-06 7:47 ` Alexey Kardashevskiy
2026-11-06 13:14 ` Aneesh Kumar K.V
2026-11-06 14:21 ` Jason Gunthorpe
2026-11-09 10:03 ` Alexey Kardashevskiy
2026-10-28 15:26 ` [RFC PATCH v1 10/11] virt: coco: arm-cca-host: Publish slot zero and establish streams after acceptance Aneesh Kumar K.V (Arm)
2026-10-29 16:56 ` Dave Jiang
2026-10-29 17:10 ` Jason Gunthorpe
2026-10-30 9:58 ` Reshetova, Elena
2026-10-30 13:15 ` Jason Gunthorpe
2026-10-31 3:47 ` Aneesh Kumar K.V
2026-11-02 10:11 ` Reshetova, Elena
2026-11-02 17:26 ` Jason Gunthorpe
2026-11-03 12:01 ` Reshetova, Elena
2026-11-03 15:16 ` Jason Gunthorpe
2026-11-04 8:03 ` Xu Yilun
2026-11-04 9:49 ` Reshetova, Elena
2026-11-04 13:41 ` Jason Gunthorpe
2026-11-04 16:54 ` Dave Jiang
2026-11-06 15:53 ` Dave Jiang
2026-11-06 19:30 ` Jason Gunthorpe
2026-11-06 22:39 ` Dave Jiang
2026-11-08 18:33 ` Jason Gunthorpe
2026-11-09 10:55 ` Reshetova, Elena
2026-11-09 13:47 ` Jason Gunthorpe
2026-11-09 17:37 ` Dave Jiang
2026-11-09 18:53 ` Jason Gunthorpe
2026-11-09 20:54 ` Dave Jiang
2026-11-09 23:40 ` Jason Gunthorpe
2026-11-10 13:15 ` Reshetova, Elena
2026-11-10 14:20 ` Jason Gunthorpe
2026-11-11 13:09 ` Reshetova, Elena
2026-11-11 14:13 ` Jason Gunthorpe [this message]
2026-11-10 1:40 ` Alistair
2026-11-10 15:07 ` Jason Gunthorpe
2026-11-10 5:32 ` Alexey Kardashevskiy
2026-11-10 12:52 ` Jason Gunthorpe
2026-11-11 9:03 ` Alexey Kardashevskiy
2026-11-10 20:07 ` Jason Gunthorpe
2026-11-04 9:03 ` Reshetova, Elena
2026-11-04 13:48 ` Jason Gunthorpe
2026-11-06 8:24 ` Aneesh Kumar K.V
2026-11-06 12:49 ` Reshetova, Elena
2026-11-06 15:53 ` Aneesh Kumar K.V
2026-11-06 18:54 ` Jason Gunthorpe
2026-11-03 16:31 ` Aneesh Kumar K.V
2026-11-03 17:56 ` Jason Gunthorpe
2026-11-02 10:05 ` Reshetova, Elena
2026-11-02 10:22 ` Reshetova, Elena
2026-11-02 17:37 ` Jason Gunthorpe
2026-10-28 15:26 ` [RFC PATCH v1 11/11] virt: coco: arm-cca-guest: Refresh selected evidence against trusted digests Aneesh Kumar K.V (Arm)
2026-10-30 12:34 ` [RFC PATCH v1 00/11] PCI/TSM: Add CTLV attestation Xu Yilun
2026-10-30 15:32 ` Jason Gunthorpe
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=20261111141315.GI738765@nvidia.com \
--to=jgg@nvidia.com \
--cc=aik@amd.com \
--cc=aneesh.kumar@kernel.org \
--cc=ashish.kalra@amd.com \
--cc=bhelgaas@google.com \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=dave.jiang@intel.com \
--cc=elena.reshetova@intel.com \
--cc=jic23@kernel.org \
--cc=jiri@resnulli.us \
--cc=john.allen@amd.com \
--cc=kas@kernel.org \
--cc=kevin.tian@intel.com \
--cc=linux-coco@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=patches@lists.linux.dev \
--cc=rick.p.edgecombe@intel.com \
--cc=steven.price@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=thomas.lendacky@amd.com \
--cc=will@kernel.org \
--cc=yilun.xu@linux.intel.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