bsdkm: misc cleanup.#10565
Open
philljj wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR performs small cleanup and correctness fixes in the FreeBSD kernel module (“bsdkm”) integration, aimed at addressing reported issues (Fenrir) and tightening teardown/cleanup behavior.
Changes:
- Add NULL-guard checks for the per-CPU FPU state array in x86 vector-register save/restore helpers.
- Adjust attach/detach error handling and add more explicit error logging in the crypto driver glue.
- Fix an AES-GCM self-test buffer initialization bug and zeroize additional sensitive state on exit paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| bsdkm/x86_vecreg.c | Adds fpu_states NULL checks in vecreg save/restore paths. |
| bsdkm/wolfkmod.c | Tweaks attach/detach cleanup/unregister flow; adds extra zeroization and error normalization in CBC/GCM work functions. |
| bsdkm/wolfkmod_aes.c | Fixes incorrect size used when clearing resultC2 in AES-GCM test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
493
to
497
| if (error) { | ||
| wolfkdriv_unregister(softc); | ||
| device_printf(dev, "error: attach_out: %d\n", error); | ||
| (void)wolfkmod_cleanup(); | ||
| wolfkdriv_unregister(softc); | ||
| } |
Comment on lines
+507
to
+510
| /* unregister wolfcrypt algs */ | ||
| softc = device_get_softc(dev); | ||
| ret = wolfkmod_cleanup(); | ||
|
|
||
| if (ret == 0) { | ||
| /* unregister wolfcrypt algs */ | ||
| softc = device_get_softc(dev); | ||
| wolfkdriv_unregister(softc); | ||
| } | ||
|
|
||
| wolfkdriv_unregister(softc); |
Comment on lines
+142
to
+145
| if (fpu_states == NULL) { | ||
| printf("info : wolfkmod_vecreg_save: fpu_states null\n"); | ||
| return (EINVAL); | ||
| } |
Comment on lines
+197
to
+200
| if (fpu_states == NULL) { | ||
| printf("info: wolfkmod_vecreg_restore: fpu_states null\n"); | ||
| return; | ||
| } |
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.
Description
Some bsdkm cleanup. Fixes Fenrir issues, and tidies up some loose ends.