feat(libSceLibreSsl): free GENERAL_NAME and GENERAL_NAMES allocations #13760
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13760"
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 hyvvs on 2026-10-31T04:29:58Z.
What
Implement two pending LibreSSL 2.5.4 memory-release exports, with full ASN.1 ownership handling and guest allocator regression tests. See details below.
Tested
Windows build CI: pass. Linux ASan/UBSan linked guest allocator harness: pass. Progress tests (56): pass. Public header audit: pass. Emscripten library portability: pass. PS5 native oracle: not available; firmware-specific differences are not verified.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositorySummary - Implement
GENERAL_NAME_freefor all nine LibreSSL 2.5.4GENERAL_NAMEchoices (including OTHERNAME/ANY, X509_NAME cached data and entries, and EDIPARTYNAME), replacing the throwing stub with an ABI-correctvoidexport. - ImplementGENERAL_NAMES_freeby recursively releasing the guest stack and its elements, using existingsk_pop_freeand guest heap dispatch. - Reproduce owned vs borrowed memory behavior for ASN.1 strings (NDEF), OID dynamic flags, and secure zeroing of owned contents. Assert relevant x86-64 structure layouts. - Add guest allocator tests and register a CTest target. Document the reference source and remaining verification limit. ## Measured progress - Based on0835ec8bdc, system libraries: 7,229 / 27,404 -> 7,231 / 27,404 (+2 genuine implemented exports, ~26.39% on this branch). -libSceLibreSsl: 97 / 401 -> 99 / 401. - The two local callbacks use ABI-correct lambdas so the progress scanner does not accidentally count private helper functions as exports. ## Validation -python tools/tests/test_progress.py(56 tests: PASS) -python core/libs/tests/test_public_headers.py --audit-only(393 libraries, 24,536 declarations: PASS) -python tools/check_conventions.py --base upstream/main(PASS) -git diff --checkand Windows MinGW C++20 syntax checks for new source/test (PASS) - Linked Linux standalone test with actualGeneralName.cpp+Stack.cpp, a local guest-allocator dispatch shim and-fsanitize=address,undefined(detect_leaks=1) (PASS); tests all nine choices, nested allocations, static OIDs, NDEF borrowing and wiping before freeing. - Full CMake test executable was not built in this worktree because third-party submodule directories are not initialized; CI should verify the normal project build. ## Reference and limitations The memory ownership and recursive free semantics follow LibreSSL 2.5.4 inlibressl/openbsdcommit2e2c612066aa993717528a0249c15c51128d61cb, especiallyx509v3/v3_genn.c,asn1/tasn_fre.c,asn1/asn1_lib.c,asn1/a_object.candasn1/x_name.c. These exports have not been exercised against a native PS5 library; firmware-specific variations are unverified. For malformed negative owned buffer lengths, we throw rather than risk an oversized memory wipe. ### Open PR coordination No open PR was found implementing either exactGENERAL_NAME_freeorGENERAL_NAMES_freesymbol. Some active LibreSSL PRs touchExport.cpp/Api.hpp/CMakeLists.txtor implement adjacent ASN.1 cleanup functions, so textual merges may need coordination.