fix(libkernel): return ENOENT for unknown sysctl names #8910
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8910"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by DoubleAAGuy on 2026-10-21T05:43:15Z.
What
Return
-1/ENOENTinstead of throwing whensysctlbynameorsysctlnametomibcannot resolve a name. A PS5 payload (firmware 12.70) measuredkern.anyps5_no_such_namereturningENOENT; the implementation generalizes this to unknown names, consistent with FreeBSD lookup semantics, without special-casing the observed string. Tests ensure failed lookups leave caller buffers and lengths unchanged. Unknown numeric MIBs retain their current throwing behavior.The exact behavior for other unknown names in title processes is unverified.
Tested
Linux Ubuntu 22.04, aarch64, GCC 11.4:
python3 tools/check_conventions.py --base origin/mainpassed.GuestSystemConfigurationtests.sysctlbynameandsysctlnametomibcalls, includingENOENTand output preservation. The harness supplied stubs for unrelated runtime dependencies.Xext.h. No title run was possible.40680ca1e:guest_system_configurationpassed; baseline failed the new unknown-name assertion as expected. The Windows reviewer reports a focused test, not a title run.Overlap review
python3 tools/pr_overlap.py --branch fix/libkernel-unknown-sysctl-enoent --repo boykopovar/AnyPS5found no confirmed duplicate behavior or overlapping changed lines. PR #8553 also touchessysctlnametomib, but adds measured mappings for four known names in its lookup table; this PR only handles unresolved names after known-name lookup. Its tests and debt hunk are separate. PR #9199 has a documentation hunk overlap on other sysctl entries; its author agreed #8910 can merge first and will rebase #9199 afterwards. PR #6044 movescore/libs/tests/GuestSystemConfiguration.cpp; if it merges first, this test change will need a path rebase.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.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T05:49:06Z.
Review: APPROVED
Reviewed the unknown-name paths and the regression cases. Both
sysctlbynameandsysctlnametomibnow set guestENOENTand return-1without changing output storage or lengths; known-name paths and unknown numeric MIB behavior remain separate. The author reports a focused native smoke test and syntax checks, and clearly limits the console claim to the measured payload name. I did not run a full project build or title test.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T10:34:59Z.
Windows data point for
39a60e421merged ontomainb77bd5880(clean,git merge-treerc 0;mainhas not touchedSystemConfiguration.cpporGuestSystemConfiguration.cppsince the merge base1aad07054): Windows 10.0.19045, MinGW-w64 GCC 15.2.0, Release.ctest -N -R '^guest_system_configuration$'lists exactly that one test;ctest --no-tests=errorwas run three times on the PR tree.guest_system_configurationfails 3 of 3, exit code0xc0000409(abort).mainalone: the same test passes.I located the failing check by building a local copy of the test with the line number printed in
Require: it is theRequire(threw)inCheckNameToMibright aftertooLong[1023] = 0;(line 783 of the merged file). That case expectssysctlnametomib_nid_postfixto throwstd::runtime_errorfor a 1023-character name that is not served; I did not analyse how the change interacts with it. The newCheckUnknownSysctlNameruns before it inmainand was not the failing check.Not tested: Linux, a title run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by DoubleAAGuy on 2026-10-21T10:54:16Z.
Thanks, that is a valid catch. The 1,024-character input still returns
ENAMETOOLONG; after truncating it to 1,023 characters it is an ordinary unresolved name, so the new behavior isENOENT. I updated the regression test to expect that and verify the output MIB remains untouched, then pushed commit0c62af6cc. GCC syntax checks and the focused native smoke test pass; I cannot run the full CTest/Windows test here. Could you rerunguest_system_configurationon Windows when convenient?Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-23T03:02:34Z.
Review: APPROVED
Review: PR #8910
Head:
92e4d060b058d134c9efa7bc2ef8351dc51ce23aEnvironment: Windows 11, MinGW64 toolchain, Python 3.11.9
Test Profile:
guest_system_configurationVerification Summary
✅ Baseline build & test: Passed (head
b7d1d47a5f9f32c9c388ad8d47a0055a90ae6e33)✅ Pristine PR build & test: Passed (head
92e4d060b058d134c9efa7bc2ef8351dc51ce23a)✅ Candidate build & test: Passed (head
92e4d060b058d134c9efa7bc2ef8351dc51ce23a)✅ Negative control: Correctly failed against baseline, confirming old throwing behavior
✅ Whitespace check: Passed
✅ Conventions check: Passed
Source Verification
The changes at
SystemConfiguration.cpp:455-456and518-519correctly:*__error_nid_postfix() = 2(ENOENT)-1without modifying output buffers or lengthsTest coverage in
GuestSystemConfiguration.cppadequately verifies:Limitations
guest_system_configurationprofile onlyNo actionable findings in this focused review. The changed unknown-name paths follow the existing libkernel errno/return-value convention.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T06:13:51Z.
Review: APPROVED
Re-reviewed the rebased exact head
40680ca1e3df696f2382d03847608a1f5c0a7273. The three-commit change still returns-1/ENOENTfor unresolved names insysctlbynameandsysctlnametomib, preserves caller buffers and lengths, and keeps known-name handling and unknown numeric MIB behavior separate. The focused Windowsguest_system_configurationrun on this exact head is reported passing; current hosted eligibility/conventions/labels/report checks pass and product build jobs are skipped by policy. My localgit diff --checkand conventions pass; current-main sync is conflict-free (3 ahead/15 behind by local commit count). I did not run a full build or title test. The change remains limited to a measured payload result generalized to unknown names, with title behavior explicitly unverified.