fix(libkernel): return ENOENT for measured absent sysctl MIBs #7556

Merged
MarcZX10 merged 3 commits from upstream-pr/7556 into main 2026-10-20 11:23:08 +00:00
MarcZX10 commented 2026-10-18 13:49:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T13:49:55Z.


What

sysctl now returns -1 with ENOENT for four exact kern.* MIBs measured on a PS5 payload process (firmware 12.70): {1, 2147482816, 2147482814} (kern.smp.maxcpus), {1, 2147483151} (kern.stackprot), {1, 2147483182, 2147483181} (kern.sched.name) and {1, 2147482838, 2147482834} (kern.timecounter.hardware). The measured read and size-query calls leave the buffer and length unchanged, including calls with a null buffer, a null length, or both null. The evidence and full probe logs are in #7541.

This adds the four numeric sysctl cases that #7541 documents as still throwing. It does not add name-to-MIB mappings or infer write behavior: writes to these exact MIBs continue to throw because the console probes did not test writes. Longer MIBs remain unsupported.

The regression covers all four MIBs for reads, size queries, null output-pointer combinations, unchanged outputs, and the unmeasured write path.

Tested

  • Compiled SystemConfiguration.cpp with g++ -std=c++20 -Icore/libs -Icore.
  • A focused runtime smoke harness linked against that compiled implementation and passed the four MIB cases, output preservation, null-pointer variants, unmeasured writes, and a longer unknown MIB.
  • python3 tools/check_conventions.py --base upstream/main and git diff --check pass.
  • python3 tools/pr_overlap.py --branch codex/libkernel-sysctl-mib-enoent reports no overlap with open pull requests.
  • Full CMake configuration and CTest were not available: the SDL2 submodule is not populated in this checkout, and the host lacks SDL XRandR development support. No PS5/title run was performed locally.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4909623637 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7556). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T13:49:55Z. --- ### What `sysctl` now returns `-1` with `ENOENT` for four exact `kern.*` MIBs measured on a PS5 payload process (firmware 12.70): `{1, 2147482816, 2147482814}` (`kern.smp.maxcpus`), `{1, 2147483151}` (`kern.stackprot`), `{1, 2147483182, 2147483181}` (`kern.sched.name`) and `{1, 2147482838, 2147482834}` (`kern.timecounter.hardware`). The measured read and size-query calls leave the buffer and length unchanged, including calls with a null buffer, a null length, or both null. The evidence and full probe logs are in [#7541](https://github.com/boykopovar/AnyPS5/pull/7541). This adds the four numeric `sysctl` cases that #7541 documents as still throwing. It does not add name-to-MIB mappings or infer write behavior: writes to these exact MIBs continue to throw because the console probes did not test writes. Longer MIBs remain unsupported. The regression covers all four MIBs for reads, size queries, null output-pointer combinations, unchanged outputs, and the unmeasured write path. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Compiled `SystemConfiguration.cpp` with `g++ -std=c++20 -Icore/libs -Icore`. - A focused runtime smoke harness linked against that compiled implementation and passed the four MIB cases, output preservation, null-pointer variants, unmeasured writes, and a longer unknown MIB. - `python3 tools/check_conventions.py --base upstream/main` and `git diff --check` pass. - `python3 tools/pr_overlap.py --branch codex/libkernel-sysctl-mib-enoent` reports no overlap with open pull requests. - Full CMake configuration and CTest were not available: the SDL2 submodule is not populated in this checkout, and the host lacks SDL XRandR development support. No PS5/title run was performed locally. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-18 14:06:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T14:06:59Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6936 docs/dev/debt/libkernel.md L228
PR 8255 docs/dev/debt/libkernel.md L228

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.

