Rust SPDM requester proposed for Linux device authentication
Alistair Francis’s v5 series adds a memory-safe SPDM stack and PCIe CMA path so the kernel can treat untrusted device replies as hostile until verified.
Alistair Francis of Western Digital has posted a fifth revision of a large patch series that implements an SPDM requester in Rust for the Linux kernel, aimed at authenticating and attesting hardware before the system trusts it.
SPDM (Security Protocol and Data Model), a DMTF standard, carries authentication, attestation, and key exchange over transports such as PCIe, MCTP, NVMe, and others. From the kernel’s point of view a device stays untrusted until SPDM verification succeeds, so every response is untrusted input from a specification that runs to roughly 200-250 pages. That combination,complex parsing of potentially malicious device data,is exactly the kind of surface where Rust’s stronger guarantees are meant to help.
The series builds a standalone Rust library on Validate and Untrusted traits: responses remain untrusted until validated, then are copied into ordinary Rust structures with endianness fixed up, rather than cast through packed C layouts. Francis argues the copy cost is acceptable because SPDM messages are small and off the hot path, while the payoff is fewer unsafe blocks and fewer panic risks. The work draws on earlier C SPDM work by Lukas Wunner but does not depend on merging that stack.
Alongside the library, the series wires SPDM into PCIe Component Measurement and Authentication (CMA) via a Trusted Security Module-style driver, so CMA-capable devices can be authenticated through the existing TSM probe paths. Related changes broaden the notion of a TSM host beyond TEE/IDE-only devices, cache CMA DOE capability on the PCI device, and add leaf-certificate checks that parse the Subject Alternative Name so the signed identity matches config-space vendor, device, and serial data,limiting certificate misuse without also spoofing configuration space.
Supporting Rust bindings cover kernel hash, asymmetric public-key, and X.509 helpers used by certificate and algorithm negotiation. Basic requester flows in this revision include version and capability exchange, algorithm negotiation, digests, and certificate retrieval. Jonathan Cameron is among those who reviewed the SPDM portions; maintainers listed for the new code include Francis, Wunner, and Cameron, with coverage aimed at confidential-computing, CXL, and PCI audiences.
If merged, the work would give Linux a memory-safe path to refuse trust in PCIe and related devices until SPDM authentication completes, tightening the hand-off between untrusted silicon and the rest of the system.