Repository navigation
Conversation
This was referenced Oct 13, 2026
…tropy
kern.rng_pseudo and kern.arandom (MIB {1, 37}) were the last guest
entropy sources still drawing from std::random_device, one call per
byte. They now use HostEntropy_nid_no_patch (getentropy, rand_s on
Windows) like arc4random, /dev/random and sceRandomGetRandomNumber
since boykopovar#4200. Lengths, EPERM on writes and the throw without an output
buffer are unchanged; the two libkernel debt entries name the source.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
winstrex
force-pushed
the
fix/sysctl-host-entropy
branch
from
October 13, 2026 17:51
5b6f07f to
30be5dd
Compare
11 tasks done
11 tasks done
Collaborator
|
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line. |
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.
What
Follow-up to #4200.
kern.rng_pseudoandkern.arandom(MIB {1, 37} and itssysctlbynamename, both added by #3700) were the last guest entropy sources still drawing from astatic std::random_device, one call per output byte. They now fill the buffer withHostEntropy_nid_no_patch(getentropy,rand_son Windows), likearc4random,/dev/randomandsceRandomGetRandomNumbersince #4200.Only the entropy source changes.
kern.rng_pseudostill fills*oldLengthbytes and leaves the length as it was, returnsEPERMfor a write and throws without an output buffer;kern.arandomstill returnsmin(*oldLength, 256)bytes, reports that size for a null buffer and returnsEPERMfor a write. The twodocs/dev/debt/libkernel.mdentries now name host OS entropy instead ofstd::random_device.On the AMD EPYC 9V45 runner measured in #4200, a
std::random_devicecall took about 23.5 µs, so one call per byte cost about 1.5 ms for the 64-byte blocks mbedTLS askskern.rng_pseudofor and 6 ms for a 256-bytekern.arandomread.Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release.
guest_system_configuration(CheckPseudoRandomSysctl,CheckArandomSysctl),guest_posix_random,guest_randomandguest_crtpass.EPERM, the throw, two reads that differ) pass before and after. No test I could write fails without the change on the machines I have.python tools/check_conventions.py --base upstream/mainpasses.build.yml(run 38423102411): Windows passes; Linux passes exceptguest_math, which fails the same way onmain's own Linux runs (for example a74f2ef, 3989003 and 7656615) and does not touch these sysctls.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)