Skip to content

Commit 70e6f7e

Browse files
committed
configfs-tsm: Introduce a shared ABI for attestation reports
One of the common operations of a TSM (Trusted Security Module) is to provide a way for a TVM (confidential computing guest execution environment) to take a measurement of its launch state, sign it and submit it to a verifying party. Upon successful attestation that verifies the integrity of the TVM additional secrets may be deployed. The concept is common across TSMs, but the implementations are unfortunately vendor specific. While the industry grapples with a common definition of this attestation format [1], Linux need not make this problem worse by defining a new ABI per TSM that wants to perform a similar operation. The current momentum has been to invent new ioctl-ABI per TSM per function which at best is an abdication of the kernel's responsibility to make common infrastructure concepts share common ABI. The proposal, targeted to conceptually work with TDX, SEV-SNP, COVE if not more, is to define a configfs interface to retrieve the TSM-specific blob. report=/sys/kernel/config/tsm/report/report0 mkdir $report dd if=binary_userdata_plus_nonce > $report/inblob hexdump $report/outblob This approach later allows for the standardization of the attestation blob format without needing to invent a new ABI. Once standardization happens the standard format can be emitted by $report/outblob and indicated by $report/provider, or a new attribute like "$report/tcg_coco_report" can emit the standard format alongside the vendor format. Review of previous iterations of this interface identified that there is a need to scale report generation for multiple container environments [2]. Configfs enables a model where each container can bind mount one or more report generation item instances. Still, within a container only a single thread can be manipulating a given configuration instance at a time. A 'generation' count is provided to detect conflicts between multiple threads racing to configure a report instance. The SEV-SNP concepts of "extended reports" and "privilege levels" are optionally enabled by selecting 'tsm_report_ext_type' at register_tsm() time. The expectation is that those concepts are generic enough that they may be adopted by other TSM implementations. In other words, configfs-tsm aims to address a superset of TSM specific functionality with a common ABI where attributes may appear, or not appear, based on the set of concepts the implementation supports. Link: http://lore.kernel.org/r/64961c3baf8ce_142af829436@dwillia2-xfh.jf.intel.com.notmuch [1] Link: http://lore.kernel.org/r/57f3a05e-8fcd-4656-beea-56bb8365ae64@linux.microsoft.com [2] Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Cc: Dionna Amalie Glaze <dionnaglaze@google.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Peter Gonda <pgonda@google.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Samuel Ortiz <sameo@rivosinc.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Tested-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent ec51ffc commit 70e6f7e

File tree

6 files changed

+590
-0
lines changed

6 files changed

