Repository navigation
Conversation
…enshot sceShareCaptureScreenshot stored -1 through req_id after only a null check, so an unmapped or read-only pointer faulted the host. The write now goes through GuestCopyOut_nid_no_patch, as sceShareGetCurrentStatus does, and an unwritable pointer returns ERROR_INVALID_PARAM. A null pointer still returns ERROR_NOT_SUPPORTED without a write.
…creenshot An unmapped request ID pointer must return ERROR_INVALID_PARAM instead of faulting the host. Without the copy-out fix the call writes to address 0x10 and the test process crashes.
…oClip sceShareCaptureVideoClip stored -1 through req_id after only a null check, so an unmapped or read-only pointer faulted the host. It now uses the same guarded copy-out as sceShareCaptureScreenshot, and an unwritable pointer returns ERROR_INVALID_PARAM.
…ideoClip An unmapped request ID pointer must return ERROR_INVALID_PARAM instead of faulting the host. Without the copy-out fix the call writes to address 0x10 and the test process crashes.
…rs from the guest sceShareCaptureScreenshotExtended read param->size and then wrote the request ID directly, so an unmapped parameter block or request ID pointer faulted the host. The parameter block is now copied in with GuestCopyIn_nid_no_patch and the request ID is written through the guarded copy-out. An unreadable block or unwritable pointer returns ERROR_INVALID_PARAM, as a null pointer already did.
…enshotExtended An unmapped parameter block and an unmapped request ID pointer must both return ERROR_INVALID_PARAM. Without the copy fix the call reads address 0x10 and the test process crashes.
…s from the guest sceShareCaptureVideoClipExtended read the parameter block and wrote the request ID directly, so an unmapped pointer faulted the host. The block is now copied in with GuestCopyIn_nid_no_patch and the request ID goes through the guarded copy-out before the field checks, as before. An unreadable block or unwritable pointer returns ERROR_INVALID_PARAM.
…oClipExtended An unmapped parameter block and an unmapped request ID pointer must both return ERROR_INVALID_PARAM. Without the copy fix the call reads address 0x10 and the test process crashes.
… string through a guest copy sceShareSetContentParamForApplicationTitle scanned the title byte by byte from the guest pointer, so an unmapped pointer faulted the host. The string is now copied with CopyGuestString_nid_no_patch, limited to 5120 bytes. An unreadable pointer, an empty title or one without a terminator within 5120 bytes returns ERROR_INVALID_PARAM, as before.
…amForApplicationTitle An unmapped title pointer must return ERROR_INVALID_PARAM. Without the guest-copy fix the call reads address 0x10 and the test process crashes.
…nters The copy-out and copy-in fallbacks added to the capture, request ID and title exports return ERROR_INVALID_PARAM for unreadable or unwritable guest memory. What the console returns for those pointers is not measured, so the debt entries say so. The non-extended capture exports had no entry and now have one.
Contributor
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Guest pointers in four
libSceShareexports were dereferenced directly after at most a null check, so an unmapped or read-only pointer faulted the host instead of returning an error. Sibling exports in the same file (sceShareGetCurrentStatus,sceShareGetRunningStatus) already useGuestCopyOut_nid_no_patch.sceShareCaptureScreenshotandsceShareCaptureVideoClip: thereq_idwrite goes through a guarded copy-out (helperWriteRequestIdInvalid). An unwritable pointer returnsERROR_INVALID_PARAM; a null pointer still returnsERROR_NOT_SUPPORTEDwithout a write.sceShareCaptureScreenshotExtendedandsceShareCaptureVideoClipExtended: the parameter block is copied in withGuestCopyIn_nid_no_patchbeforesizeand the fields are read, and the request ID is written through the guarded copy-out. An unreadable block or unwritable pointer returnsERROR_INVALID_PARAM, as a null pointer already did.sceShareSetContentParamForApplicationTitle: the title is read withCopyGuestString_nid_no_patch(maximum 5120 bytes). The accepted range is unchanged (1 to 5119 bytes); an unreadable pointer returnsERROR_INVALID_PARAM.The fallbacks for unreadable or unwritable memory are host-protection choices. Console behaviour for those pointers is not measured and is recorded in
docs/dev/debt/libSceShare.md.Commits: four fix/test pairs, one per export (the helper is added with the first call site), and a final docs commit for the debt entries.
Possible conflict:
docs/dev/debt/libSceShare.mdis also changed by #14212 (blank lines between entries). The two may conflict textually in the Unknown function info section; the content is different.Tested
python3 tools/check_conventions.py --base upstream/mainpassed;git diff --check upstream/mainclean;test_public_headers.py --audit-onlypassed (406 libraries, 30604 exports);tools/pr_precheck.py(no-build) passed diff, conventions, ABI-audit and test-quality checks, and reports "checks incomplete" only because builds are excluded.tools/pr_overlap.pydid not complete against the live API): open PRs touchinglibSceSharefiles were checked; test(libSceAudioIn): audit microphone mute state bounds, stream format and sampling rate rejection #15899 changes onlylibSceShare/CMakeLists.txt, docs(debt): separate entries with blank lines and drop derived export totals #14212 touches the debt doc only as described above.ctest -R '^guest_share$'(targetguest_share_tests). It is queued behind other builds on the shared lock; no result exists for this head yet.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)