Re: TDISP enablement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Cameron wrote:
> On Wed, 1 Nov 2023 08:27:17 +0100
> Lukas Wunner <lukas@xxxxxxxxx> wrote:
> 
> Thanks Alexy, this is a great discussion to kick off.
> 
> > On Wed, Nov 01, 2023 at 09:56:11AM +1100, Alexey Kardashevskiy wrote:
> > > - device_connect - starts CMA/SPDM session, returns measurements/certs,
> > > runs IDE_KM to program the keys;  
> > 
> > Does the PSP have a set of trusted root certificates?
> > If so, where does it get them from?
> > 
> > If not, does the PSP just blindly trust the validity of the cert chain?
> > Who validates the cert chain, and when?
> > Which slot do you use?
> > Do you return only the cert chain of that single slot or of all slots?
> > Does the PSP read out all measurements available?  This may take a while
> > if the measurements are large and there are a lot of them.
> 
> I'd definitely like their to be a path for certs and measurement to be
> checked by the Host OS (for the non TDISP path). Whether the
> policy setup cares about result is different question ;)
> 
> > 
> > 
> > > - tdi_info - read measurements/certs/interface report;  
> > 
> > Does this return cached cert chains and measurements from the device
> > or does it retrieve them anew?  (Measurements might have changed if
> > MEAS_FRESH_CAP is supported.)
> > 
> > 
> > > If the user wants only CMA/SPDM, the Lukas'es patched will do that without
> > > the PSP. This may co-exist with the AMD PSP (if the endpoint allows multiple
> > > sessions).  
> > 
> > It can co-exist if the pci_cma_claim_ownership() library call
> > provided by patch 12/12 is invoked upon device_connect.
> > 
> > It would seem advantageous if you could delay device_connect
> > until a device is actually passed through.  Then the OS can
> > initially authenticate and measure devices and the PSP takes
> > over when needed.
> 
> Would that delay mean IDE isn't up - I think that wants to be
> available whether or not pass through is going on.
> 
> Given potential restrictions on IDE resources, I'd expect to see an explicit
> opt in from userspace on the host to start that process for a given
> device.  (udev rule or similar might kick it off for simple setups).
> 
> Would that work for the flows described?  
> 
> Next bit probably has holes...  Key is that a lot of the checks
> may fail, and it's up to host userspace policy to decide whether
> to proceed (other policy in the secure VM side of things obviously)
> 
> So my rough thinking is - for the two options (IDE / TDISP)
> 
> Comparing with Alexey's flow I think only real difference is that
> I call out explicit host userspace policy controls. I'd also like
> to use similar interfaces to convey state to host userspace as
> per Lukas' existing approaches.  Sure there will also be in
> kernel interfaces for driver to get data if it knows what to do
> with it.  I'd also like to enable the non tdisp flow to handle
> IDE setup 'natively' if that's possible on particular hardware.

Are there any platforms that have IDE host capability that are not also
shipping a TSM. I know that some platform allow for either the TSM or
the OS to own that setup, but there are no standards there. I am not
opposed to the native path, but given a cross-vendor "TSM" concept is
needed and that a TSM is likely available on all IDE capable platforms
it seems reasonable for Linux to rely on TSM managed IDE for the near
term if not the long term as well.

> 
> 1. Host has a go at CMA/SPDM. Policy might say that a failure here is
>    a failure in general so reject device - or it might decide it's up to
>    the PSP etc.   (userspace can see if it succeeded)
>    I'd argue host software can launch this at any time.  It will
>    be a denial of service attack but so are many other things the host
>    can do.
> 2. TDISP policy decision from host (userspace policy control)
>    Need to know end goal.

If the TSM owns the TDISP state what this policy decision rely comes
down to is IDE stream resource management, I otherwise struggle to
conceptualize "TDISP policy".

The policy is userspace deciding to assign an interface to a TVM, and
that TVM requests that the assigned interface be allowed to access
private memory. So it's not necessarily TDISP policy, its assigned
interface is allowed to transition to private operation.

> 3. IDE opt in from userspace.  Policy decision.
>   - If not TDISP 
>     - device_connect(IDE ONLY) - bunch of proxying in host OS.
>     - Cert chain and measurements presented to host, host can then check if
>       it is happy and expose for next policy decision.
>     - Hooks exposed for host to request more measurements, key refresh etc.
>       Idea being that the flow is host driven with PSP providing required
>       services.  If host can just do setup directly that's fine too.
>   - If TDISP (technically you can run tdisp from host, but lets assume
>     for now no one wants to do that? (yet)).
>     - device_connect(TDISP) - bunch of proxying in host OS.
>     - Cert chain and measurements presented to host, host can then check if
>       it is happy and expose for next policy decision.
> 
> 4. Flow after this depends on early or late binding (lockdown)
>    but could load driver at this point.  Userspace policy.
>    tdi-bind etc.

It is valid to load the driver and operate the device in shared mode, so
I am not sure that acceptance should gate driver loading. It also seems
like something that could be managed with module policy if someone
wanted to prevent shared operation before acceptance.

[..]
> > > The next steps:
> > > - expose blobs via configfs (like Dan did configfs-tsm);

I am missing the context here, but for measurements I think those are
better in sysfs. configs was only to allow for multiple containers to grab
attestation reports, measurements are device local and containers can
all see the same measurements.

> > > - s/tdisp.ko/coco.ko/;

My bikeshed contribution, perhaps tsm.ko? I am still not someone who can
say "coco" for confidential computing with a straight face.

> > > - ask the audience - what is missing to make it reusable for other vendors
> > > and uses?  
> > 
> > I intend to expose measurements in sysfs in a measurements/ directory
> > below each CMA-capable device's directory.  There are products coming
> > to the market which support only CMA and are not interested in IDE or
> > TISP.  When bringing up TDISP, measurements received as part of an
> > interface report must be exposed in the same way so that user space
> > tooling which evaluates the measurememt works both with TEE-IO capable
> > and incapable products.  This could be achieved by fetching measurements
> > from the interface report instead of via SPDM when TDISP is in use.
> 
> Absolutely agree on this and superficially it feels like this should not
> be hard to hook up.
> 
> There will also be paths where a driver wants to see the measurement report
> but that should also be easy enough to enable.

Agree.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux