Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incomplete measured boot and CCEL eventlog #35

Open
mythi opened this issue Feb 16, 2024 · 12 comments
Open

incomplete measured boot and CCEL eventlog #35

mythi opened this issue Feb 16, 2024 · 12 comments
Assignees
Labels
fixed-awaiting-deploy Fixed but awaiting deployment

Comments

@mythi
Copy link

mythi commented Feb 16, 2024

I've followed the steps in this repo to build an image based on 23.10 and I have

# cat /etc/os-release 
PRETTY_NAME="Ubuntu 23.10"
NAME="Ubuntu"
VERSION_ID="23.10"
VERSION="23.10 (Mantic Minotaur)"
VERSION_CODENAME=mantic
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=mantic
LOGO=ubuntu-logo

I was checking the content of CCEL and could not find any logs that the most important parts, i.e., kernel/initrd/cmdline get measured. To see the log, I used https://github.com/canonical/tcglog-parser

# xxd -c2  /sys/firmware/acpi/tables/data/CCEL | grep -v ffff | xxd -r > /tmp/ccel.bin 
# ./tcglog-dump /tmp/ccel.bin -v

All of the grub measurements are missing. In contrast, on my TPM enabled laptop I can see, e.g.,

$ sudo ./tcglog-dump -v | grep \/vmlinuz | grep ^9
9    de0861d9a7b0c8a8d498eeac3bd1bf98cb01f5d7bb864e431cf6e826239758d3  EV_IPL                            /vmlinuz-6.6.13-amd64
$ sha256sum /boot/vmlinuz-6.6.13-amd64 
de0861d9a7b0c8a8d498eeac3bd1bf98cb01f5d7bb864e431cf6e826239758d3  /boot/vmlinuz-6.6.13-amd64
@sathyaintel
Copy link

I think this issue is related to missing cmdline/initrd measurement issue reported in #40

Can you try it with Linus tip tree or upcoming v6.9-rc1 release? It has fixes related to cmdline measurements in CC platforms.

@mythi
Copy link
Author

mythi commented Mar 21, 2024

This is different.

@mythi
Copy link
Author

mythi commented Apr 18, 2024

I've followed the steps in this repo to build an image based on 23.10 and I have

I checked with vanilla 24.04 and the result is still the same

@hector-cao
Copy link
Collaborator

Hello @mythi , i checked it on 24.04 and i see the event log for initrd

To check it yourself, i have a ongoing merge request for the branch https://github.com/canonical/tdx/tree/tdx-testing-ng that contains tests for TDX, i have a test for making sure that the initrd is measured into the event log table

if you are on the branch and on a 24.04 TDX system, you can run the test with:

$ cd tests
$ ./run.sh pytest bin/test_guest_eventlog.py::test_guest_eventlog_initrd

Copy link

Thank you for reporting us your feedback!

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

This message was autogenerated

@mythi
Copy link
Author

mythi commented May 27, 2024

i checked it on 24.04 and i see the event log for initrd

It was not clear in my original report: the eventlog exists but it's incomplete (it does not contain any of the grub2 measurements) but stops at what OVMF has measured.

@hector-cao
Copy link
Collaborator

@mythi Hello, i did some investigation on this issue and discovered that we have an issue on grub where grub will skip loading the tpm module (in charge of doing measurement both for TPM and Confidential Computing platform) if the tpm is not present (see hector-cao/grub@30708df ), we will need to fix it to allow the tpm module to be loaded when TPM is not present but CC is available (basically check for the protocol : EFI_CC_MEASUREMENT_PROTOCOL) . I will work on this patch and submit it to Ubuntu and also grub upstream

@mythi
Copy link
Author

mythi commented May 31, 2024

@hector-cao nice find, thanks so much!

@hector-cao
Copy link
Collaborator

Here is the upstream patch : https://lists.gnu.org/archive/html/grub-devel/2024-05/msg00273.html

@hector-cao hector-cao self-assigned this Jun 6, 2024
@hector-cao hector-cao added the bug Something isn't working label Jun 6, 2024
@frenchwr frenchwr added the fixed-awaiting-deploy Fixed but awaiting deployment label Jun 6, 2024
@hector-cao hector-cao removed the bug Something isn't working label Jun 12, 2024
@mythi
Copy link
Author

mythi commented Dec 16, 2024

@hector-cao is this still open?

@hector-cao
Copy link
Collaborator

@mythi yes, it is. The issue is fixed in Oracular (24.10) and i m going to backport the fix to Noble (24.04),

@mythi
Copy link
Author

mythi commented Dec 16, 2024

@mythi yes, it is. The issue is fixed in Oracular (24.10) and i m going to backport the fix to Noble (24.04),

thanks! I haven't checked Oracular myself yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-awaiting-deploy Fixed but awaiting deployment
Projects
None yet
Development

No branches or pull requests

4 participants