Pull request Shared files not compared
PR 4630 docs/dev/debt/libkernel.md
PR 5021 docs/dev/debt/libkernel.md
PR 6044 core/libs/tests/GuestSystemConfiguration.cpp
PR 6149 docs/dev/debt/libkernel.md
PR 6469 docs/dev/debt/libkernel.md
PR 6519 docs/dev/debt/libkernel.md
PR 6658 docs/dev/debt/libkernel.md
PR 6740 docs/dev/debt/libkernel.md
PR 6977 docs/dev/debt/libkernel.md
PR 7049 docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7332 docs/dev/debt/libkernel.md
PR 7437 docs/dev/debt/libkernel.md
PR 7464 docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7530 docs/dev/debt/libkernel.md
PR 7541 core/libs/prx/libkernel/System/src/SystemConfiguration.cpp
core/libs/tests/GuestSystemConfiguration.cpp
docs/dev/debt/libkernel.md
PR 7605 docs/dev/debt/libkernel.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250863756 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7556#issuecomment-6250863756). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-18T14:06:59Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6936](https://www.github.com/boykopovar/AnyPS5/pull/6936) | `docs/dev/debt/libkernel.md` [L228](https://github.com/boykopovar/AnyPS5/blob/8afd6ea478a19932563ed6ddf304307c960de310/docs/dev/debt/libkernel.md#L228) | | | | [PR 8255](https://www.github.com/boykopovar/AnyPS5/pull/8255) | `docs/dev/debt/libkernel.md` [L228](https://github.com/boykopovar/AnyPS5/blob/8afd6ea478a19932563ed6ddf304307c960de310/docs/dev/debt/libkernel.md#L228) | | | 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. | Pull request | Shared files not compared | |---|---| | [PR 4630](https://www.github.com/boykopovar/AnyPS5/pull/4630) | `docs/dev/debt/libkernel.md` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `docs/dev/debt/libkernel.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestSystemConfiguration.cpp` | | [PR 6149](https://www.github.com/boykopovar/AnyPS5/pull/6149) | `docs/dev/debt/libkernel.md` | | [PR 6469](https://www.github.com/boykopovar/AnyPS5/pull/6469) | `docs/dev/debt/libkernel.md` | | [PR 6519](https://www.github.com/boykopovar/AnyPS5/pull/6519) | `docs/dev/debt/libkernel.md` | | [PR 6658](https://www.github.com/boykopovar/AnyPS5/pull/6658) | `docs/dev/debt/libkernel.md` | | [PR 6740](https://www.github.com/boykopovar/AnyPS5/pull/6740) | `docs/dev/debt/libkernel.md` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `docs/dev/debt/libkernel.md` | | [PR 7049](https://www.github.com/boykopovar/AnyPS5/pull/7049) | `docs/dev/debt/libkernel.md` | | [PR 7105](https://www.github.com/boykopovar/AnyPS5/pull/7105) | `docs/dev/debt/libkernel.md` | | [PR 7149](https://www.github.com/boykopovar/AnyPS5/pull/7149) | `docs/dev/debt/libkernel.md` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `docs/dev/debt/libkernel.md` | | [PR 7437](https://www.github.com/boykopovar/AnyPS5/pull/7437) | `docs/dev/debt/libkernel.md` | | [PR 7464](https://www.github.com/boykopovar/AnyPS5/pull/7464) | `docs/dev/debt/libkernel.md` | | [PR 7509](https://www.github.com/boykopovar/AnyPS5/pull/7509) | `docs/dev/debt/libkernel.md` | | [PR 7530](https://www.github.com/boykopovar/AnyPS5/pull/7530) | `docs/dev/debt/libkernel.md` | | [PR 7541](https://www.github.com/boykopovar/AnyPS5/pull/7541) | `core/libs/prx/libkernel/System/src/SystemConfiguration.cpp`<br>`core/libs/tests/GuestSystemConfiguration.cpp`<br>`docs/dev/debt/libkernel.md` | | [PR 7605](https://www.github.com/boykopovar/AnyPS5/pull/7605) | `docs/dev/debt/libkernel.md` |
MarcZX10 commented 2026-10-18 14:46:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T14:46:07Z.


Clarified the debt entry in aa3d15c60: it now states that sysctlnametomib still throws for these four names, while #7541 implements mappings for nine of the other names. git diff --check passes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251258622 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7556#issuecomment-6251258622). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T14:46:07Z. --- Clarified the debt entry in `aa3d15c60`: it now states that `sysctlnametomib` still throws for these four names, while #7541 implements mappings for nine of the other names. `git diff --check` passes.
blawesom commented 2026-10-18 16:25:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-18T16:25:03Z.


