fix(libSceUsbStorageDialog): validate guest parameters readability in sceUsbStorageDialogOpen #16051
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16051"
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-05T13:10:41Z.
What
Safely validate guest parameter readability via
GuestCopyIn_nid_no_patchinsceUsbStorageDialogOpen. If the suppliedparampointer points to unmapped or unwritable memory, returnCOMMON_DIALOG_ERROR_ARG_NULL(0x80B8000D) while preserving guesterrno. Validation checks are performed directly on the copied local parameter struct (local.base), avoiding repeated reads from guest memory.Documented in
docs/dev/debt/libSceUsbStorageDialog.mdunder### Host-safety fallback.Tested
guest_usb_storage_dialog_tests:sceUsbStorageDialogOpen(nullptr)returnsCOMMON_DIALOG_ERROR_ARG_NULL.sceUsbStorageDialogOpen(0x10)returnsCOMMON_DIALOG_ERROR_ARG_NULLacross uninitialized, initialized, and running states.python tools/check_conventions.py --base origin/mainpasses with 0 errors.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 mashingaan on 2026-11-07T11:21:51Z.
Review: APPROVED
The copy-in plus the guestAddress-aware ValidateCommonDialogBaseParam keep the magic check on the caller's address, and the errno save/restore around GuestCopyIn is correct. The null and 0x10 cases are covered. No findings.