Draft
Conversation
This is a WIP/Proof-of-Concept change to introduce kernel module signing. The actual signing is performed by the in-tree script sign-file. The private key and the certificate must be provided in the same directory as the libs/ checkout, under a specially created directory signed-key/, i.e. + agent-libs + cmake + driver + proposals + signing-key <----- + test + userspace and must be called: + key.priv (private key in PEM format) + key.der (certificate in DER format) NOTE: this was done in order not to create any additional paths to mount as volume, (first to the outer container, and then to the specific container). ALSO NOTE: on newer kernels the sign-file would be a C program which also accepts a PEM textual file for the certificate but older kernels use a perl script which can only read a DER binary file, so for compatibility reason this _must_ be a binary file. The top-level python script must be called with the '-x/--sign' flag in order for module signing to be enabled. Since different kernels might use a different hashing algorithm (sha256, sha512, etc..), the one chosen by the target kernel is read from the kernel config file under CONFIG_MODULE_SIG_HASH. This value is then passed over to the downstream builder as SIGN_FILE_HASH_ALGO. When '-x/--sign' is not specified, this is left empty and the module is NOT signed.
gnosek
previously approved these changes
Feb 23, 2023
Contributor
gnosek
left a comment
There was a problem hiding this comment.
I'm not 100% thrilled about adding stuff to the agent-libs checkout but I see why you went that way.
LGTM!
nathan-b
approved these changes
Apr 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a WIP/Proof-of-Concept change to introduce kernel module signing.
The actual signing is performed by the in-tree script sign-file.
The private key and the certificate must be provided in the same directory as the libs/ checkout, under a specially created directory signed-key/, i.e.
and must be called:
NOTE: this was done in order not to create any additional paths to mount as volume, (first to the outer container, and then to the specific container).
ALSO NOTE: on newer kernels the sign-file would be a C program which also accepts a PEM textual file for the certificate but older kernels use a perl script which can only read a DER binary file, so for compatibility reason this must be a binary file.
The top-level python script must be called with the '-x/--sign' flag in order for module signing to be enabled.
Since different kernels might use a different hashing algorithm (sha256, sha512, etc..), the one chosen by the target kernel is read from the kernel config file under CONFIG_MODULE_SIG_HASH.
This value is then passed over to the downstream builder as SIGN_FILE_HASH_ALGO.
When '-x/--sign' is not specified, this is left empty and the module is NOT signed.