coconut-svsm / svsm

COCONUT-SVSM
MIT License
122 stars 42 forks source link

`/sys/kernel/security/tpm0/binary_bios_measurements` doesn't exist #435

Closed jianlinjiang closed 3 months ago

jianlinjiang commented 3 months ago

I have enabled the vTPM in SVSM.

dmesg | grep SEV
[    0.180123] Memory Encryption Features active: AMD SEV SEV-ES SEV-SNP
[    0.292141] SEV: APIC: wakeup_secondary_cpu() replaced with wakeup_cpu_via_vmgexit()
[    0.343177] SEV: SNP running at VMPL2.
[    0.343950] SEV: Using SNP CPUID table, 31 entries present.
[    0.643245] SEV: SNP guest platform device initialized.
[    0.644732] SEV: SNP SVSM VTPM platform device initialized
[    2.020765] sev-guest sev-guest: Initialized SEV guest driver (using vmpck_id 2)

vTPM PCR has values.

tpm2_pcrlist
sha1 :
  0  : 0eb96a6d64d35fa496889f4117da082bdfa55840
  1  : 7d06a6341d48ea79adbbd7775051ada2b17dc5eb
  2  : b2a83b0ebf2f8374299a5b2bdfc31ea955ad7236
  3  : b2a83b0ebf2f8374299a5b2bdfc31ea955ad7236
  4  : b33971e7529d90a3fad66f2c347ee34afa88150b
  5  : e5e14dad396d4d67d296e3d2f52c502da0ce5a86
  6  : b2a83b0ebf2f8374299a5b2bdfc31ea955ad7236
  7  : 1923fd78db603ad4068f3f32c3f70b16fc40f32c
  8  : 3395128ce8d4bce293e3540d1e148596f6d3eab7
  9  : 12000e78d6b5c0e24947da143c5329237fb7616c
  10 : 0000000000000000000000000000000000000000
  11 : 0000000000000000000000000000000000000000
  12 : 0000000000000000000000000000000000000000
  13 : 0000000000000000000000000000000000000000
  14 : f86ed0e76822a70ac72fc60b5f8b1798ded6fe23
  15 : 0000000000000000000000000000000000000000
  16 : 0000000000000000000000000000000000000000
  17 : ffffffffffffffffffffffffffffffffffffffff
  18 : ffffffffffffffffffffffffffffffffffffffff
  19 : ffffffffffffffffffffffffffffffffffffffff
  20 : ffffffffffffffffffffffffffffffffffffffff
  21 : ffffffffffffffffffffffffffffffffffffffff
  22 : ffffffffffffffffffffffffffffffffffffffff
  23 : 0000000000000000000000000000000000000000
sha256 :
  0  : c14356d68f195fa4ace011a9f6bc03e8e4105a0cada9f9db77cdda5f4e86eaa0
  1  : 2ee22cbbc0dd143a6a4f297f4f6139875f63965ae9b271879cf7aea5d547152f
  2  : 3d458cfe55cc03ea1f443f1562beec8df51c75e14a9fcf9a7234a13f198e7969
  3  : 3d458cfe55cc03ea1f443f1562beec8df51c75e14a9fcf9a7234a13f198e7969
  4  : 8c58481ebaf08829c35c1071b1e177b2033c5a34fa2a30ae93f2e735cc597a2a
  5  : 39e852a9aba85205d408d571e26ab0aef42ebb285aa1c38111b2c8ea2d96c74b
  6  : 3d458cfe55cc03ea1f443f1562beec8df51c75e14a9fcf9a7234a13f198e7969
  7  : 797d80f80a154aeac81340b41365879e83d3be8fb6ea80da73ad1fc2c31713b1
  8  : f8be96a85c6afc4b51be1bd94dddfafcaef77cfb7bf778cd28ac8a04baa9d37d
  9  : c09080b80d9cfee63d8050e647d777722236e8fc384e7cd7ef45d6013f1f8ad4
  10 : 0000000000000000000000000000000000000000000000000000000000000000
  11 : 0000000000000000000000000000000000000000000000000000000000000000
  12 : 0000000000000000000000000000000000000000000000000000000000000000
  13 : 0000000000000000000000000000000000000000000000000000000000000000
  14 : 70eb0257b7aa9e2852ee394961a4764eda462023d097e6c8d880f00ba083054e
  15 : 0000000000000000000000000000000000000000000000000000000000000000
  16 : 0000000000000000000000000000000000000000000000000000000000000000
  17 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  18 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  19 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  20 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  21 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  22 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  23 : 0000000000000000000000000000000000000000000000000000000000000000
sha384 :
  0  : f3c318824d449efc151b27b0f0dd75322ceaea3580e8a17cb6f12accabc63d58a828aa2029a8de101e4684b31f2388c9
  1  : 5165abc126c857c8450ce88c76707cc04f5f05d81afb4ea254b4204a5edc5d2173ab355ac92e32d5c5bac3794f263e75
  2  : 518923b0f955d08da077c96aaba522b9decede61c599cea6c41889cfbea4ae4d50529d96fe4d1afdafb65e7f95bf23c4
  3  : 518923b0f955d08da077c96aaba522b9decede61c599cea6c41889cfbea4ae4d50529d96fe4d1afdafb65e7f95bf23c4
  4  : de654e8f992001f939127e58c7f76d073d2c4e2e227bfef4cf498fbe7d04c8ba550fc2b0b71bec904b9f7ba28083a01a
  5  : 68fc271eda9154836d0ebdc228eef91bb4c504ef9e51cbe27e6596ae9dbca428324a0a40c0c88101f0a280ea2b5e3c70
  6  : 518923b0f955d08da077c96aaba522b9decede61c599cea6c41889cfbea4ae4d50529d96fe4d1afdafb65e7f95bf23c4
  7  : 193a3734afce0e3729e423920dc72dfba297cc9b90a8a0c335fc16c5aa35ed3b47ede698729c0a7ff27b75a0a2c022fa
  8  : 290ceb3baaf03a7af966abf5234f27d277bdbb0bc04ba6ce7dd2675f37a049d2727e9f80ff7743ddfabfe5dd97f44e38
  9  : 2a7d271fdcfddeb7ae0bbccd86e9bf8b4905779f371959425aca3d9870ec9ad2180c65f07c7591df26efb02be8e84e58
  10 : 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  11 : 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  12 : 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  13 : 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  14 : 9ede5ab739b8ae721ee2897bf192e4d757f0833a9aabd4f326a03793493f1e77329a49aa0b5ea82d0c5e18678446f779
  15 : 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  16 : 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  17 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  18 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  19 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  20 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  21 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  22 : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  23 : 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

However, the file /sys/kernel/security/tpm0/binary_bios_measurements doesn't exist.

If anyone can help me to figure out the reason for this issue?

jianlinjiang commented 3 months ago

you can try to boot the vm in uefi mode