You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
linuxkm/linuxkm_wc_port.hlinuxkm/lkcapi_sha_glue.clinuxkm/simd_hammer/simd_hammer.c.wolfssl_known_macro_extras: fixes for removal of stdrng alg from the LKCAPI.
gate crypto/internal/rng.h inclusion and "stdrng" alg registration on kernel
<7.5 (<linux-next of 20261110).
add WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG with override WOLFSSL_LINUXKM_LKCAPI_NO_STDRNG.
add dummy macro variant of wc_linux_kernel_rng_is_wolfcrypt().
add gating on WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG as needed throughout linuxkm/lkcapi_sha_glue.c.
add a HAVE_STDRNG indicator macro to linuxkm/simd_hammer/simd_hammer.c and
gate the "rng" probe on it. also add a runtime report of the instantiated RNG
driver name, and a warning if it isn't wolfCrypt.
note, on !WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG builds, there’s no longer a deinstall_algs prerequisite before rmmod.
bound the digSz in wc_EncodeSignature(), and catch zero (error) return from it
in wc_SignatureDerEncode(). Add test coverage to rsa_sig_test().
linuxkm/lkcapi_rsa_glue.c: add digest length checks to the pkcs1 sign callbacks,
matching those in the verify callbacks since ff93e6d and 8fef82c, by
factoring the common argument validation into km_pkcs1_check_digest_len().
tests/api/test_tls.c: skip test_tls_unset_fd_no_stdin_io() if defined(HAVE_VALGRIND).
…er/simd_hammer.c .wolfssl_known_macro_extras: fixes for removal of stdrng alg from the LKCAPI.
* gate crypto/internal/rng.h inclusion and "stdrng" alg registration on kernel
<7.5 (<linux-next of 20261110).
* add WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG with override
WOLFSSL_LINUXKM_LKCAPI_NO_STDRNG.
* add dummy macro variant of wc_linux_kernel_rng_is_wolfcrypt().
* add gating on WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG as needed throughout
linuxkm/lkcapi_sha_glue.c.
* add a HAVE_STDRNG indicator macro to linuxkm/simd_hammer/simd_hammer.c and
gate the "rng" probe on it. also add a runtime report of the instantiated RNG
driver name, and a warning if it isn't wolfCrypt.
* note, on !WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG builds, there’s no longer a
deinstall_algs prerequisite before rmmod.
…c wolfcrypt/test/test.c doc/dox_comments/header_files/asn_public.h:
bound the digSz in wc_EncodeSignature(), and catch zero (error) return from it
in wc_SignatureDerEncode(). Add test coverage to rsa_sig_test().
… callbacks,
matching those in the verify callbacks since ff93e6d and 8fef82c, by
factoring the common argument validation into km_pkcs1_check_digest_len().
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active issues include a compilation failure in the kprobe configuration without stdrng, phantom registration accounting that blocks deinstallation, and a header guard that prevents wolfCrypt RNG recognition.
Scan targets checked:linuxkm-src, linuxkm-bugs, wolfcrypt-src, wolfcrypt-bugs, wolfssl-bugs Not reviewed (no scan target covers them):.wolfssl_known_macro_extras, doc/dox_comments/header_files/asn_public.h Coverage: 9 of 9 in-scope changed file(s) opened by the reviewer
Findings: 3 3 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
linuxkm/linuxkm_wc_port.h and linuxkm/lkcapi_sha_glue.c: fix scoping of wc_linux_kernel_rng_is_wolfcrypt();
linuxkm/lkcapi_sha_glue.c: fix dummy call to wc_linuxkm_drbg_startup() to leave wc_linuxkm_drbg_loaded defined;
wolfcrypt/src/asn_orig.c: check digSz against actual size of digArray.
Scan targets checked:linuxkm-src, linuxkm-bugs, wolfcrypt-src, wolfcrypt-bugs Unchanged since last review (not re-run):wolfssl-bugs Not reviewed (no scan target covers them):.wolfssl_known_macro_extras, doc/dox_comments/header_files/asn_public.h Coverage: 2 of 3 in-scope changed file(s) opened by the reviewer; not opened: wolfcrypt/src/asn_orig.c
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The unload notice is hidden for no-STDRNG builds with random-bytes callbacks, although those builds still require deinstall_algs to release the module reference and allow rmmod; the PR description also needs qualification.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Keep the unload notice for callback-backed no-STDRNG builds
linuxkm/lkcapi_sha_glue.c:5828
With WOLFSSL_LINUXKM_LKCAPI_NO_STDRNG and random-bytes callbacks enabled, rmmod still fails because the supplied kernel patches retain a module reference until the callbacks are unregistered. This guard hides the deinstall_algs instruction needed to release that reference. Retain the unload notice for callback-backed builds too, and qualify the PR description's claim that no-STDRNG builds no longer require this step.
The reason will be displayed to describe this comment to others. Learn more.
Findings marked 🟡 are optional suggestions and need no follow-up push.
Additional findings (outside the current diff — GitHub can't attach inline comments there):
🟡 linuxkm/lkcapi_sha_glue.c — nit: On no-stdrng builds for kernels before 7.1, a failed default-bank checkout at startup leaves the bank and its entropy daemon running until a later cleanup. The guard at 5814-5815 still tests only LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0). Every sibling < 7.1 guard in this change gained && defined(WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG). Fix: make the condition (LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)) || !defined(WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG), so it matches the #else branch at 5764 that initialized local_default_bank.
Why this was flagged
The trigger is a build with WOLFSSL_LINUXKM_LKCAPI_NO_STDRNG on a kernel older than 7.1 (for example the 6.15 no-stdrng targets in the PR description) and LINUXKM_LKCAPI_REGISTER_HASH_DRBG_DEFAULT. wc_linuxkm_drbg_startup takes the #else /* >= 7.1.0 || !WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG */ branch at 5764 and initializes local_default_bank through wc_linuxkm_rng_bank_init at 5790. If wc_rng_bank_default_checkout or checkin then fails, the error path at 5814-5815 skips wc_linuxkm_rng_bank_fini(default_bank), because that guard still requires kernel >= 7.1. Startup returns -ECANCELED while the default bank and its entropy daemon are still live. Teardown is delayed until linuxkm_lkcapi_unregister runs wc_linuxkm_drbg_cleanup (wc_linuxkm_drbg_loaded was already set at 5797). The install_algs sysfs path at lkcapi_glue.c:284 does not unregister on failure. This is an inconsistency on an error path, not a permanent leak.
Verification: The checkout/checkin error path at lkcapi_sha_glue.c:5813-5821 was not updated. Its fini is still guarded only by (LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)) (5815), so on these kernels it returns -ECANCELED without calling wc_linuxkm_rng_bank_fini(default_bank). On the base branch this could not happen, because kernels older than 7.1 always took the stdrng path.
* in km_rsa_set_key(), return -EBADMSG for a key that fails to decode, matching
the in-tree rsa-generic, and -ENOMEM on allocation failure; update the
rejected-setkey probes in the self-testers to match.
* fix the self-testers for WOLFKM_DEBUG_RSA_GENERIC: when testing the in-tree
drivers, expect the kernel's default (key-size) crypto_sig_digestsize(), and
skip the sign digest length probe on the akcipher pkcs1pad, which doesn't
check it.
…ot review of the stdrng purge PR.
* gate the definitions of wc_linuxkm_rng_bank_init(), wc_linuxkm_rng_bank_fini(),
linuxkm_get_drbg(), linuxkm_put_drbg(), and wc_linuxkm_drbg_generate() on the
disjunctions of their callers' gates, fixing -Werror=unused-function in
!WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG builds against kernels without the
get-random-callbacks patch (reproduced on unpatched 5.11 with
WOLFSSL_LINUXKM_LKCAPI_NO_STDRNG).
* wc_linuxkm_drbg_startup(): rework the default-bank checkout/checkin error
path -- key the unwind on a new local_default_bank_inited ownership flag
rather than on kernel-version/config gates (the old gate skipped
wc_linuxkm_rng_bank_fini() in no-stdrng pre-7.1 builds, leaving the bank and
its entropy daemon running until delayed cleanup); log fini failures rather
than ignoring them; null out default_bank so the delayed cleanup's fini arm
degrades to a guarded no-op; and in !WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG
builds roll wc_linuxkm_drbg_loaded back to 0, mirroring the gate where it
was set (in stdrng builds it stays set, so that delayed cleanup can
unregister the still-registered alg).
* add a comment on the CONFIG_CRYPTO_FIPS arm of the default-bank setup noting
that on >=7.1 <7.5 kernels, crypto_stdrng_get_bytes() resolves to the
top-priority stdrng iff fips_enabled.
Scan targets checked:linuxkm-src, linuxkm-bugs, wolfssl-bugs Unchanged since last review (not re-run):wolfcrypt-src, wolfcrypt-bugs Not reviewed (no scan target covers them):.wolfssl_known_macro_extras, doc/dox_comments/header_files/asn_public.h Coverage: 3 of 3 in-scope changed file(s) opened by the reviewer
Findings: 1 1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Callback-enabled builds hide required unload instructions despite remaining in use, while consuming kernel modules incorrectly report that the RNG is not wolfCrypt on affected pre-7.5 configurations.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Expose the hash-DRBG availability check to consuming modules
linuxkm/linuxkm_wc_port.h:2336
WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNG is defined inside BUILDING_WOLFSSL, so consuming kernel modules select the constant-zero macro even on pre-7.5 kernels with hash-DRBG-default enabled. Their calls therefore report that the RNG is not wolfCrypt instead of invoking the implementation. Make this condition available to consumers too, using the same registration, container, kernel-version, and disable-override checks.
Retain unload instructions when random-byte callbacks pin the module
linuxkm/lkcapi_sha_glue.c:5843
With WOLFSSL_LINUXKM_LKCAPI_NO_STDRNG and the patched-kernel random-byte callbacks enabled, this guard hides the unload instructions even though rmmod still reports the module as in use. Callback registration pins THIS_MODULE until unregistration (linuxkm/patches/7.3/WOLFSSL_LINUXKM_HAVE_GET_RANDOM_CALLBACKS-7v3.patch:63,158). Retain the deinstall_algs notice for callback-enabled builds and qualify the PR description's no-prerequisite claim accordingly.
Scan targets checked:linuxkm-src, linuxkm-bugs Unchanged since last review (not re-run):wolfcrypt-src, wolfcrypt-bugs, wolfssl-bugs Not reviewed (no scan target covers them):.wolfssl_known_macro_extras, doc/dox_comments/header_files/asn_public.h Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Running [fips-ready:v5.X.X] on boz-amd (attempt 1/3)
[...]
git clone --branch=master git@github.com:wolfssl/wolfssl
Cloning into 'wolfssl'...
Sending interrupt signal to process
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
script returned exit code 128
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
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.
linuxkm/linuxkm_wc_port.hlinuxkm/lkcapi_sha_glue.clinuxkm/simd_hammer/simd_hammer.c.wolfssl_known_macro_extras: fixes for removal ofstdrngalg from the LKCAPI.gate
crypto/internal/rng.hinclusion and "stdrng" alg registration on kernel<7.5 (<linux-next of 20261110).
add
WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNGwith overrideWOLFSSL_LINUXKM_LKCAPI_NO_STDRNG.add dummy macro variant of
wc_linux_kernel_rng_is_wolfcrypt().add gating on
WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNGas needed throughoutlinuxkm/lkcapi_sha_glue.c.add a
HAVE_STDRNGindicator macro tolinuxkm/simd_hammer/simd_hammer.candgate the "rng" probe on it. also add a runtime report of the instantiated RNG
driver name, and a warning if it isn't wolfCrypt.
note, on !
WOLFSSL_LINUXKM_LKCAPI_HAVE_STDRNGbuilds, there’s no longer adeinstall_algsprerequisite beforermmod.wolfcrypt/src/asn.cwolfcrypt/src/asn_orig.cwolfcrypt/src/signature.cwolfcrypt/test/test.cdoc/dox_comments/header_files/asn_public.h:bound the
digSzinwc_EncodeSignature(), and catch zero (error) return from itin
wc_SignatureDerEncode(). Add test coverage torsa_sig_test().linuxkm/lkcapi_rsa_glue.c: add digest length checks to the pkcs1 sign callbacks,matching those in the verify callbacks since ff93e6d and 8fef82c, by
factoring the common argument validation into
km_pkcs1_check_digest_len().tests/api/test_tls.c: skiptest_tls_unset_fd_no_stdin_io()ifdefined(HAVE_VALGRIND).tested with