Repository navigation
fix(libkernel): support kern.rng_pseudo MIB access - #7554
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Thanks for checking the evidence scope. I updated the description to say the trailing-component |
9e68861 to
bb1f502
Compare
|
Rebased onto current Validation on head
The rebased commit retains the existing MarcZX100 author identity. Hosted PR checks have not appeared yet. |
jotitadev
left a comment
There was a problem hiding this comment.
Reviewed head bb1f50265. One problem in the new test: one check fails at random.
core/libs/tests/GuestSystemConfiguration.cpp:399:
Require(length == 63 && shortBuffer[62] != 0xaa && shortBuffer[63] == 0xaa);shortBuffer[62] is the last byte copied from std::random_device, so it equals 0xaa with probability 1/256. When it does, guest_system_configuration aborts. The implementation is correct in that case.
I checked it with a standalone copy of the new {1, 50} handler and CopyOut, plus this check, built with Apple clang on arm64 (M2 Max, macOS 27.2). It failed 3995 times in 1,000,000 runs (0.40%, against 1/256 = 0.39%).
The test only needs to show that bytes were copied into the first 63 positions, so something like this would do:
Require(length == 63 && std::any_of(shortBuffer, shortBuffer + 63, [](unsigned char byte) { return byte != 0xaa; }) && shortBuffer[63] == 0xaa);The other random checks in CheckPseudoRandomMibSysctl (changed over 64 bytes, and the memcmp of two reads) fail with probability around 256^-64. Those are fine.
AI-assisted: yes (Claude Code)
bb1f502 to
df30c16
Compare
02dd70e to
7e7ba58
Compare
|
Fixed on rebased head |
7e7ba58 to
a414976
Compare
a414976 to
99e87ce
Compare
|
Rebased onto current |
What
Add the measured
kern.rng_pseudonumeric MIB{1, 50}tosysctland map the name throughsysctlnametomib. The PS5 firmware 12.70 payload probe output and sources attached to #7542 show that this numeric path matches the name-based call: a size query reports 64 bytes, reads return up to 64 bytes, a short buffer or a non-null buffer without a length returnsENOMEM, and a null buffer with a null length succeeds. Successful reads preserveerrno.Writes through this MIB were not measured, so they throw. The current generic leaf-MIB handling returns
ENOTDIRfor a trailing component after{1, 50}. The PS5 response to that longer MIB was not measured, so this is not claimed as console behavior.The overlap checker reports nearby insertions in #6220, #7070 and #7541, plus the
kern.rng_pseudodebt line changed in #7542. These PRs implement separate behavior; I asked their authors to coordinate merge order in comments. This change does not depend on their code.Tested
Linux:
g++ -std=c++20 -fsyntax-onlypassed forSystemConfiguration.cppandGuestSystemConfiguration.cpp. A smoke harness compiled and ran the changed implementation, covering name-to-MIB mapping, size query, a 64-byte read, short buffer/ENOMEM, null pointer cases,errnopreservation and the trailing-component error.Not run: the full project build and
guest_system_configurationCTest. CMake configuration could not complete in the fresh worktree because the SDL2 submodule is not initialized and this host lacks SDL's XRandR development support.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)