fix(videodec2): validate ClearOutput destinations upfront before mutating output #21081
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21081"
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 Kikoarl on 2026-11-15T20:20:25Z.
What
Validates cleared guest destinations upfront in
ClearOutput(core/libs/prx/libSceVideodec2/Export.cpp), closing the remaining transactional gap after #20614 landed checkedCopyInGuest/CopyOutGuest/auBytes:frame(sizeof(FrameBuffer)) beforeoutput(min(thisSize, sizeof(OutputInfo))) underGuestArena::HostWritepaired withGuestWritable_nid_no_patchwhile preserving callererrno.Videodec2: invalid argument pointerwithout mutating either struct and without openingoutputinHostWritewhenframeis read-only (keeping write-watched output pages clean on Windows as well as Linux). Applies uniformly to bothsceVideodec2Decode_nid_postfixandsceVideodec2Flush_nid_postfix.core/libs/tests/GuestVideodec2HevcAliases.cppwith unreadable/unwritable pointer,errnopreservation, armedGuestArena(std::array<void*, 64>drain loop for 32 pages inkSpan = 0x20000),sceVideodec2Decode/sceVideodec2Flushread-onlyframenon-mutation/non-dirtying, and page-straddling unwritableoutputchecks, plus debt indocs/dev/debt/changes/fix-libSceVideodec2-decode-copyin.md.Tested
BUILD_TESTING=ON), rebased ontoorigin/main(115a7036e2, PR head7b2b577729):ctest --test-dir /tmp/anyps5_verify_build --output-on-failure -R "^(guest_videodec2|guest_videodec2_hevc_aliases|guest_hevc_metadata|guest_videodec2_unimplemented)$": 4/4 passed (0.24 s), includingguest_videodec2_hevc_aliases(0.01 s).python3 tools/debt_fold.py --checkandpython3 tools/check_conventions.py --base origin/main: passed cleanly.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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T22:47:51Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
e1878384d6:tools/check_conventions.pyfailed;git diff --checkclean.guest_videodec2_hevc_aliases_testsbuilt cleanly.guest_videodec2_hevc_aliases):Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T01:48:06Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
e1878384d6cb76c5fd3ac317be2018d213e3ac69usingrepo_read.pyto inspect the prepared diff, the changed files, and relevant helper and caller code. No build or tests were run; the commands in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
files.jsonwas unavailable in the review folder, so excluded paths and any repository-wide review coverage beyond the manifest could not be confirmed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T09:45:11Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change at
3afcb24d6ccfce02bf203c8a0e6bf4dfe2c81d6bhas no verified blocking defect; checks reported by the author were not run in this review.What I ran
Read the prepared description, commit summary, manifest, and diff, then inspected the changed code and relevant guest-memory helper definitions through
repo_read.py. No commands or tests were run.Results
Negative control
Not run during this review. The author reports two negative controls in the PR description; those results were not independently verified.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No tests or negative controls were run here. Console behavior is not verified. The PR description and debt entry identify unchecked access-unit data reads and
EmitDecodedwrites as remaining work; those behaviors were not audited in depth. Read:core/libs/prx/libSceVideodec2/Export.cpp(relevant ranges),core/libs/tests/GuestVideodec2HevcAliases.cpp(full file), anddocs/dev/debt/changes/fix-libSceVideodec2-decode-copyin.md(full file). No changed files were excluded by the manifest.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T11:34:19Z.
Review: APPROVED
Reviewed — looks good
The change validates the caller’s frame and output destinations before clearing output state; the reviewed code has no verified blocking defects.
What I ran
7b2b5777292016e57d0fd8063690452c706c5618.repo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
EmitDecodedmetadata writes remain unmeasured, as the change’s debt note states.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T11:46:53Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
7b2b577729:tools/check_conventions.pypassed.guest_videodec2_hevc_aliases_testsbuilt cleanly.guest_videodec2_hevc_aliases):core/libs/prx/libSceVideodec2/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me