-
Notifications
You must be signed in to change notification settings - Fork 55
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
[WIP/RFC] OOT modules sign #2636
base: main
Are you sure you want to change the base?
Conversation
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 mentioned this on Teams, so perhaps you've initially taken a shortcut, but using a deterministic path in /tmp is dangerous. We should generate a random one with mktemp
and set an environment variable.
a1ce873
to
935efe2
Compare
sdk_container/src/third_party/coreos-overlay/eclass/coreos-kernel.eclass
Outdated
Show resolved
Hide resolved
sdk_container/src/third_party/coreos-overlay/eclass/coreos-kernel.eclass
Outdated
Show resolved
Hide resolved
sdk_container/src/third_party/coreos-overlay/eclass/coreos-kernel.eclass
Outdated
Show resolved
Hide resolved
...ontainer/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-6.6.76.ebuild
Outdated
Show resolved
Hide resolved
sdk_container/src/third_party/coreos-overlay/eclass/coreos-kernel.eclass
Outdated
Show resolved
Hide resolved
...ontainer/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-6.6.76.ebuild
Outdated
Show resolved
Hide resolved
Move module signing key to /tmp, so that it stays in RAM. Disable shredding signing key after coreos-modules finishes, but rather shred it after coreos-kernel finishes, so that out of tree modules (like ZFS from upstream portage) can also use the key before it is shreded.
935efe2
to
17589ba
Compare
@@ -61,9 +61,8 @@ src_prepare() { | |||
# Pull in the config and public module signing key | |||
KV_OUT_DIR="${SYSROOT%/}/lib/modules/${COREOS_SOURCE_NAME#linux-}/build" | |||
cp -v "${KV_OUT_DIR}/.config" build/ || die | |||
|
|||
local sig_key="$(getconfig MODULE_SIG_KEY)" |
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 said you could call get_sig_key
here, but now it's not actually used below, so this line should go. I'm not sure whether you need something in its place. I guess it builds the modules first and will reuse the config from that, so you don't need to call envsubst
again.
[Title: describe the change in one sentence]
For out of tree modules (like ZFS or NVIDIA) to work with secureboot, they need to be signed by the ephemeral kernel modules key. This key is shredded after the upstream-included kernel modules are built, therefore it can't be reused during ZFS module build. This PR moves the key to /tmp, so that it stays in RAM and can be reused by out of tree modules. Moreover, by moving the key to
/tmp
we improve the security of the ephemeral module signing key (previously we wrote it to disk and then shredded it, but it might still stay in the disk or software cache, compromising the secure boot model).Currently, this PR works when the packages are built manually in the order coreos-modules, zfs-kmod and coreos-kernel. We need to fix the dependecies, so that we enforce this order.
[ describe the change in 1 - 3 paragraphs ]
How to use
[ describe what reviewers need to do in order to validate this PR ]
Testing done
[Describe the testing you have done before submitting this PR. Please include both the commands you issued as well as the output you got.]
changelog/
directory (user-facing change, bug fix, security fix, update)/boot
and/usr
size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.