fix(libSceAjm.native): validate Vorbis setup packet lengths #15021
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15021"
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 MarcZX10 on 2026-11-02T10:39:19Z.
What
sceAjmDecWVorbisCreateHeaderPacketbuilds the Vorbis header table from the setup packet, but it did not validate the setup packet lengths:setupPacketSize - part1truncated to 16 bits. A setup packet larger than0xFFFFbytes produced a table that did not match the copied packet. Such packets are now refused withAJM_WVORBIS_ERROR_INVALID_SETUPbefore anything is written.setupPacketSize, the subtraction wrapped and a garbage length was written. Such packets are now refused withAJM_WVORBIS_ERROR_INVALID_SETUP.Commits: two
fix(libSceAjm.native)commits, each followed by itstest(libSceAjm.native)commit.Tested
Ubuntu host, throwaway archive build via the shared build lock:
ctest -R '^guest_ajm_wvorbis$'on the head commit: 1/1 passed.Not run against the unfixed code (no negative control was run on this PR).
Not run on Windows, macOS or console.
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-02T11:33:29Z.
Review: APPROVED
Reviewed the current head
dd18eea3b1. The two length checks prevent truncation of the 16-bit table field and subtraction underflow before output is written. The exact-head Hosted Windows build and required checks pass.