canonical / tdx

Intel confidential computing - TDX
GNU General Public License v3.0
97 stars 39 forks source link

tdx_att_get_quote failure #220

Closed oriordain-s closed 1 month ago

oriordain-s commented 1 month ago

Describe the support request Executing on a TDX VM on a Preview Instance within DevCloud, am seeing that the test_tdx_attest program is returning a failure from the tax_att_get_quote function. Any insights appreciated.

While running that inside the VM, on the host the qgsd service repeats the following (4 in all):

Sep 13 10:29:42 b49691f5da8c qgsd[335944]: Added a new connection, now [1]
Sep 13 10:29:42 b49691f5da8c qgsd[335944]: handle read header, status [system:0]
Sep 13 10:29:42 b49691f5da8c qgsd[335944]: Got header!
Sep 13 10:29:42 b49691f5da8c qgsd[335944]: body should be [-2130706432] bytes!
Sep 13 10:30:12 b49691f5da8c qgsd[335944]: handle read body status [asio.misc:2]
Sep 13 10:30:12 b49691f5da8c qgsd[335944]: timeout
Sep 13 10:30:12 b49691f5da8c qgsd[335944]: About to shutdown and close socket
Sep 13 10:30:12 b49691f5da8c qgsd[335944]: erased a connection, now [0]

Many thanks.

System report Please run the system-report.sh script (located in the root directory of this repo) on your host system and copy the output below.

Git ref

8c02daa87963281947e1d944b5d28a5ef148ce81

Operating system details

Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:    24.04
Codename:   noble

Kernel version

6.8.0-1008-intel #15-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 12 09:47:38 UTC 2024 x86_64 x86_64 GNU/Linux

TDX kernel logs

