test(relinker): cover Sony segment bounds and overflow handling #14121
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14121"
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 slopgobblercobbler on 2026-10-31T19:43:42Z.
What
Expands boundary and overflow test coverage in
core/relinker/relinker/tests/ElfReaderBoundsTests.cppfor Sony ELF segment types (PT_SCE_DYNLIBDATA,PT_SCE_RELA,PT_SCE_LIBVERSION):SonySegmentFixtureandRejectSegmenttest helpers to construct and validate ELF images carrying Sony segment types.PT_LOAD, disjoint ranges, and upper 64-bit boundaries) confirming rejection viaRelinkerExceptionwithout segfaulting.std::memmovefor overlapping ranges.Tested
elf_reader_bounds_tests(ctest --test-dir build -R elf_reader_bounds -V): all test cases passed (100% pass rate)._rangeFitsto unconditionally returntruetriggers expected failures in unaligned offset overflow, segment table bounds overflow, unaligned table offset, and empty segment bounds tests.TranslateVirtualAddressto match non-PT_LOADsegments triggers expected failure inSony segment invalid virtual addresses.python tools/check_conventions.py --base upstream/main --head HEAD: passed with 0 findings.git diff --check upstream/main...HEAD: clean (exit 0).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-10-31T20:22:03Z.
Review: APPROVED
Reviewed — looks good
The updated tests now use
std::memmovefor the overlapping table fixture and the repository’sPT_SCE_DYNLIBDATAname; the relinker CI matrix and ASan pass on this head.What I ran
Reviewed head
fc04d8e9c3b4648498971d68b9a3d50702c6a257against base500d37a747c2b958e8696aa16213a0ee78d47505. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run CTest locally.Results
core/relinker/CMakeLists.txtand CTest (elf_reader_bounds)core/relinker/CMakeLists.txt; registration verified thereelf_reader_bounds_testscases passed; I did not independently reproduce this local run.Raw output from local checks
Negative control
_rangeFits; separately allowTranslateVirtualAddressto match non-PT_LOADsegmentsFindings
Blocking: None found.
Non-blocking: The test-quality warning is a confirmed false positive; the CMake file registers the test executable and the
elf_reader_boundsCTest.Sources
Not verified
I did not independently rerun the author’s 46-case CTest command or mutation controls. Hosted relinker and ASan jobs passed; Linux/Windows product jobs were skipped.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T05:36:34Z.
Review: APPROVED
Reviewed — looks good
Nothing in the reviewed test changes shows a blocking defect, and the added cases exercise Sony segment parsing and bounds handling.
What I ran
Reviewed head
6b56631192b7fbcfcf1046b866942639af33b51e. I read the prepared description, commit list, manifest, diff, and the changed test file; no commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Test execution and the reported negative-control, conventions, and diff checks were not independently verified. No files were excluded by the review manifest.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T12:26:04Z.
Review: APPROVED
Reviewed — looks good
The added boundary tests appear consistent with the stated goal, and the full changed test file was reviewed at head
ce0a7ac5a016ddec073df0ea33a55c37eb9b1ff0.What I ran
No commands were run; the repository reader was unavailable as a plain command in this session. I read the prepared diff and the full changed test file through the pinned-head reader.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The prepared bundle contains one changed file, and its full head text was read:
core/relinker/relinker/tests/ElfReaderBoundsTests.cpp. No files were excluded. Build and test execution, the reported negative controls, conventions, and diff checks were not independently verified.To get this to a good state
Nothing is required.