securityfs-secrets-coco 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. What: security/secrets/coco
  2. Date: February 2022
  3. Contact: Dov Murik <[email protected]>
  4. Description:
  5. Exposes confidential computing (coco) EFI secrets to
  6. userspace via securityfs.
  7. EFI can declare memory area used by confidential computing
  8. platforms (such as AMD SEV and SEV-ES) for secret injection by
  9. the Guest Owner during VM's launch. The secrets are encrypted
  10. by the Guest Owner and decrypted inside the trusted enclave,
  11. and therefore are not readable by the untrusted host.
  12. The efi_secret module exposes the secrets to userspace. Each
  13. secret appears as a file under <securityfs>/secrets/coco,
  14. where the filename is the GUID of the entry in the secrets
  15. table. This module is loaded automatically by the EFI driver
  16. if the EFI secret area is populated.
  17. Two operations are supported for the files: read and unlink.
  18. Reading the file returns the content of secret entry.
  19. Unlinking the file overwrites the secret data with zeroes and
  20. removes the entry from the filesystem. A secret cannot be read
  21. after it has been unlinked.
  22. For example, listing the available secrets::
  23. # modprobe efi_secret
  24. # ls -l /sys/kernel/security/secrets/coco
  25. -r--r----- 1 root root 0 Jun 28 11:54 736870e5-84f0-4973-92ec-06879ce3da0b
  26. -r--r----- 1 root root 0 Jun 28 11:54 83c83f7f-1356-4975-8b7e-d3a0b54312c6
  27. -r--r----- 1 root root 0 Jun 28 11:54 9553f55d-3da2-43ee-ab5d-ff17f78864d2
  28. -r--r----- 1 root root 0 Jun 28 11:54 e6f5a162-d67f-4750-a67c-5d065f2a9910
  29. Reading the secret data by reading a file::
  30. # cat /sys/kernel/security/secrets/coco/e6f5a162-d67f-4750-a67c-5d065f2a9910
  31. the-content-of-the-secret-data
  32. Wiping a secret by unlinking a file::
  33. # rm /sys/kernel/security/secrets/coco/e6f5a162-d67f-4750-a67c-5d065f2a9910
  34. # ls -l /sys/kernel/security/secrets/coco
  35. -r--r----- 1 root root 0 Jun 28 11:54 736870e5-84f0-4973-92ec-06879ce3da0b
  36. -r--r----- 1 root root 0 Jun 28 11:54 83c83f7f-1356-4975-8b7e-d3a0b54312c6
  37. -r--r----- 1 root root 0 Jun 28 11:54 9553f55d-3da2-43ee-ab5d-ff17f78864d2
  38. Note: The binary format of the secrets table injected by the
  39. Guest Owner is described in
  40. drivers/virt/coco/efi_secret/efi_secret.c under "Structure of
  41. the EFI secret area".