fix(libSceGLSlimVSH): safely probe the version outputs of eglInitialize #20798
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20798"
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:45:17Z.
What
eglInitializestored the version numbers straight into the guestmajorandminorpointers, so a non-null output pointing at unmapped or read-only memory faulted the host.Both values now go through
GuestCopyOut_nid_no_patch. A non-null output that can't be written makes the call returnEGL_FALSEand setEGL_BAD_PARAMETER(0x300c). That is the code the other EGL exports in this file (eglGetConfigs,eglGetConfigAttrib,eglQuerySurface,eglQueryContext) already return for an unwritable output. The display is marked initialized only after both writes succeed. Null outputs are still skipped, and valid calls still return 1.4.The debt entry goes in a fragment under
docs/dev/debt/changes/and marks the error code as a host-safety fallback. What the console does here is not measured.Tested
Linux (Ubuntu 26.04.1), GCC 15.2, Release.
guest_glslim_query_surface: three new cases.EGL_SUCCESS.major(0x1) returnsEGL_FALSEwith error 0x300c.minorpage returnsEGL_FALSEwith error 0x300c.guest_glslim_state,guest_glslim_eglgetconfigsandguest_glslim_ipc_returnsstill pass.Egl.cppfrommainwith the new test failsguest_glslim_query_surface.tools/check_conventions.pypasses on the branch and this body.tools/debt_fold.py --checkpasses with the fragment applied.git merge-treeagainstmainand against #14212 (the only open PR touching this library's files) is clean.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)