-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
zfs-kmod.spec: preserve signature in linux kmod built by make rpm-kmod #15744
Merged
Conversation
This file contains 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
This change provides rpm spec macros to sign the zfs and spl kmods as the final step after the %install scriptlet. This is needed since the find-debuginfo.sh script strips out debug symbols plus signatures. Kernel module signing only occurs when the required files are present as typically required in the Linux source tree: - certs/signing_key.pem - certs/signing_key.x509 The method for overriding the default __spec_install_post macro is inspired by (and largely copied from) the Fedora kernel.spec. Signed-off-by: Benjamin Sherman <[email protected]>
behlendorf
added
Component: Packaging
custom packages
Status: Code Review Needed
Ready for review and testing
labels
Jan 9, 2024
I was able to reproduce this on Almalinux 9 and verified that the modules were signed when ZFS was built with this PR (and the signatures were present). To reproduce on Alma 9:
|
tonyhutter
approved these changes
Jan 9, 2024
mcmilk
approved these changes
Jan 12, 2024
behlendorf
added
Status: Accepted
Ready to integrate (reviewed, tested)
and removed
Status: Code Review Needed
Ready for review and testing
labels
Jan 12, 2024
behlendorf
pushed a commit
to behlendorf/zfs
that referenced
this pull request
Jan 29, 2024
This change provides rpm spec macros to sign the zfs and spl kmods as the final step after the %install scriptlet. This is needed since the find-debuginfo.sh script strips out debug symbols plus signatures. Kernel module signing only occurs when the required files are present as typically required in the Linux source tree: - certs/signing_key.pem - certs/signing_key.x509 The method for overriding the default __spec_install_post macro is inspired by (and largely copied from) the Fedora kernel.spec. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Signed-off-by: Benjamin Sherman <[email protected]> Closes openzfs#15744
behlendorf
pushed a commit
that referenced
this pull request
Jan 29, 2024
This change provides rpm spec macros to sign the zfs and spl kmods as the final step after the %install scriptlet. This is needed since the find-debuginfo.sh script strips out debug symbols plus signatures. Kernel module signing only occurs when the required files are present as typically required in the Linux source tree: - certs/signing_key.pem - certs/signing_key.x509 The method for overriding the default __spec_install_post macro is inspired by (and largely copied from) the Fedora kernel.spec. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Signed-off-by: Benjamin Sherman <[email protected]> Closes #15744
lundman
pushed a commit
to openzfsonwindows/openzfs
that referenced
this pull request
Mar 13, 2024
This change provides rpm spec macros to sign the zfs and spl kmods as the final step after the %install scriptlet. This is needed since the find-debuginfo.sh script strips out debug symbols plus signatures. Kernel module signing only occurs when the required files are present as typically required in the Linux source tree: - certs/signing_key.pem - certs/signing_key.x509 The method for overriding the default __spec_install_post macro is inspired by (and largely copied from) the Fedora kernel.spec. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Signed-off-by: Benjamin Sherman <[email protected]> Closes openzfs#15744
lundman
pushed a commit
to openzfsonwindows/openzfs
that referenced
this pull request
Mar 13, 2024
This change provides rpm spec macros to sign the zfs and spl kmods as the final step after the %install scriptlet. This is needed since the find-debuginfo.sh script strips out debug symbols plus signatures. Kernel module signing only occurs when the required files are present as typically required in the Linux source tree: - certs/signing_key.pem - certs/signing_key.x509 The method for overriding the default __spec_install_post macro is inspired by (and largely copied from) the Fedora kernel.spec. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Signed-off-by: Benjamin Sherman <[email protected]> Closes openzfs#15744
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Motivation and Context
When the linux kernel source tree is configured with a signing key and certificate, kmods are automatically signed. So, if properly configured, one would expect the existing zfs
make rpm-kmod
to result in rpms which contain signed spl.ko and zfs.ko kmods. However, because of a known issue with the rpm build process, when rpmbuild strips debug symbols from binaries, it also strips signatures.This PR corrects that issue, ensuring that signing occurs after the debug symbols and signatures are stripped, thus providing rpms with signed kmods.
Description
This is an rpm spec, packaging-only change. It provides rpm spec macros to sign the zfs and spl kmods as the final step after the %install scriptlet. This is needed since the find-debuginfo.sh script strips out debug symbols plus signatures.
Kernel module signing only occurs when the required files are present as typically required in the linux source tree:
This method for overriding the default __spec_install_post macro is inspired by (and largely copied from) the Fedora kernel.spec.
How Has This Been Tested?
This has been tested in both Fedora 39 and AlmaLinux 9 x86_64 container image environments.
With all typical build requirements for linux kernel, zfs, and rpm per the docs,
make rpm-kmod
was executed with and without the expected signing_key pair.As expected, when the signing_key was present, the resulting
kmod-zfs-VERSION.rpm
contained kmods with a signature:Also as expected, when the signing_key was absent, no signature was found on the kmods in the resulting rpm:
In the Fedora test, I have also loaded the signed kmod into the kernel and used it.
Note: by default
./configure
in the above case uses thegeneric
rpm spec.On AlmaLinux 9, the same test was performed using
./configure --with-spec=redhat
in order to test the build of a kABI tracking kmod.The same, expected results were found.
Since this is a rpm packaging-only change, this should not effect any other code area.
Types of changes
Checklist:
Signed-off-by
.