SP 800-90B verdict preservation & APT/RCT compliance fixes - #11506
Open
kaleb-himes wants to merge 11 commits into
Open
kaleb-himes wants to merge 11 commits into
kaleb-himes wants to merge 11 commits into
Conversation
|
kaleb-himes
force-pushed
the
PQ-FS-2026-Part3-SecurityReview-nofallback-T
branch
from
September 21, 2026 01:53
0edd3ee to
b04410c
Compare
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
What it does
Preserves SP 800-90B verdicts (ENTROPY_RT_E / ENTROPY_APT_E) through reseed instead of flattening them to RNG_FAILURE_E; instantiate already did this. Fixes a defect where a stuck source reported -294 at instantiate but -199 at reseed.
Fixes the APT: the cutoff was fixed at 325 for every window, unreachable in the 132-byte reseed and 196-byte instantiate seeds, so both APT loops were dead code. Cutoff is now per window size (101 at 132, 140 at 196, 325 at 512), satisfying IG D.K Res 16 (C ≤ W).
Replaces the sliding all-symbols scan with the literal SP 800-90B 4.4.2 test: reference sample, non-overlapping windows, cutoff derived for that test.
Re-adds all-values coverage as a 4.3 Req 1c additional developer-defined test, with its own derived cutoff at alpha/256 (union bound over the alphabet: 105 / 146 / 334). Implemented as a majority vote, so no histogram, no allocation, nothing to zeroize.
Short trailing windows slide back to full length; no window is formed when its cutoff could not be reached.
linuxkm: the DRBG reinit-and-retry path now treats a seed health-test alarm as recoverable, alongside RNG_FAILURE_E. DRBG_CONT_FIPS_E is deliberately excluded (catastrophic, must not retry).
In wc_linuxkm_drbg_generate()'s loop, when wc_RNG_GenerateBlock() returns one of the three codes, the kernel does not ignore the failure and retry the same state. It:
breaks out if any bytes were already delivered (if (slen > 0) break;), so a partially served request never gets a second, differently-seeded half;
retries at most once (retried flag), then breaks to -EIO;
only retries when it may block (can_wait);
recovers by calling wc_rng_bank_inst_reinit(), which frees and re-instantiates the instance, i.e. a fresh wc_InitRng with fresh entropy, not a resumption of the condemned state.
How it maps to the standards
Testing
How it was tested
Checklist
Note to self:
Security Policy needs two lines: H=1 is a deliberate floor, and the per-seed alpha is 2^-29 (two tests over one window).