[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.8.0-1008-intel root=UUID=cb735d25-09f9-4618-861b-a24d9bf6567a ro kvm_intel.tdx=1 nohibernate nomodeset
[    1.245782] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.8.0-1008-intel root=UUID=cb735d25-09f9-4618-861b-a24d9bf6567a ro kvm_intel.tdx=1 nohibernate nomodeset
[    2.505650] virt/tdx: BIOS enabled: private KeyID range [16, 32)
[    2.505652] virt/tdx: Disable ACPI S3. Turn off TDX in the BIOS to use ACPI S3.
[    2.566377] smpboot: CPU0: Intel(R) Xeon(R) Platinum 8480CTDX (family: 0x6, model: 0x8f, stepping: 0x8)
[    9.569062] virt/tdx: TDX module: attributes 0x0, vendor_id 0x8086, major_version 1, minor_version 5, build_date 20240129, build_num 698
[    9.569066] virt/tdx: CMR: [0x100000, 0x77800000)
[    9.569067] virt/tdx: CMR: [0x100000000, 0x205e000000)
[    9.569068] virt/tdx: CMR: [0x2080000000, 0x4060000000)
[    9.569069] virt/tdx: CMR: [0x4080000000, 0x6060000000)
[    9.569069] virt/tdx: CMR: [0x6080000000, 0x8060000000)
[   11.070756] virt/tdx: 2101268 KB allocated for PAMT
[   11.070762] virt/tdx: module initialized

TDX CPU instruction support

CPU supports TDX according to /proc/cpuinfo

Model specific registers (MSRs)

MK_TME_ENABLED bit: 1 (expected value: 1)
SEAM_RR bit: 1 (expected value: 1)
NUM_TDX_PRIV_KEYS: 10
SGX_AND_MCHECK_STATUS: 0 (expected value: 0)
Production platform: Production (expected value: Production)

CPU details

 Intel(R) Xeon(R) Platinum 8480CTDX

QEMU package details

Status: Installed
Package: qemu-system-x86
Version: 1:8.2.2+ds-0ubuntu2+tdx1.0
APT-Sources: https://ppa.launchpadcontent.net/kobuk-team/tdx-release/ubuntu noble/main amd64 Packages

Libvirt package details

Status: Installed
Package: libvirt-clients
Version: 10.0.0-2ubuntu8.3+tdx1.1
APT-Sources: https://ppa.launchpadcontent.net/kobuk-team/tdx-release/ubuntu noble/main amd64 Packages

OVMF package details

Status: Installed
Package: ovmf
Version: 2024.02-3+tdx1.0
APT-Sources: https://ppa.launchpadcontent.net/kobuk-team/tdx-release/ubuntu noble/main amd64 Packages

sgx-dcap-pccs package details

Status: Installed
Package: sgx-dcap-pccs
Version: 1.20-0ubuntu1
APT-Sources: /var/lib/dpkg/status

tdx-qgs package details

Status: Installed
Package: tdx-qgs
Version: 1.20-0ubuntu1
APT-Sources: /var/lib/dpkg/status

sgx-ra-service package details

Status: Installed
Package: sgx-ra-service
Version: 1.20-0ubuntu1
APT-Sources: /var/lib/dpkg/status
Description: Intel(R) Software Guard Extensions Multi-Package Registration Agent Service

sgx-pck-id-retrieval-tool package details

Status: Installed
Package: sgx-pck-id-retrieval-tool
Version: 1.20-0ubuntu1
APT-Sources: /var/lib/dpkg/status

QGSD service status

● qgsd.service - Intel(R) TD Quoting Generation Service
     Loaded: loaded (/usr/lib/systemd/system/qgsd.service; enabled; preset: enabled)
     Active: active (running) since Fri 2024-09-13 10:18:58 UTC; 5h 27min ago
    Process: 335923 ExecStartPre=/usr/share/qgs/linksgx.sh (code=exited, status=0/SUCCESS)
    Process: 335941 ExecStart=/usr/bin/qgs (code=exited, status=0/SUCCESS)
   Main PID: 335944 (qgs)
      Tasks: 5 (limit: 616045)
     Memory: 636.0K (peak: 2.0G)
        CPU: 17.498s
     CGroup: /system.slice/qgsd.service
             └─335944 /usr/bin/qgs

Sep 13 13:29:20 b49691f5da8c qgsd[335944]: About to shutdown and close socket
Sep 13 13:29:20 b49691f5da8c qgsd[335944]: erased a connection, now [0]
Sep 13 13:29:21 b49691f5da8c qgsd[335944]: Added a new connection, now [1]
Sep 13 13:29:21 b49691f5da8c qgsd[335944]: handle read header, status [system:0]
Sep 13 13:29:21 b49691f5da8c qgsd[335944]: Got header!
Sep 13 13:29:21 b49691f5da8c qgsd[335944]: body should be [-2130706432] bytes!
Sep 13 13:29:51 b49691f5da8c qgsd[335944]: handle read body status [asio.misc:2]
Sep 13 13:29:51 b49691f5da8c qgsd[335944]: timeout
Sep 13 13:29:51 b49691f5da8c qgsd[335944]: About to shutdown and close socket
Sep 13 13:29:51 b49691f5da8c qgsd[335944]: erased a connection, now [0]

PCCS service status

● pccs.service - Provisioning Certificate Caching Service (PCCS)
     Loaded: loaded (/usr/lib/systemd/system/pccs.service; enabled; preset: enabled)
     Active: active (running) since Fri 2024-09-13 10:45:30 UTC; 5h 1min ago
       Docs: https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/master/QuoteGeneration/pccs/README.md
   Main PID: 336658 (node)
      Tasks: 15 (limit: 616045)
     Memory: 49.9M (peak: 61.9M)
        CPU: 1.664s
     CGroup: /system.slice/pccs.service
             └─336658 /usr/bin/node /opt/intel/sgx-dcap-pccs/pccs_server.js

Sep 13 10:45:30 b49691f5da8c systemd[1]: Started pccs.service - Provisioning Certificate Caching Service (PCCS).
Sep 13 10:45:30 b49691f5da8c node[336658]: 2024-09-13 10:45:30.769 [info]: HTTPS Server is running on: https://localhost:8081
Sep 13 10:55:56 b49691f5da8c node[336658]: 2024-09-13 10:55:56.820 [info]: Client Request-ID : d147708c047840bbb2b1581a4889ac1b
Sep 13 10:55:57 b49691f5da8c node[336658]: 2024-09-13 10:55:57.695 [info]: Request-ID is : a60370874bcc4b929e77abff685c6e9c
Sep 13 10:55:58 b49691f5da8c node[336658]: 2024-09-13 10:55:58.101 [info]: Request-ID is : 85a5b199c06448d7a93accd4126fa9f5
Sep 13 10:55:58 b49691f5da8c node[336658]: 2024-09-13 10:55:58.418 [info]: Request-ID is : 0da8cd4dec8b4b16b9cf8d5454eb0af5
Sep 13 10:55:58 b49691f5da8c node[336658]: 2024-09-13 10:55:58.457 [info]: 127.0.0.1 - - [13/Sep/2024:10:55:58 +0000] "POST /sgx/certification/v4/platforms HTTP/1.1" 200 21 "-" "-"

MPA registration logs (last 30 lines)

[15-08-2024 08:08:58] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 08:08:58] INFO: Finished Registration Agent Flow.
[15-08-2024 08:14:42] INFO: SGX Registration Agent version: 1.20.100.2
[15-08-2024 08:14:42] INFO: Starts Registration Agent Flow.
[15-08-2024 08:14:42] INFO: SGX MP Server configuration flag indicates that Registration Server won't save encrypted platform keys.
[15-08-2024 08:14:42] INFO: Platform registration request (PLATFORM_MANIFEST) won't be send to Registration Server.
[15-08-2024 08:14:42] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 08:14:42] INFO: Finished Registration Agent Flow.
[15-08-2024 09:00:04] INFO: SGX Registration Agent version: 1.20.100.2
[15-08-2024 09:00:04] INFO: Starts Registration Agent Flow.
[15-08-2024 09:00:04] INFO: SGX MP Server configuration flag indicates that Registration Server won't save encrypted platform keys.
[15-08-2024 09:00:04] INFO: Platform registration request (PLATFORM_MANIFEST) won't be send to Registration Server.
[15-08-2024 09:00:04] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 09:00:04] INFO: Finished Registration Agent Flow.
[15-08-2024 09:11:42] INFO: SGX Registration Agent version: 1.20.100.2
[15-08-2024 09:11:42] INFO: Starts Registration Agent Flow.
[15-08-2024 09:11:42] INFO: SGX MP Server configuration flag indicates that Registration Server won't save encrypted platform keys.
[15-08-2024 09:11:42] INFO: Platform registration request (PLATFORM_MANIFEST) won't be send to Registration Server.
[15-08-2024 09:11:42] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 09:11:42] INFO: Finished Registration Agent Flow.
[15-08-2024 09:17:51] INFO: SGX Registration Agent version: 1.20.100.2
[15-08-2024 09:17:51] INFO: Starts Registration Agent Flow.
[15-08-2024 09:17:51] INFO: SGX MP Server configuration flag indicates that Registration Server won't save encrypted platform keys.
[15-08-2024 09:17:51] INFO: Platform registration request (PLATFORM_MANIFEST) won't be send to Registration Server.
[15-08-2024 09:17:51] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 09:17:51] INFO: Finished Registration Agent Flow.
[20-08-2024 05:11:57] INFO: SGX Registration Agent version: 1.20.100.2
[20-08-2024 05:11:57] INFO: Starts Registration Agent Flow.
[20-08-2024 05:12:23] INFO: Registration Flow - PLATFORM_ESTABLISHMENT or TCB_RECOVERY passed successfully.
[20-08-2024 05:12:23] INFO: Finished Registration Agent Flow.
syncronize-issues-to-jira[bot] commented 1 month ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/PEK-1252.