Rebase handoff — rebased onto current main (both commits, authorship unchanged). Two docs-debt conflicts: your sysctl MIB entry (with its #7541 reference) and main's newer entries reconciled.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the two known main regressions — agc_driver_tessellation (Mesa, #5444) and agc_driver_bda_device (#7584, the fresh #5859 BDA-anchor regression, which fails on this machine too) — neither from this PR.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7556
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is d5efd803f.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252259803 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7556#issuecomment-6252259803). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-18T16:25:03Z. --- **Rebase handoff** — rebased onto current `main` (both commits, authorship unchanged). Two docs-debt conflicts: your sysctl MIB entry (with its `#7541` reference) and `main`'s newer entries reconciled. Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): builds; conventions pass; **full suite green apart from the two known `main` regressions** — `agc_driver_tessellation` (Mesa, #5444) and `agc_driver_bda_device` (#7584, the fresh #5859 BDA-anchor regression, which fails on this machine too) — neither from this PR. **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/7556 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Head is `d5efd803f`.
MarcZX10 commented 2026-10-18 18:14:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T18:14:31Z.


Thanks for preparing the rebase and running the Linux suite. I rebased the two existing commits onto current main at 505767380 and pushed the updated branch. The conflict was limited to docs/dev/debt/libkernel.md; I kept the current entries and the PR's measured MIB coverage. Both commits remain authored and committed by MarcZX10. check_conventions.py and git diff --check pass locally. Your earlier Linux suite result applies to the equivalent patch before this rebase; the fresh hosted run currently passes eligibility and conventions, while the path-filtered Linux, Windows, register-context and relinker suites are skipped. The report job is still pending.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253393261 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7556#issuecomment-6253393261). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T18:14:31Z. --- Thanks for preparing the rebase and running the Linux suite. I rebased the two existing commits onto current `main` at `505767380` and pushed the updated branch. The conflict was limited to `docs/dev/debt/libkernel.md`; I kept the current entries and the PR's measured MIB coverage. Both commits remain authored and committed by MarcZX10. `check_conventions.py` and `git diff --check` pass locally. Your earlier Linux suite result applies to the equivalent patch before this rebase; the fresh hosted run currently passes eligibility and conventions, while the path-filtered Linux, Windows, register-context and relinker suites are skipped. The report job is still pending.
MarcZX10 commented 2026-10-20 10:13:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T10:13:16Z.


Rebased onto current main (02fb1ce532) and kept the new VM-map sysctl support and its tests alongside this PR’s measured absent-MIB behavior. The conflict in SystemConfiguration.cpp was resolved by retaining both the absent-MIB matcher and main’s VM-entry implementation; the test file auto-merged.\n\nOn the updated tree, GCC syntax checks pass for SystemConfiguration.cpp and GuestSystemConfiguration.cpp; conventions and git diff --check pass. Full CMake/CTest remains unavailable here because the checkout lacks SDL2 and XRandR development dependencies. Hosted checks are starting now.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288606631 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7556#issuecomment-6288606631). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T10:13:16Z. --- Rebased onto current `main` (`02fb1ce532`) and kept the new VM-map sysctl support and its tests alongside this PR’s measured absent-MIB behavior. The conflict in `SystemConfiguration.cpp` was resolved by retaining both the absent-MIB matcher and main’s VM-entry implementation; the test file auto-merged.\n\nOn the updated tree, GCC syntax checks pass for `SystemConfiguration.cpp` and `GuestSystemConfiguration.cpp`; conventions and `git diff --check` pass. Full CMake/CTest remains unavailable here because the checkout lacks SDL2 and XRandR development dependencies. Hosted checks are starting now.
adriadam10 commented 2026-10-20 11:23:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T11:23:45Z.


Checked the four exact MIBs against the measurements in #7541, the null-pointer/unchanged-output cases and the write path (still throws, unmeasured); the test fails without the change and the debt entry matches #7541. Rebase onto current main (the kern.proc.vmmap helpers) done by the author with both blocks kept; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6289747536 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7556#issuecomment-6289747536). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-20T11:23:45Z. --- Checked the four exact MIBs against the measurements in #7541, the null-pointer/unchanged-output cases and the write path (still throws, unmeasured); the test fails without the change and the debt entry matches #7541. Rebase onto current `main` (the `kern.proc.vmmap` helpers) done by the author with both blocks kept; merged.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7556
No description provided.