+590
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
What: /sys/kernel/config/tsm/report/$name/inblob
2+
Date: September, 2023
3+
KernelVersion: v6.7
4+
Contact: linux-coco@lists.linux.dev
5+
Description:
6+
(WO) Up to 64 bytes of user specified binary data. For replay
7+
protection this should include a nonce, but the kernel does not
8+
place any restrictions on the content.
9+
10+
What: /sys/kernel/config/tsm/report/$name/outblob
11+
Date: September, 2023
12+
KernelVersion: v6.7
13+
Contact: linux-coco@lists.linux.dev
14+
Description:
15+
(RO) Binary attestation report generated from @inblob and other
16+
options The format of the report is implementation specific
17+
where the implementation is conveyed via the @provider
18+
attribute.
19+
20+
What: /sys/kernel/config/tsm/report/$name/auxblob
21+
Date: October, 2023
22+
KernelVersion: v6.7
23+
Contact: linux-coco@lists.linux.dev
24+
Description:
25+
(RO) Optional supplemental data that a TSM may emit, visibility
26+
of this attribute depends on TSM, and may be empty if no
27+
auxiliary data is available.
28+
29+
When @provider is "sev_guest" this file contains the
30+
"cert_table" from SEV-ES Guest-Hypervisor Communication Block
31+
Standardization v2.03 Section 4.1.8.1 MSG_REPORT_REQ.
32+
https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/56421.pdf
33+
34+
What: /sys/kernel/config/tsm/report/$name/provider
35+
Date: September, 2023
36+
KernelVersion: v6.7
37+
Contact: linux-coco@lists.linux.dev
38+
Description:
39+
(RO) A name for the format-specification of @outblob like
40+
"sev_guest" [1] or "tdx_guest" [2] in the near term, or a
41+
common standard format in the future.
42+
43+
[1]: SEV Secure Nested Paging Firmware ABI Specification
44+
Revision 1.55 Table 22
45+
https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/56860.pdf
46+
47+
[2]: Intel® Trust Domain Extensions Data Center Attestation
48+
Primitives : Quote Generation Library and Quote Verification
49+
Library Revision 0.8 Appendix 4,5
50+
https://download.01.org/intel-sgx/latest/dcap-latest/linux/docs/Intel_TDX_DCAP_Quoting_Library_API.pdf
51+
52+
What: /sys/kernel/config/tsm/report/$name/generation
53+
Date: September, 2023
54+
KernelVersion: v6.7
55+
Contact: linux-coco@lists.linux.dev
56+
Description:
57+
(RO) The value in this attribute increments each time @inblob or
58+
any option is written. Userspace can detect conflicts by
59+
checking generation before writing to any attribute and making
60+
sure the number of writes matches expectations after reading
61+
@outblob, or it can prevent conflicts by creating a report
62+
instance per requesting context.
63+
64+
What: /sys/kernel/config/tsm/report/$name/privlevel
65+
Date: September, 2023
66+
KernelVersion: v6.7
67+
Contact: linux-coco@lists.linux.dev
68+
Description:
69+
(WO) Attribute is visible if a TSM implementation provider
70+
supports the concept of attestation reports for TVMs running at
71+
different privilege levels, like SEV-SNP "VMPL", specify the
72+
privilege level via this attribute. The minimum acceptable
73+
value is conveyed via @privlevel_floor and the maximum
74+
acceptable value is TSM_PRIVLEVEL_MAX (3).
75+
76+
What: /sys/kernel/config/tsm/report/$name/privlevel_floor
77+
Date: September, 2023
78+
KernelVersion: v6.7
79+
Contact: linux-coco@lists.linux.dev
80+
Description:
81+
(RO) Indicates the minimum permissible value that can be written
82+
to @privlevel.

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21889,6 +21889,14 @@ W: https://github.com/srcres258/linux-doc
2188921889
T: git git://github.com/srcres258/linux-doc.git doc-zh-tw
2189021890
F: Documentation/translations/zh_TW/
2189121891

21892+
TRUSTED SECURITY MODULE (TSM) ATTESTATION REPORTS
21893+
M: Dan Williams <dan.j.williams@intel.com>
21894+
L: linux-coco@lists.linux.dev
21895+
S: Maintained
21896+
F: Documentation/ABI/testing/configfs-tsm
21897+
F: drivers/virt/coco/tsm.c
21898+
F: include/linux/tsm.h
21899+
2189221900
TTY LAYER AND SERIAL DRIVERS
2189321901
M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2189421902
M: Jiri Slaby <jirislaby@kernel.org>

drivers/virt/coco/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
#
33
# Confidential computing related collateral
44
#
5+
6+
config TSM_REPORTS
7+
select CONFIGFS_FS
8+
tristate
9+
510
source "drivers/virt/coco/efi_secret/Kconfig"
611

712
source "drivers/virt/coco/sev-guest/Kconfig"

drivers/virt/coco/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# Confidential computing related collateral
44
#
5+
obj-$(CONFIG_TSM_REPORTS) += tsm.o
56
obj-$(CONFIG_EFI_SECRET) += efi_secret/
67
obj-$(CONFIG_SEV_GUEST) += sev-guest/
78
obj-$(CONFIG_INTEL_TDX_GUEST) += tdx-guest/

0 commit comments

Comments
 (0)