add wolfentropy.ko build — SP 800-90B entropy source kernel module#10144
add wolfentropy.ko build — SP 800-90B entropy source kernel module#10144lealem47 wants to merge 6 commits intowolfSSL:masterfrom
Conversation
…Entropy* randomness source
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds build wiring and runtime glue to support building wolfentropy.ko (an SP 800-90B entropy source kernel module) separately from libwolfssl.ko, including symbol export/import handling and updated configuration/build targets.
Changes:
- Introduces
wolfentropy.kobuild/clean targets and packaging of additional linuxkm build files. - Adds
libwolfssl.koglue to consumewc_Entropy_Get()from an external module (softdep + import namespace + weak symbol fallback). - Updates build/config conditionals and related scripts to reflect new wolfEntropy build modes.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/api/test_random.c | Adjusts test preprocessor condition when entropy memuse is involved |
| src/include.am | Switches wolfentropy source inclusion to new BUILD_WOLFENTROPY_C conditional |
| linuxkm/module_hooks.c | Adds external-entropy seed generator + soft dependency and import namespace |
| linuxkm/include.am | Adds new linuxkm entropy build/export/hook files to EXTRA_DIST |
| linuxkm/Makefile | Adds wolfentropy.ko build/clean targets and integrates into clean |
| linuxkm/Kbuild | Excludes wc_Entropy_* symbols from auto-export generation to avoid duplicates |
| fips-check.sh | Updates wolfentropy option set and tag-gathering logic when no FIPS files are listed |
| configure.ac | Changes wolfEntropy defaults/flags and adds new automake conditionals |
| Makefile.am | Exposes top-level wolfentropy/wolfentropy-clean targets under a conditional |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
douzzer
left a comment
There was a problem hiding this comment.
The parts of this PR that do what the title says -- "add wolfentropy.ko build" -- LGTM, pending some deeper testing.
However, the ungated breaking changes to the existing linuxkm/Kbuild, linuxkm/module_hooks.c, src/include.am, tests/api/test_random.c, and configure.ac, need to be refactored to not break existing users, i.e. to be purely additive, preserving existing defaults and naming. The new alternative added here, gating out the in-tree WolfEntropy (thereby building a non-free-standing libwolfssl.ko), needs to pivot on newly added option names, macro gates, and Makefile gates.
Summary
Adds build infrastructure and runtime glue for wolfentropy.ko, a minimal Linux kernel module that provides an SP 800-90B entropy source separate from the FIPS boundary.
New: wolfentropy.ko build target
flags that would cause _mcleanup: gmon.out: Permission denied from the get_thread_size host program.
sha256.o, sha3.o, wc_port.o, memory.o, logging.o, and linuxkm_memory.o. WOLFENTROPY_LINUXKM_USE_MUTEXES is set to bypass PIE redirect table mutex.
active).
remain unexported, preventing collisions with libwolfssl.ko.
Updated: libwolfssl.ko glue for external entropy
When libwolfssl.ko is built with -DWC_LINUXKM_WOLFENTROPY_IN_GLUE_LAYER:
Usage
Build entropy module
./configure --enable-linuxkm --enable-wolfentropy --with-linux-src=...
make wolfentropy # produces wolfentropy.ko
Build kernel module linked to external entropy kernel module
./configure --enable-linuxkm --with-linux-src=...
make
Runtime (order enforced by MODULE_SOFTDEP)
modprobe wolfentropy
modprobe libwolfssl
To replicate previous behavior, with libwolfssl.ko housing both the crypto and entropy
./configure --enable-linuxkm --enable-wolfentropy --with-linux-src=...
make
Testing
Tested on customers kernel module
Checklist