-
Notifications
You must be signed in to change notification settings - Fork 164
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
pkg: grub: add measurefs command patch for grub 2.06 #2946
Conversation
Signed-off-by: Aleksandrov Dmitriy <goodmobiledevices@gmail.com>
+ char *desc = grub_xasprintf("%s %s", fs->name, result_str); | ||
+ if (!desc) | ||
+ return GRUB_ERR_OUT_OF_MEMORY; | ||
+ | ||
+ err = grub_tpm_measure(result, result_len, pcr, desc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only this part has been changed, because grub 2.06 has its own grub_tpm_measure func.
I've concatenated the fs->name and result_str strings into desc, as is done in our patch with adding grub_tpm_measure func.
in grub 2.06:
https://github.com/rhboot/grub2/blob/ae94b97be2b81b625d6af6654d3ed79078b50ff6/grub-core/commands/efi/tpm.c#L224-L241
in our grub:
eve/pkg/grub/patches/0000-core-os-merge.patch
Lines 2761 to 2771 in aa23518
+grub_tpm_measure (unsigned char *buf, grub_size_t size, grub_uint8_t pcr, | |
+ const char *kind, const char *description) | |
+{ | |
+ grub_err_t ret; | |
+ char *desc = grub_xasprintf("%s %s", kind, description); | |
+ if (!desc) | |
+ return GRUB_ERR_OUT_OF_MEMORY; | |
+ ret = grub_tpm_log_event(buf, size, pcr, desc); | |
+ grub_free(desc); | |
+ return ret; | |
+} |
@mikem-zed is everything okay?
kernel hangs at:
And no debug messages from grub after measurefs command:
I need to study the problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this already to make sure we produce PCR 13 with the rootfs measurement?
Yes, I just tested everything, the problem with kernel hangs was due to an image write error, after rewriting EVE to sdcard everything worked. I get this values from
|
I think we can merge this because it looks like a working solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
there is a patch that check whether we are running EVE on a device without TPM. I thnk we should merge this one too
Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
@mikem-zed any chances you upstream the patch? |
or if @Insei have connections in the grub community can help with that? |
we need to move to the latest LTS GRUB which is going to be 2.12 soon. Then we can think about up streaming. This is not a very easy task, vanilla grub is not suitable for us because it is missing some important functionality like efilinux. this is why we have an initiative to use Ubuntu's 2.06 grub but the whole process is not decided yet |
I Adapted the patch that @mikem-zed added for the 2.02 version of grub and added measurefs cmd for arm64.
Signed-off-by: Aleksandrov Dmitriy goodmobiledevices@gmail.com