This message was autogenerated

hector-cao commented 1 month ago

Hello @oriordain-s , the attestation packages seem to have unexpected version numbers. Did you run the setup script correctly ? For example tdx-qgs is expected to have the version 1.21-0ubuntu2.1 for the latest release : https://github.com/canonical/tdx/releases/tag/2.1

oriordain-s commented 1 month ago

Hi @hector-cao Thanks, so it looks like the repo versions got out of sync between the host and TD. Did a clean install from Version 2.1 on host, created new TD image etc. Subsequently - got a successful quote:

root@tdx-guest:~/work/tdx# cd /usr/share/doc/libtdx-attest-dev/examples/
root@tdx-guest:/usr/share/doc/libtdx-attest-dev/examples# 
root@tdx-guest:/usr/share/doc/libtdx-attest-dev/examples# 
root@tdx-guest:/usr/share/doc/libtdx-attest-dev/examples# 
root@tdx-guest:/usr/share/doc/libtdx-attest-dev/examples# ls
Makefile  test_tdx_attest  test_tdx_attest.c
root@tdx-guest:/usr/share/doc/libtdx-attest-dev/examples# ./test_tdx_attest 

        TDX report data

 00000000: 0d 2c 04 41 f7 4e 25 bb 7d f1 c2 48 2b a2 53 c9
 00000010: 8b 40 4e 56 8c f3 3a 64 7e d6 b7 32 e5 de 2d f3
 00000020: 0a 31 34 01 7f 59 bc fc 4a 7f 45 76 21 98 3f ac
 00000030: d8 8d 03 65 81 3d c9 ff 13 81 31 f8 5f 5e eb 69

