fix(libSceAppContent): safely probe guest initialization and query pointers #18947
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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-12T15:18:54Z.
Description
In
core/libs/prx/libSceAppContent/Export.cpp, several exports directly dereference guest-supplied input and output pointers without verifying their accessibility viaGuestCopyIn_nid_no_patch/GuestCopyOut_nid_no_patch:sceAppContentInitialize:initParam->reservedandbootParam->reserved1/2viastd::all_ofand executesstd::memset(bootParam, 0, sizeof(*bootParam)).SCE_APP_CONTENT_ERROR_PARAMETER.sceAppContentGetPftFlag:*pftFlag = 0;without probing guest memory.sceAppContentGetAddcontInfoListByIroTag:*hitNum = 0;without probing guest memory.sceAppContentTemporaryDataGetAvailableSpaceKb:mountPoint->datadirectly and writes*availableSpaceKb = ...without probing.Following the host safety precedent established in #18598 (
sceAppContentTemporaryDataMount2), these entry points should safely probe guest pointers preserving callererrnoacross copy faults and returnSCE_APP_CONTENT_ERROR_PARAMETERon invalid memory, backed by unit tests incore/libs/tests/GuestAppContent.cpp.