-
Notifications
You must be signed in to change notification settings - Fork 165
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
Report kernel module signing errors to prevent silent failures #496
Conversation
Looks good, thanks. Can you also please add a test for it in |
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.
Please update run_tests.sh for the changed output on some signing tests (that now show error messages). The checks need to pass again.
I’ve added a test case for the revised code in Given my lack of experience writing test cases for dkms and my limited familiarity with the project, I’d appreciate guidance from someone more acquainted with the project. If anyone could provide insights or a commit to fix the issue, that would be greatly appreciated.
|
With the latest change in commit 896e3e4, running Specifically, I’d like to ensure that I haven’t:
Thank you in advance for your review! |
I'm working on a solution for the failing test ... |
I've noticed that the testing script relies heavily on matching specific output strings from DKMS, which seems to make it quite fragile and challenging to adapt when there are minor changes in the main program. A more robust approach might be to use specific exit status codes to represent different errors or error categories rather than relying on exact string comparisons. Alternatively, leveraging regular expressions and grep to match expected DKMS output could make the tests more resilient and maintainable. I also found the script somewhat opaque and difficult to modify. Despite making only a single-line change, I wasn't able to get all tests to pass, which suggests that the current approach might introduce unnecessary complexity. That said, I fully appreciate the effort that has gone into this testing framework. It's clear that it's designed to ensure a high-quality, battle-tested tool that works across various Linux distributions and configurations. This is just a suggestion, and I completely understand if there are reasons for the current implementation that I’m not aware of. I’m not deeply involved in the project, so please feel free to disregard this if it doesn’t align with the overall goals. Just wanted to share some thoughts in case they might be helpful! |
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.
please rebase, I changed the logic for duplicate module case and thus the last commit will most likely no longer be neccessary
The problem you encountered is in strings outside the control of dkms: distribution specific errors (or not-errors) with (distribution specific) error messages from (distribution specific) commands called by dkms ...
I'm at least happy that dkms no longer exits with 0 in case of an error ... which was not always the case. For cleanup of the error codes used see #463
If we change strings within dkms the tests should immediately blow up and 'trivial' to fix. Ideally each string emittable is covered by a test ..
You are right, it's a non-trivial piece of code but so far the best we have. But it looks like we are reaching a scalability point soon - right now it takes about 20 minutes while it is still only testing a fraction of the functionality ... Parallelization won't be trivial since we cannot modify /lib/modules or /var/lib/dkms or run depmod in parallel
Trying to fix it ourself and providing feedback about the problems you encountered is very welcome and helpful! And as a followup me trying to fix the test on the failing distributions made no notice and fix two more things:
|
@anbe42 I've rebased my branch on the upstream repository's master branch and resolved the conflict between my most recent commit and the changes you pushed to resolve the failing test. Additionally, I have squashed all my changes into a single commit and force-pushed the updated branch to keep the history clean. |
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.
You lost the commit adding the new test, I'll cherry-pick that from the previous version.
This PR improves the kernel module signing process by ensuring failures are properly detected and reported. Previously, dkms suppressed the signing command output and did not check the exit status, leading to silent failures. This was a personal issue for me, as I had a malformed X.509 certificate and spent an hour debugging why dkms wasn't signing kernel modules. Now, if signing fails, a clear error is displayed along with the signing command output for easier debugging. These changes were tested successfully on Fedora Linux (6.12.13-200.fc41.x86_64).