fix(import-audit): inspect sectionless guest module imports #4415
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4415"
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 MrMha on 2026-10-12T10:21:59Z.
What
Addresses #4202 by auditing each guest module's own imports and needed libraries, including sectionless PS4/PS5 and SysV/GNU tables. Strip symbol suffixes, resolve against sibling modules and built libraries, and name the importing module in text and JSON. Unsupported or malformed inputs fail explicitly.
Tested
Linux x86-64, GCC 13.3, Python 3.12: 190 tool tests pass, including 43 import-audit tests; conventions and whitespace checks pass. The compiled ELF fixture uses SysV, GNU and both hash styles and is restricted to Linux, because Windows/macOS compilers emit PE/Mach-O. Portable module-table fixtures still run on all hosts. The relinker CI matrix passes on Linux, Windows and macOS at commit
79b0392690. Full runtime builds were skipped by the PR workflow; no retail-title or full-runtime test is claimed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by arcwiser on 2026-10-12T12:29:45Z.
Independent Windows validation on head
79b039269: Python 3.10.11, all 43 import-audit tests pass; check_conventions.py and git diff --check also pass. I also checked the stripped/sectionless-module identity edge while comparing this with the older #4202 carry: read_modules records every successfully parsed module name before classification, so registry imports naming a sectionless module remain classed as module while that module's own imports are still audited through the dynamic tables. I found no issue in that path.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T13:00:19Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)tools/tests/test_import_audit.pyL3-4tools/import_audit.pyL193-194, L246, L250, L253-261, L266-267, L272, L313-316, L348, L364-365, L368tools/tests/test_import_audit.pyL23, L32, L34, L36, L39, L114tools/import_audit.pyL368tools/tests/test_import_audit.pyL154tools/tests/test_import_audit.pyL46Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:22:10Z.
Closing: a module's own imports are already audited from its
app.<module>.registry.json, and nothing here shows a module where that audit misses one. Reopen with a real module and the import it misses.Imported from boykopovar/AnyPS5. Originally posted by MrMha on 2026-10-13T09:24:22Z.
Further discussion needs the real missed-import example requested by the maintainer.
Imported from boykopovar/AnyPS5. Originally posted by MrMha on 2026-10-14T11:02:16Z.
Fresh public-module validation on macOS arm64 / Python 3.12.14, using ProsperoRadio PPSA99001 v01.000.010. This check found a rejection in the unchanged PR head, rather than a missed import on the inspected main.
Input: official release ZIP, SHA-256
413011fcaf2cee3b1ce796388f3c9b13d3a0ac2e1a1a2b5bc5bba1adcd0fc020. Its realsce_module/libc.prxis an unencrypted/uncompressed public fSELF. I mapped its payload segments to ELF offsets using the public SDK layout, clearing metadata for the omitted section table. Instruction and dynamic-table payloads were preserved; scripts and hashes are included below.read_moduleson that module3e577edac2159830bd3befff32b3690fd54cfcfelibSceLibcInternal.prx,libSceSysmodule.prx,libkernel.prx79b0392690d626108a90728bd9d11006faca4061AuditError: conflicting dynamic tag 0x61000045The real module contains three entries for that tag:
0x101010000a6cf,0x201010000a6f0,0x301010000a72d. The PR reader rejects them while collecting all non-DT_NEEDEDtags into one unique-value dictionary.Fresh unchanged import-audit suites: main 59 pass / 2 platform skips, PR 41 pass / 2 platform skips. The public-module rejection is outside those fixtures. The current-main relinker also builds locally with AppleClang 21, Release, relinker-only mode, and converts the reconstructed public executable/module with
--registry. No title was executed and no system-library completeness or real missed-import result is claimed.Current main already includes module-import auditing (6054923, acd821f). This input therefore supports leaving the unchanged PR closed: it does not provide the missed-import example requested for reopening, and it exposes a regression that would need correction if any remaining useful change were carried.
Reproduction:
python3 reproduce_module_reader.py --zip PPSA99001.zip --main <source-at-3e577eda> --pr <source-at-79b03926>. The reproduction below checks the archive hash and emits the reader results; no binaries or assets are uploaded.AI-assisted: yes (Codex).
Standalone reproduction script (Python 3.12)
Save as
reproduce_module_reader.pyand use the command above. It requires the official release ZIP and the two pinned source trees.Pull request closed