fix(apr): reject submissions beyond buffer capacity #5553
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5553"
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 cookie42073-cmd on 2026-10-13T23:43:32Z.
What
Hi, this is Blazing Cook.
APR submission passes the recorded length to the executor and queued copy without checking the object's capacity. A buffer containing two valid writes, with its declared capacity reduced to the first write, still executes both. This checks the original descriptor before
_submit, so all three submission exports reject an offset beyond capacity without executing commands, consuming an ID or changing the result/ID outputs.This follows up on the remaining submission-capacity check from item 2 of #3321. The error uses the exports' existing
-1/guestEINVALpath. Native PS5 behavior for a corrupted opaque buffer remains unverified and is recorded in technical debt. No title unblock is claimed.Tested
Windows x64, MinGW-w64 GCC 15.2.0, Release, Tracy disabled.
Tested base:
d1670009fbfdfe57f8f26ee09ced77fe6b18c2ca. Fix:0081a8bd9277973ed09034521c574daefc4ec0d5.guest_ampr_markersregression fails on the upstream APR implementation because it returns success and executes both writes; it passes with the two submission guards. The test covers all three exports with an idle queue and with a blocked command ahead, unchanged outputs/backing/object fields, no consumed submission ID, exact capacity and empty buffers.libstarget; seven selected CTest tests:guest_ampr_markers,guest_ampr_threads,guest_amm_placement,guest_memory,guest_addresses,guest_mlock,guest_mutex_contention. All passed. The registered APR regression also passed five consecutive runs with normal process exit.An auxiliary short-process probe intermittently hangs during Windows DLL teardown. The same unchanged valid-submission control reproduces it on
d1670009and the fixed runtime; debugger stacks put it in libkernel CRT detach duringLdrShutdownProcess. That separate exit issue is not fixed here. The registered regression completes normally. Linux, native PS5 and commercial games were not tested.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T00:22:22Z.
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.
main)docs/dev/debt/libkernel.mdL13docs/dev/debt/libkernel.mdL13Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:25:25Z.
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.
Pull request closed