fix(relinker): contain explicit module dirs #18000
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18000"
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 DonRyuzaki on 2026-11-10T03:25:45Z.
What
--module-dirchecked that a requested path was lexically beneath the guest module parent, then followed directory symlinks while scanning. A link inside the parent could point to an outside directory: the relinker accepted it, read an external PRX, and staged the converted module underapp0.Resolve the existing parent and requested directory to canonical paths before scanning. Reject a requested directory whose resolved path is outside the parent, while preserving links that resolve to a directory inside it. This check applies to explicit
--module-dirpaths; the automaticsce_module,sce_modules, andprxdirectories are unchanged.The regression checks direct and nested links to an external directory for Linux and
--windowsoutput. It also converts through a link to an inside directory as a positive control.Tested
Ubuntu 24.04 on WSL2, x86-64, GCC 13.3.0, CMake 3.28.3, relinker-only Ninja build. Branch head
a7cef341daa30bf24710e4c290c33d35d5a04193, based on upstreammain017bd95f5f53192c82eba8917d91f1c5fd1376de. The isolated WSLcore/relinkersource matched this head byte for byte before the build.test_guest_module_dir.pyfails against the preceding relinker binary at--module-dir linked: it exits 0, converts the outsideplugin.prx, and prints anapp0/linked/plugin.prx.guest.prxlayout. That binary'sNativeModules.cppGit blob is85fd4731e54e9e1b1b53114d685b06bc1001c40b, identical to this PR's base.nice -n 10 cmake --build <isolated-build> --target relinker --parallel 2: passed, compiling the changedNativeModules.cppand linking the relinker.ctest --test-dir <isolated-build> -R '^guest_module_dir$' --output-on-failure: 1/1 passed.ctest --test-dir <isolated-build> -R '^(guest_module_dir|guest_module_directories|guest_needed_modules)$' --output-on-failure: 3/3 passed.python tools/check_conventions.py --base origin/main: passed after rebasing.git diff --check origin/main...HEAD: clean.tools/pr_overlap.pycould not run becauseghis unavailable in this environment. I checked the current open PRs that mentionNativeModules.cppthrough GitHub: #17536 changes missing-module hints after line 142, and #17538 changes exclusion filtering after line 100. Their patches do not touch this PR's explicit-directory validation at lines 80–92. No native Windows build, title, or game runtime was tested.Checklist
main; no other open PR implements the same functions