Do not forward fw 5.02 AppContent RPCs to an older service #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-drakmor/dlc_emu!1
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/appcontent-fw502-rpc-hang"
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?
Forwarding an unsupported AppContent RPC to the firmware's
SceAppContentservice hangs the console.app_rpc_invokeis a synchronous IPMI invoke with no timeout, so a command the running firmware does not implement never completes: the calling thread blocks forever and the watchdog reboots. There is no error to detect and no way to probe for support, because an unsupported command hangs rather than returning.Three commands arrived with fw 5.02 and hang on anything older:
0x20010sceAppContentDownloadDataGetBlockSize0x20023sceAppContentDownload2Shrink0x20024sceAppContentDownload2ExpandThey are part of one feature: a third download-data area (
/download2) plus its block-size query.Reproduced on Call of Duty MW2 (PPSA23012) on fw 4.03, which calls
Download2Expandduring first-run setup and reboots the console.Measured on fw 4.03:
SceShellCorecontains nodownload2string in any casing, and its download-data subsystem is numbered 0 and 1 only (SceFsckDownloaddata0/1,UnMountDownloadData()/1(),process_download_data.cppandprocess_download_data_1.cpp). The area is never provisioned and the service has no handler for these commands.The fix
Gate the three commands on the running firmware and answer locally with
SCE_APP_CONTENT_ERROR_NOT_SUPPORTEDwhen it predates 5.02. Callers already handle that code — it is one of the codes the service's own result mapper passes through verbatim rather than folding toINTERNAL.compiled_sdk_version()cannot be used for this. It returnsSCE_PROSPERO_SDK_VERSION, a build-time constant describing the SDK the module was compiled against, so it cannot tell one console from another and a gate built on it silently does nothing.sceKernelGetProsperoSystemSwVersionis used instead. It exists on every firmware from 1.00 onward, so a single binary stays correct on old and new alike with no build matrix. It is not declared by any public SDK header and is missing from the SDK'slibkernel_stub_weak.a, so the out-param shape was read off fw 4.03'slibkernel_sysand a link stub is generated the same way this project already generates one forlibSceLibcInternal.libkernel.sprxdoes export the symbol, so only the stub was missing. ps5-payload-sdk declares it the same way.Failing to read the version counts as absent: answering locally costs a graceful
NOT_SUPPORTEDthat callers handle, while forwarding costs an unrecoverable reboot.Also in this change
The comments on
Download2Shrink/Download2Expanddescribed the argument as an opaque download-data handle. It is a size in MiB passed by value — confirmed from the caller, which computes it arithmetically and never dereferences it. Corrected.*blockSizeis deliberately left unwritten on refusal: a negative Sce error means out-params are not read, which is the firmware's own contract.Only
libSceAppContentlinks the new stub; the other two modules do not call the version API.No version bump is included — release numbering left to you.