Repository navigation
fix(libSceLibreSsl3): keep RSA_free from binding to its own export - #22877
Merged
oneandonlydean merged 1 commit intoNov 18, 2026
Merged
Conversation
libSceLibreSsl3's RSA_free hands a key with a method pointer to libSceLibreSsl's RSA_free export. After NID patching that import is named 5zpup0URQoc, which libSceLibreSsl3 also exports, so when libSceLibreSsl3 comes before libSceLibreSsl in the lookup scope the import binds to libSceLibreSsl3's own RSA_free, which then calls itself forever. patched_self_imports has failed on Linux since boykopovar#22804. libSceLibreSsl now keeps the RSA_free body in LibreSslRsaFree_nid_no_patch, which its export and libSceLibreSsl3's RSA_free call, as 6c5bee0 does for the other forwarders. The body is unchanged, and its null-method message keeps the export's name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
RSA_free(RSA_free_nid_disambig1_nid_postfixinsrc/RsaCrypto.cpp, added in feat(libSceLibreSsl3): implement RSA_free and d2i_RSAPublicKey_bio #22804) hands a key whose method pointer is set to libSceLibreSsl'sRSA_free_nid_postfixexport. After NID patching that import is named5zpup0URQoc, which libSceLibreSsl3 also exports as its ownRSA_free. When libSceLibreSsl3 comes before libSceLibreSsl in the lookup scope, the import binds to libSceLibreSsl3's own export, which then calls itself forever.patched_self_importshas failed on Linux since feat(libSceLibreSsl3): implement RSA_free and d2i_RSAPublicKey_bio #22804 withlibSceLibreSsl3.prx imports 5zpup0URQoc, a name it also exports, so the import can bind to its own export. The Windows job is the only one PR CI runs, so CI does not show it.RSA_freebody inLibreSslRsaFree_nid_no_patch, which its export and libSceLibreSsl3'sRSA_freeboth call. This is the split 6c5bee0 (fix(prx): keep forwarding exports from binding to themselves on Linux #13730) made for the other forwarders. The declaration follows libSceLibreSsl's existing cross-library bodies such asLibreSslAsn1StringFree_nid_no_patch(extern "C", noAPS5_VABI).invalid_argumentkeeps the textRSA_free_nid_postfix: null methodthat__func__produced before, as 6c5bee0 did forFT_Stroker_Export. libSceLibreSsl's own callers still call the export. No debt entry changes: feat(libSceLibreSsl3): implement RSA_free and d2i_RSAPublicKey_bio #22804'sRSA_freeentry ("A key whose method pointer is set goes to libSceLibreSsl'sRSA_free") stays true.RsaPublicKeyBio.cppcalls only libSceLibreSsl3's ownRSA_new,RSA_freeandBN_clear_freeand libSceLibreSsl'sLibreSslPutError_nid_no_patchbody.patched_self_importsnow passes over all 413 patched libraries.Tested
Fedora Linux 44, GCC 16.2.1, GNU ld 2.46.1, CMake 4.3.0, Ninja 1.13.2, Release build with
-DBUILD_TESTING=ON, onmainat41bb4ae756. No title, no console and no Windows host.patched_self_importspasses: "No patched library imports a name it exports (413 libraries)". In the patched modules, libSceLibreSsl defines5zpup0URQocandLibreSslRsaFree_nid_no_patch. libSceLibreSsl3 defines5zpup0URQoc, importsLibreSslRsaFree_nid_no_patch, and no longer imports5zpup0URQoc.85f73c1daf:main's copies of the three changed files andlibsrebuilt,patched_self_importsfails with the single line quoted above.main'sRsaCrypto.cpp, it fails the same way.nm -Dagainst thatmainbuild: libSceLibreSsl gains one defined name,LibreSslRsaFree_nid_no_patch. libSceLibreSsl3 defines the same names as onmain. Its only import changes areLibreSslRsaFree_nid_no_patchadded and5zpup0URQocremoved.ctest -R 'libressl|^patched_self_imports$': 184 of 184 pass. Among them,guest_libressl3_rsa_public_key_bio'sTestParentFreefrees a libSceLibreSsl key through libSceLibreSsl3'sRSA_free, which is the changed call. The guest tests load the unpatched libraries, so they cannot show the self-binding;patched_self_importsdoes.mainat27beeee0a8, which adds feat(libSceLibreSsl3): implement d2i_RSA_PUBKEY #22845'sd2i_RSA_PUBKEY, the build passes and the same 184 tests pass,patched_self_importsincluded.tools/select_tests.pyselects 1426 of 6123 tests for this change, and all 1426 pass.x86_64-w64-mingw32-g++16.2.1 (Fedora MinGW)-fsyntax-onlywith-D_UCRT -D__MSVCRT_VERSION__=0xE00passes forRsa.cppandRsaCrypto.cpp. Nothing ran on Windows.python3 tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.py --branchfails closed on fix(libSceLibreSsl): decode compressed 224-bit EC points and report errors #11466, feat(libSceLibreSsl): implement SSL_get0_param #15278, feat(libSceLibreSsl): implement SSL_get_ex_data #15279 and feat(libSceLibreSsl): implement SSL_get_servername #15280, which all conflict withmain. I applied each one's hunks in the shared files (libSceLibreSslApi.hpp, andRsa.cppfor fix(libSceLibreSsl): decode compressed 224-bit EC points and report errors #11466) tomainand to this branch, and the rejected hunks are identical, so this branch adds no conflict with them. fix(libSceLibreSsl): decode compressed 224-bit EC points and report errors #11466 showsRSA_freeas a shared export because it re-adds theRSA_freethatmainalready has.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)