Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue number:
#2501
Description of changes:
For Secure Boot support, the GRUB configuration (grub.cfg) will need to be signed by a trusted key, so that the chain of trust extends to the kernel command line, which contains sensitive data such as the dm-verity root hash.
However, Bottlerocket also allows the boot config feature to be used to extend the kernel command line. Boot config data is passed by the bootloader using the "initrd" mechanism; it consists of a payload at the end of the initramfs cpio buffer list.
In normal use, the "initrd" file should only ever contain boot config data. However, because this file is locally generated, it cannot be signed by a key known to the chain of trust. Because it is treated as an initramfs, it could be leveraged to run an unverified userspace by prepending it with an actual initramfs.
This change causes the kernel to discard any initramfs or initrd data passed by the bootloader. Any boot config data remaining at the end of the input will still be processed, as intended.
Without Secure Boot support, ignoring the initramfs is not useful as a security measure, but it still improves robustness by preventing accidental usage that might lead to boot failures.
Testing done:
Tested on variants with a 5.10 (
aws-k8s-1.23
) and a 5.15 (aws-k8s-1.24
) kernel.As expected,
dmesg
no longer shows the "Trying to unpack rootfs image as initramfs..." message, and bootconfig data is still processed.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.