Skip to content

bsdkm: misc cleanup.#10565

Open
philljj wants to merge 1 commit into
wolfSSL:masterfrom
philljj:bsdkm_misc_cleanup
Open

bsdkm: misc cleanup.#10565
philljj wants to merge 1 commit into
wolfSSL:masterfrom
philljj:bsdkm_misc_cleanup

Conversation

@philljj
Copy link
Copy Markdown
Contributor

@philljj philljj commented Jun 1, 2026

Description

Some bsdkm cleanup. Fixes Fenrir issues, and tidies up some loose ends.

@philljj philljj self-assigned this Jun 1, 2026
Copilot AI review requested due to automatic review settings June 1, 2026 05:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread bsdkm/wolfkmod.c
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 thread bsdkm/wolfkmod.c
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 thread bsdkm/x86_vecreg.c
Comment on lines +142 to +145
if (fpu_states == NULL) {
printf("info : wolfkmod_vecreg_save: fpu_states null\n");
return (EINVAL);
}
Comment thread bsdkm/x86_vecreg.c
Comment on lines +197 to +200
if (fpu_states == NULL) {
printf("info: wolfkmod_vecreg_restore: fpu_states null\n");
return;
}
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

MemBrowse Memory Report

No memory changes detected for:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants