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

lib/bootloader-zipl: Check for Secure Boot before zipl #3080

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

nikita-dubrovskii
Copy link
Contributor

@nikita-dubrovskii nikita-dubrovskii commented Oct 19, 2023

Starting with z/VM Version 7 Release 3.0, service level 2301 we can run Linux with Secure Boot enabled

@openshift-ci
Copy link

openshift-ci bot commented Oct 19, 2023

Hi @nikita-dubrovskii. Thanks for your PR.

I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@nikita-dubrovskii nikita-dubrovskii changed the title WIP: lib/bootloader-zipl: Check for Secure Boot before zipl lib/bootloader-zipl: Check for Secure Boot before zipl Oct 24, 2023
@nikita-dubrovskii
Copy link
Contributor Author

Here is a how-to: coreos/enhancements#10

return glnx_prefix_error (error, "spawning dmesg");
if (!g_spawn_check_exit_status (status, error))
return glnx_prefix_error (error, "`dmesg` failed");
*out_enabled = (output != NULL && strstr (output, "Secure-IPL enabled") != NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels weird to be grepping for strings in logs for something like Secure Boot. I think --kernel prevents a simple e.g. echo Secure-IPL enabled > /dev/kmsg from throwing this off, but my vote would be to stick with the sysfs flag and open a issue against RHEL 9 to have it backported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped dmesg and now read kmsg directly. I don't know when kernel fix comes, so it'd be better to have this workaround until former happens.

@cgwalters
Copy link
Member

/ok-to-test

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane, just some minor nits.

src/libostree/ostree-bootloader-zipl.c Outdated Show resolved Hide resolved
src/libostree/ostree-bootloader-zipl.c Outdated Show resolved Hide resolved
src/libostree/ostree-bootloader-zipl.c Show resolved Hide resolved
@cgwalters
Copy link
Member

One thing I don't quite understand btw...isn't zipl in the position to check for secure boot itself?

Would it make more sense for the code here to always run zipl --auto itself?

@nikita-dubrovskii
Copy link
Contributor Author

One thing I don't quite understand btw...isn't zipl in the position to check for secure boot itself?

Would it make more sense for the code here to always run zipl --auto itself?

New versions are able to detect it (when sysfs contains required info), but RHEL still uses older release. And auto is default behavior, so i keep it by default as well.

@cgwalters cgwalters merged commit e4b82c4 into ostreedev:main Nov 7, 2023
24 checks passed
@nikita-dubrovskii nikita-dubrovskii deleted the s390x_secure_boot branch November 9, 2023 13:45
@cgwalters
Copy link
Member

Followup fixes in #3119 - can you review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants