Repository navigation
fix(libkernel): match write throttling status failure - #26453
oneandonlydean merged 2 commits into
Conversation
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 1c800fb025:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_filesystem_testsbuilt cleanly. - CTest (
guest_filesystem):1/1 Test #5934: guest_filesystem ................. Passed 0.64 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libkernel/File/src/Stdio.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/1 Test #5934: guest_filesystem .................Subprocess aborted***Exception: 0.65 sec 0% tests passed, 1 tests failed out of 1 - Code reading:
- Verified sceKernelWriteThrottlingStatus pointer validation: checks nullptr first returning SceErrorFromErrno(GUEST_EINVAL) (0x80020016), then calls GuestWritable_nid_no_patch(status, 4 * sizeof(*status)) returning SceErrorFromErrno(GUEST_EFAULT) (0x8002000e) on unmapped addresses like 0x10.
- Verified non-mutating behavior matches real PS5 payload process measurement: on valid 32-byte status buffer, returns SCE_KERNEL_ERROR_ESRCH (0x80020003) without modifying caller memory.
- Verified AGENTS.md compliance: no comments added to Stdio.cpp, proper debt fragment added in docs/dev/debt/changes/fix-libkernel-write-throttling-status.md documenting measured payload behaviour and known gaps.
- Verified cross-platform 64-bit portability (LP64 vs LLP64): status is std::uint64_t* and size is 4 * sizeof(*status) (32 bytes), matching buffer expectations without type narrowing or platform-dependent width issues.
- Verified test coverage in GuestFilesystem.cpp: tests valid non-mutated buffer preserving sentinels with ESRCH, nullptr with EINVAL, and unmapped address with EFAULT.
Looks Good To Me
|
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.
|
catminou4
left a comment
There was a problem hiding this comment.
Built libkernel and ran guest_filesystem_tests on Linux (x86-64, GCC 11): passes.
Control — reverted Stdio.cpp to origin/main, kept the updated test: the test aborts. On main, sceKernelWriteThrottlingStatus returns 0 and writes fabricated values (UINT32_MAX, 0, 0, 0), which is exactly the "made-up success" the repo conventions forbid; the updated test requires the measured ESRCH (0x80020003) return and an untouched buffer.
This is a console-measured fix (PS5 firmware 11.60): a valid 32-byte status buffer returns ESRCH and leaves the four qwords alone, a null pointer returns EINVAL, and the buffer is only probed with a non-mutating GuestWritable check. The debt fragment is exemplary — it records the exact measured return codes, explains why PPSA17221 still selects the same highest write-budget tier on the failure path, and is honest that the hardware meaning of the status qwords and title-process behavior are unknown. Correct, mergeable fix.
|
Overlap follow-up on machine |
|
Maintainer-ready evidence for exact head |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change matches the reported firmware 11.60 payload result for a valid 32-byte status buffer; the changed implementation and regression assertions are consistent with that behavior.
What I ran
Reviewed head 1c800fb0253a7ccdbb50e5f484a21eca1ce261ea using the prepared diff and the pinned repository reader. No commands or tests were run during this review.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Implementation and regression assertions read |
| Test execution | not run | Only author-reported results are available |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR description reports a Windows 11 CI VM build, focused test repetitions, a negative control, and convention and debt checks; I did not run or independently verify those checks. I read all three changed files listed in the manifest. No files were excluded.
To get this to a good state
Nothing is required.
|
Fresh current-main integration check on machine I manually checked the shared-path changes since the PR's old base. Current Windows 11 / MSYS2 UCRT64 GCC 16.2 / Ninja / Release on the current-main preview: This is an integration-preview validation, not a new PR head. I left the published branch unchanged: exact head |
…r26453-main-20261127
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
ligmaSec
left a comment
There was a problem hiding this comment.
The GuestFilesystem fixture coverage passed on Linux with the exact implementation from this head. The fixture checks the write-throttling failure code and verifies that the output buffer remains intact.
AI-assisted: yes.
What
sceKernelWriteThrottlingStatusnow follows the PS5 payload-process result already recorded in libkernel debt instead of fabricating a successful unlimited status.For a valid 32-byte output, firmware 11.60 returned
SCE_KERNEL_ERROR_ESRCH(0x80020003) and left the buffer untouched. This change returns that result after a non-mutating guest writeability check. A null output keeps the measuredEINVALresult, and an unmapped non-null output keeps the existingEFAULThost-safety fallback.The focused filesystem regression now requires
ESRCHand verifies all four sentinel qwords remain unchanged. The debt fragment records the measured payload behavior, the unmeasured title/fault boundary, and that PPSA17221 chooses the same highest write-budget tier on call failure as it did from the previous fabricatedUINT32_MAXsuccess.The branch-overlap helper failed closed because older PRs touch the broad
Stdio.cpp/GuestFilesystem.cppfiles. I manually compared every reported branch: #6936, #7121, #7447, #9293, #9297, #9302, #9371, #12682, #12688, #12700, #12965 and #15037. None implements the measuredsceKernelWriteThrottlingStatusbehavior; their copies retain either the older direct-write success or the current guarded fabricated success.Tested
Machine
vm, Windows 11 CI VM, WinLibs MinGW-w64 GCC 15.2.0, Ninja, Release,BUILD_TESTING=ON, exact tree published as head1c800fb0253a7ccdbb50e5f484a21eca1ce261ea:mainf4c9a67f581bc9d4e50f5aa97fd7765e10f4d593;guest_filesystem_testscleanly;ctest --test-dir build -R '^guest_filesystem$' --output-on-failure --repeat until-fail:3: 3/3 passed;Stdio.cppfrom the exact base while keeping the new test, rebuilt, andguest_filesystemaborted at the new throttling assertion (line 853, exit0xc0000409);tools/debt_fold.py --check: passed;tools/check_conventions.py --base origin/main --head HEAD: passed;git diff --check: passed.The GitHub-published commit has the same three blob SHAs as the locally built/tested commit.
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)Summary by CodeRabbit