-
Notifications
You must be signed in to change notification settings - Fork 819
Add support of secure warm-boot #2532
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
Changes from 1 commit
b8dd8d2
0ef8677
4cd2598
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -447,6 +447,13 @@ function load_kernel() { | |
| /sbin/kexec -a -l "$KERNEL_IMAGE" --initrd="$INITRD" --append="$BOOT_OPTIONS" | ||
| } | ||
|
|
||
| function load_kernel_secure() { | ||
| # Load kernel into the memory secure | ||
| # -s flag is for enforcing the new load kernel(vmlinuz) to be signed and verify. | ||
| # not using -a flag, this flag can fallback to an old kexec load that do not support Secure Boot verification | ||
| /sbin/kexec -l "$KERNEL_IMAGE" --initrd="$INITRD" --append="$BOOT_OPTIONS" -s | ||
| } | ||
|
|
||
| function unload_kernel() | ||
| { | ||
| # Unload the previously loaded kernel if any loaded | ||
|
|
@@ -597,9 +604,13 @@ if [[ "$sonic_asic_type" == "mellanox" ]]; then | |
| fi | ||
| fi | ||
|
|
||
| # check if secure boot is enable in UEFI | ||
| SECURE_UPGRADE_ENABLED=$(bootctl status 2>/dev/null | grep -c "Secure Boot: enabled") | ||
|
||
|
|
||
| if is_secureboot && grep -q aboot_machine= /host/machine.conf; then | ||
| load_aboot_secureboot_kernel | ||
| elif [ ${SECURE_UPGRADE_ENABLED} -eq 1 ]; then | ||
| load_kernel_secure | ||
| else | ||
| load_kernel | ||
| fi | ||
|
|
||
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.
Would it be beneficial if we extend
load_kernelwith argument whether to perform sign verification instead of copy/paste most of the kexec parameters here?Uh oh!
There was an error while loading. Please reload this page.
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.
in my previous implementation, I extended the command, but now it's not possible because was added a new flag that is not secure.
so we need to add and remove flags with the SB use case.
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.
How about? To avoid duplicating kexec line
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.
I think this one can work, I will add a commit