Repository navigation
fix(libSceGnmDriverForNeoMode): write the draw packets and the coredump mode through guest copies - #24012
Merged
oneandonlydean merged 1 commit intoNov 20, 2026
Conversation
…mp mode through guest copies
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
sceGnmDrawIndexMultiInstanced,sceGnmDrawOpaqueAutoandsceGnmGetCoredumpModewrote their answer through the guest pointer they were handed.cmdbuf[0] = …stores into the address the guest supplied, so it only lands in the guest's command buffer while that address is also host-addressable; every neighbouring export in the same file already builds the packet in a local array and hands it back through the file'sWriteCommandBufferhelper orGuestCopyOut_nid_no_patch.WriteCommandBuffer<13>/WriteCommandBuffer<7>helper, which copies the buffer in, edits the local copy and copies it back. Words the console leaves alone stay untouched, which is what the existing expectations inguest_gnm_neo_packetspin (Uafter the trailing NOP).sceGnmGetCoredumpModewrites its answer throughGuestCopyOut_nid_no_patchand reports1, the answer it already gives for a null pointer, when the guest buffer cannot be written.tools/guest_pointer_audit.pyon this branch:libSceGnmDriverForNeoMode3 findings → 0, whole tree 2646 → 2643.Tested
Ubuntu 24.04 base (Linux Mint 22.1), GCC 13.3.0, Ninja, Release, x86_64, no GPU.
cmake --build build-libs --target guest_gnm_neo_packets_tests guest_gnm_neo_retail_tests, thenctest --test-dir build-libs -R '^guest_gnm_neo': 6/6 passed.CheckUnwritableOutputsincore/libs/tests/GuestGnmNeoPackets.cpphands all three exports an unmapped buffer (0x10) and requires the refusal. Mutation probe: with the library change reverted and the new case kept,guest_gnm_neo_packetsfails withSEGFAULT; with the change it passes.python3 tools/check_conventions.py --base origin/main:All conventions checks passed.python3 tools/pr_overlap.py --branch contrib/gnmneo-guest-packet-copies --jobs 8over 2023 open pull requests:3 share files or exports with the branch, thencannot confirm overlap with PR 17711: core/libs/prx/libSceGnmDriverForNeoMode/Export.cpp. feat(libSceGnmDriver): share mode-independent command writers #17711 conflicts withmain, so the tool cannot compare it; its hunks in that file are@@ -102,17 +103,6 @@and@@ -744,64 +691,23 @@plus one include line, while this change touches lines 325-340, 426-437 and 480-484 — file-level only, no shared hunk. The other two shared-file pull requests were merged into the base for comparison and produced no overlapping hunk (the tool prints no overlap table). The five other open pull requests whose title or body names this library (fix(libSceGnmDriver): write draw packets through guest copies #22138, feat(libSceGnmDriver): expose base draw default state #18206, fix(relinker): honor PS4 needed-module tags #20574, feat(shader): offer a 2D MSAA mode to GCN image loads #21961, fix(libSceSysmodule): accept four PS4-only module ids in a PS4 process #18184) changelibSceGnmDriver/Export*.cpp, another library, or the shader path, not this file.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)