sp x86_64: separate lane selection from vector-register ownership - #11422
kaleb-himes wants to merge 14 commits into
Conversation
c046941 to
aea72e2
Compare
|
aea72e2 to
7f0414d
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11422
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Findings: 4
4 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
7f0414d to
c086ede
Compare
c086ede to
59dd1c3
Compare
|
retest this please |
Dismiss to re-request
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11422
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Findings: 1
Required changes (1)
Small-memory signing configuration no longer compiles
File: wolfcrypt/src/wc_mldsa.c:10447
Function: mldsa_sign_with_seed_mu
Category: API contract violations
mldsa_sign_with_seed_mu() calls the new four-argument mldsa_vec_check_low() with two arguments under WOLFSSL_MLDSA_SIGN_SMALL_MEM and WOLFSSL_MLDSA_SIGN_CHECK_W0. Known #6771 instead concerns signing conformance.
Related known finding #6771 (similar but distinct): Both concern optional early-rejection checks in mldsa_sign_with_seed_mu, but this is a mismatched helper-call signature causing a compile failure, while #6771 is a FIPS-conformance deviation caused by the checks themselves; their fixes differ.
Suggested fix: Pass the vector length and &valid, assigning the helper's return value to ret as at the other updated call sites.
Basis: ISO/IEC 9899:2018 §6.5.2.2 requires function-call arguments to agree with the visible prototype.
Referenced code: wolfcrypt/src/wc_mldsa.c:10447-10448 (2 lines)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
bee7a73 to
b1f293d
Compare
Description
Pairs with: https://github.com/wolfSSL/scripts/pull/677
This is a CPU step, not a fallback.
table lookups are SSE2). P-1024 base lane excepted, it has none.
self test in FIPS builds, which resets every CAST to INIT, then calls
wc_RunAllCast_fips() so the new lanes are CAST tested immediately rather
than on first use. This is what the kernel module already does at load.
run, so a regression is caught in tree.
Behavior change: on AVX2-capable x86_64, SP RSA/ECC entry points can
return the vector-register save error instead of silently running the
non-AVX2 lane. Userspace never refuses the save.
Testing
20 test cells, all passing.
Builds and gates
suite on each.
proving the pre-change file still differs.
settings enable none of it, and with those settings it compiles to zero
symbols. Windows gets no code from this change.
Refused saves must fail, never switch lanes
in a non-FIPS build and again against the real FIPS v7 module. Every call
fails; results after the injection stops match those from before it, so
the fixed point cache is not left half built.
failing, a quarter alternating: 750 clean results and 450 refusals, every
clean result matching the reference. Non-FIPS and FIPS.
CPU feature change
Proven with a witness algorithm the test program never calls, which goes
from never run to passed purely because of the flag change.
the module healthy afterwards.
Real kernels
with the in-kernel crypto test, booted twice, once with AVX2 visible and
once with it hidden so the non-AVX2 lanes run. Both pass the power-on self
test, pass the in-kernel test, re-verify at unload and unload clean, with
no kernel warnings.
every one reported the error, no crash and no kernel warning.
AMD EPYC and Intel Xeon, each running the FIPS test suite, the feature
change check, the forced failure check, and the FIPS kernel module loading
with the power-on self test and the in-kernel test, then unloading clean.
shared by Intel, aarch64, 32-bit Arm and PowerPC, so the FIPS build with
the Arm assembly lanes runs the test suite and the feature change check
there too.
Checklist