fix(libSceGLSlimVSH): copy generated GL object names out through a checked write #20804
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20804"
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-15T15:48:54Z.
What
glGenBuffers,glGenTextures,glGenFramebuffersandglGenRenderbuffersall go through the sharedGenerate_nid_no_patchhelper. That helper wrote the new names into the guest output array withstd::copy, so an array pointing at unmapped memory faulted the host. The library's debt file already lists this, noting thattools/guest_pointer_audit.pycan't see it.The helper already builds the names in a host vector. It now copies that vector out with one
GuestCopyOut_nid_no_patchand only then commits the reserved names to the object map. An unwritable array setsGL_OUT_OF_MEMORY(0x0505), the code the debt entry names, and leaves the object map unchanged, so a later call gets the same names. Valid calls and the existing negative-count and oversized-count errors are unchanged.The debt entry is rewritten through a
## changefragment underdocs/dev/debt/changes/. It records 0x0505 as a host-safety fallback, since console behaviour here is not measured.Tested
Linux (Ubuntu 26.04.1), GCC 15.2, Release.
guest_glslim_state(GuestPointerFaults), new cases:glGenBuffers(2, 0x10)sets 0x0505 and leaveserrnoat 71. The nextglGenBuffers(1, ...)returns the same name a valid call returned just before, after that name was deleted, so the failed call reserved nothing.glGenTextures,glGenRenderbuffersandglGenFramebufferswith0x10set 0x0505.guest_glslim_stateandguest_glslim_query_surface,guest_glslim_eglgetconfigsandguest_glslim_ipc_returnsstill pass.State.hppfrommainwith these tests dies with SIGSEGV at address0x10.tools/check_conventions.pypasses on the branch and this body.tools/debt_fold.py --checkpasses with the fragment applied.git merge-treeis clean againstmain, #14212, #20798 and #20802.mainpassesdebt_fold.py --check.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)