Wrote TD Report to report.dat

        TDX quote data

 00000000: 04 00 02 00 81 00 00 00 00 00 00 00 93 9a 72 33
 00000010: f7 9c 4c a9 94 0a 0d b3 95 7f 06 07 58 04 85 e0
 00000020: 72 fa 19 60 81 56 40 6b 62 91 c0 2a 00 00 00 00
 00000030: 05 01 07 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000040: 1c c6 a1 7a b7 99 e9 a6 93 fa c7 53 6b e6 1c 12
 00000050: ee 1e 0f ab ad a8 2d 0c 99 9e 08 cc ee 2a a8 6d
 00000060: e7 7b 08 70 f5 58 c5 70 e7 ff e5 5d 6d 47 fa 04
 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 000000a0: 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00
 000000b0: e7 02 06 00 00 00 00 00 91 eb 2b 44 d1 41 d4 ec
 000000c0: e0 9f 0c 75 c2 c5 3d 24 7a 3c 68 ed d7 fa fe 8a
 000000d0: 35 20 c9 42 a6 04 a4 07 de 03 ae 6d c5 f8 7f 27
 000000e0: 42 8b 25 38 87 31 18 b7 00 00 00 00 00 00 00 00
 000000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00000170: 00 00 00 00 00 00 00 00 4f fa 78 65 32 91 b2 02
 00000180: 68 a4 be f3 30 2c d2 09 35 88 98 f9 d1 cc f5 1b
 00000190: 03 68 36 21 76 87 73 22 36 27 d0 4c 02 a3 9a 62
 000001a0: 6b d2 e2 66 2c d9 69 a2 4c c9 38 ae 7c b4 d7 19
 000001b0: 1f 42 f0 21 ec da 17 89 f6 b1 8c 78 0c 5e dd 5b
 ...
 ..
 000012b0: 38 43 41 51 45 77 43 67 59 49 0a 4b 6f 5a 49 7a
 000012c0: 6a 30 45 41 77 49 44 53 51 41 77 52 67 49 68 41
 000012d0: 4f 57 2f 35 51 6b 52 2b 53 39 43 69 53 44 63 4e
 000012e0: 6f 6f 77 4c 75 50 52 4c 73 57 47 66 2f 59 69 37
 000012f0: 47 53 58 39 34 42 67 77 54 77 67 0a 41 69 45 41
 00001300: 34 4a 30 6c 72 48 6f 4d 73 2b 58 6f 35 6f 2f 73
 00001310: 58 36 4f 39 51 57 78 48 52 41 76 5a 55 47 4f 64
 00001320: 52 51 37 63 76 71 52 58 61 71 49 3d 0a 2d 2d 2d
 00001330: 2d 2d 45 4e 44 20 43 45 52 54 49 46 49 43 41 54
 00001340: 45 2d 2d 2d 2d 2d 0a 00 00 00 00 00 00 00 00 00
 00001350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00001360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00001370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00001380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Successfully get the TD Quote

Wrote TD Quote to quote.dat

Failed to extend rtmr[2]

Failed to extend rtmr[3]
root@tdx-guest:/usr/share/doc/libtdx-attest-dev/examples# 

Cheers.

oriordain-s commented 1 month ago

Can close.