fix(libSceGnmDriver): safely probe the command buffer in the VGT control writers #20423
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20423"
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 milescoviello on 2026-11-15T05:43:10Z.
What
sceGnmSetVgtControlandsceGnmResetVgtControl(the_nid_disambig1exports of libSceGnmDriver) stored their three-dword packet withcmdbuf[0..2] = ..., so a non-nullcmdbufpointing at unmapped memory faulted the host. Both now build the packet on the host and write it with oneGuestCopyOut_nid_no_patch, returning -1 (their refusal for a null or wrongly sized buffer) when the write fails.The argument checks, the
sceKernelIsNeoModechoice between the base and Neo encodings, and the packet words are unchanged.Only the libSceGnmDriver exports change. The libSceGnmDriverForNeoMode
sceGnmSetVgtControl/sceGnmResetVgtControlare left alone because #16238 rewrites them; the new test cases therefore run only for thenormalprovider. The debt entry records the unmapped-memory result as a host-safety fallback; console behaviour there is not measured.Tested
Linux (Ubuntu 26.04.1), GCC 15.2, Release.
guest_gnm_vgt_normal_baseandguest_gnm_vgt_normal_neo: both writers given the unmapped buffer0x10with size 3 return -1.errnois not asserted, sincesceKernelIsNeoMode, which both call before writing, already changes it on every call.ctest -R '^guest_gnm_vgt_': 6/6 pass (thejson/nonemetadata modes and the Neo provider are unchanged).tools/check_conventions.pypasses on the branch and this body.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 MarcZX10 on 2026-11-15T05:54:59Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the packet encoding remains unchanged and the writers now return -1 when the guest copy fails.
What I ran
Reviewed head
72a75c6062ae9dc24a3c36694dafde5193fefc6ffrom the prepared diff and source reader. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author-reported Linux/GCC test results were not independently run. Console behavior for unmapped memory remains unmeasured, as documented. The complete 877-line export file was not read; relevant includes and changed writer functions were read. All three changed files listed in the manifest were read.
files.jsonwas not available through the reader.To get this to a good state
Nothing is required.