fix(relinker): resolve LibreSSL import module aliases #13472

Closed
kyon-eth wants to merge 3 commits from upstream-pr/13472 into main
kyon-eth commented 2026-10-30 16:25:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kyon-eth on 2026-10-30T16:25:15Z.


What

Match the two observed LibreSSL import-module spellings to their declared dependencies: libSceLibreSSl3 to libSceLibreSsl3.prx, and libSceLibreSSL to libSceLibreSsl.prx. Previously these imports lost their qualified dependency association because the names differ in case. Other names keep the existing matching rules; the two library versions remain distinct and ambiguous matches still fail.

The first pairing is present in both version-labelled WebKit and curl images; the second is present in the 3.20-labelled inventory. Those labels do not authenticate firmware provenance. No title unblock is claimed.

This branch builds on #13143 and includes its commits; it must land after that PR and be rebased before merge.

Tested

  • Preserves the existing normalized-dependency match before trying the new alias; the guest-reader test includes a regression for a -module dependency.

  • The mapping applies only in the observed direction; a regression case verifies that importing the physical provider name does not select the logical-name library. The updated macOS guest-reader test passes.

  • macOS x86-64: built the relinker-only import_module_tests target and ran import_module, including a guest-image-reader fixture for the LibreSSL 3 spelling, both aliases, version separation and ambiguity rejection.

  • A focused probe fails on the #13143 base and passes with this change. Conventions and diff whitespace checks pass.

  • The overlap checker could not compare shared CMake changes from the parent PR against #5021, #7173, #7531, #9793, #10792, #10861, #11628, #11661, #11689 and #11698 because those branches conflict with main. Their CMake diffs do not reference this test target. The overlap checklist is left unchecked pending complete comparison.

  • No Linux, Windows, console or title run; no full product build.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #13143
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5087575262 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13472). Originally posted by [kyon-eth](https://github.com/kyon-eth) on 2026-10-30T16:25:15Z. --- ### What Match the two observed LibreSSL import-module spellings to their declared dependencies: `libSceLibreSSl3` to `libSceLibreSsl3.prx`, and `libSceLibreSSL` to `libSceLibreSsl.prx`. Previously these imports lost their qualified dependency association because the names differ in case. Other names keep the existing matching rules; the two library versions remain distinct and ambiguous matches still fail. The first pairing is present in both version-labelled WebKit and curl images; the second is present in the 3.20-labelled inventory. Those labels do not authenticate firmware provenance. No title unblock is claimed. This branch builds on #13143 and includes its commits; it must land after that PR and be rebased before merge. ### Tested - Preserves the existing normalized-dependency match before trying the new alias; the guest-reader test includes a regression for a `-module` dependency. - The mapping applies only in the observed direction; a regression case verifies that importing the physical provider name does not select the logical-name library. The updated macOS guest-reader test passes. - macOS x86-64: built the relinker-only `import_module_tests` target and ran `import_module`, including a guest-image-reader fixture for the LibreSSL 3 spelling, both aliases, version separation and ambiguity rejection. - A focused probe fails on the #13143 base and passes with this change. Conventions and diff whitespace checks pass. - The overlap checker could not compare shared CMake changes from the parent PR against #5021, #7173, #7531, #9793, #10792, #10861, #11628, #11661, #11689 and #11698 because those branches conflict with main. Their CMake diffs do not reference this test target. The overlap checklist is left unchecked pending complete comparison. - No Linux, Windows, console or title run; no full product build. ### Checklist - [ ] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #13143 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
CnRJay commented 2026-11-01 19:51:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:51:18Z.

Review: COMMENTED


Neutral note: this is the third of a chain (#13143 -> #13472 -> #13473 -> #13475 -> #13477 -> #13482 -> #13486), each carrying the previous PRs' commits and each editing the same ImportModule lookup function with one more hard-coded name (libSceLibreSSl3, libSceLibreSSL). See my comment on #13143: this should be one general matching rule, not one PR per observed spelling.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729928380 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13472#pullrequestreview-5729928380). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:51:18Z. **Review:** COMMENTED --- Neutral note: this is the third of a chain (#13143 -> #13472 -> #13473 -> #13475 -> #13477 -> #13482 -> #13486), each carrying the previous PRs' commits and each editing the same `ImportModule` lookup function with one more hard-coded name (`libSceLibreSSl3`, `libSceLibreSSL`). See my comment on #13143: this should be one general matching rule, not one PR per observed spelling.
MarcZX10 commented 2026-11-25 16:33:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T16:33:43Z.

Review: APPROVED


Reviewed — looks good

The changed code preserves normalized dependency matching, applies the two aliases only as fallback matches, and I found no defect in the reviewed changes.

What I ran

Reviewed head 6f88e5f7540bb4a1a0eda63ef0e2363bb1adcab8 using the prepared review bundle and the pinned repository reader. I read every added line in both changed files and checked the ImportModule callers. I did not run tests or a build.

Results

Check Result Note
Changed code review passed Both changed files read
Tests and build not run No execution available
Changed-file coverage passed All manifest-listed files included and read

Findings

Blocking

None.

Non-blocking

None.

Sources

  • core/relinker/domain/include/domain/ImportModule.hpp at head 6f88e5f7540bb4a1a0eda63ef0e2363bb1adcab8
  • core/relinker/relinker/tests/ImportModuleTests.cpp at head 6f88e5f7540bb4a1a0eda63ef0e2363bb1adcab8
  • core/relinker/relinker/src/guest/GuestImageReader.cpp and core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp at the same head

Not verified

I did not run the test target or build, and did not verify behavior on Linux, Windows, or a console. The manifest lists two changed files and both were read. The bundle’s files.json was not available through the reader, so additional exclusions beyond those described for the prepared diff were not verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6061246720 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13472#pullrequestreview-6061246720). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T16:33:43Z. **Review:** APPROVED --- # Reviewed — looks good The changed code preserves normalized dependency matching, applies the two aliases only as fallback matches, and I found no defect in the reviewed changes. ## What I ran Reviewed head `6f88e5f7540bb4a1a0eda63ef0e2363bb1adcab8` using the prepared review bundle and the pinned repository reader. I read every added line in both changed files and checked the `ImportModule` callers. I did not run tests or a build. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Both changed files read | | Tests and build | not run | No execution available | | Changed-file coverage | passed | All manifest-listed files included and read | ## Findings ### Blocking None. ### Non-blocking None. ## Sources - `core/relinker/domain/include/domain/ImportModule.hpp` at head `6f88e5f7540bb4a1a0eda63ef0e2363bb1adcab8` - `core/relinker/relinker/tests/ImportModuleTests.cpp` at head `6f88e5f7540bb4a1a0eda63ef0e2363bb1adcab8` - `core/relinker/relinker/src/guest/GuestImageReader.cpp` and `core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp` at the same head ## Not verified I did not run the test target or build, and did not verify behavior on Linux, Windows, or a console. The manifest lists two changed files and both were read. The bundle’s `files.json` was not available through the reader, so additional exclusions beyond those described for the prepared diff were not verified. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 17:03:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:03:21Z.

Review: COMMENTED


The exact import_module CTest passed in a Linux relinker-only build. The LibreSSL cases cover both spellings and check that a version-3 import stays distinct from the versionless provider.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6174526083 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13472#pullrequestreview-6174526083). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T17:03:21Z. **Review:** COMMENTED --- The exact `import_module` CTest passed in a Linux relinker-only build. The LibreSSL cases cover both spellings and check that a version-3 import stays distinct from the versionless provider. AI-assisted: yes.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!13472
No description provided.