fix(libSceAgc): safely probe output pointers in packet info exports #20051
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20051"
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 pushkarreddyy on 2026-11-14T13:59:32Z.
What
Safely probe output pointers in
core/libs/prx/libSceAgc/Misc/src/PacketInfo.cppexports (sceAgcGetDataPacketPayloadAddress_0090,sceAgcGetDataPacketPayloadAddress,sceAgcGetDataPacketPayloadRange,sceAgcDcbGetSystemSoftwareVersion) viaGuestCopyOut_nid_no_patchbefore writing output data.If an output pointer or range points to unwritable guest memory, throw through
Agc::Command::Requirewith a descriptive error instead of crashing the host process with a segmentation fault.Unit tests in
core/libs/prx/libSceAgc/tests/PacketInfo.cppcover nominal paths, type 0/1 packet payloads and ranges, zero-mask payloads, null output rejections, and unwritable pointer rejections.Tested
Windows 11 x86_64, unit tests in
core/libs/prx/libSceAgc/tests/PacketInfo.cppcovering:sceAgcDcbGetSystemSoftwareVersion: nominal version extraction, too-short packet rejection, invalid header rejection, null pointer rejection, and unwritable destination rejection.sceAgcGetDataPacketPayloadAddress_0090andsceAgcGetDataPacketPayloadAddress: type 1 payload offset, type 0 masked offset, type 0 zero mask null payload, null pointer rejection, and unwritable output rejection.sceAgcGetDataPacketPayloadRange: type 1 payload range, type 0 range with header offset, type 0 zero mask empty range, null pointer rejection, and unwritable range rejection.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)