feat(libSceIcu): implement uidna UTS46 exports #27656
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27656"
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 Ynryo on 2026-11-26T21:50:17Z.
What
Implement all 4
uidna_*UTS46 exports (uidna_openUTS46,uidna_close,uidna_nameToASCII,uidna_nameToUnicode) inlibSceIcuviaIdnaBackendbacked by3rdparty/icu.Tested
Linux (Fedora 44 x86_64):
ctest --test-dir build-full -R guest_icu_recovered_signaturespassed (1/1) andpython3 tools/check_conventions.pypassed.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T21:54:51Z.
Review: COMMENTED
Actionable comments posted: 3
7b22adb7-f6bb-450e-8c66-e78f021f5504Reviewing files that changed from the base of the PR and between
00b15fcbb0and0e5cfc6022.cmake/Icu.cmakecore/libs/prx/libSceIcu/CMakeLists.txtcore/libs/prx/libSceIcu/Idna.cppcore/libs/prx/libSceIcu/IdnaBackend.cppcore/libs/prx/libSceIcu/IdnaBackend.hppcore/libs/prx/libSceIcu/tests/Idna.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T22:13:17Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: ensure UIDNAInfo reads and writes respect the guest-provided structure size.
What I ran
7237f86428acca38748678a5d7e8ffa5c33e81aaagainst the prepared diff. No merged-preview check was run.repo_read.pyonly.description.md,commits.md,manifest.json,diff.patch, and all changed files listed as included in the manifest:cmake/Icu.cmake,core/libs/prx/libSceIcu/CMakeLists.txt,core/libs/prx/libSceIcu/Idna.cpp,core/libs/prx/libSceIcu/IdnaBackend.cpp,core/libs/prx/libSceIcu/IdnaBackend.hpp, andcore/libs/prx/libSceIcu/tests/Idna.cpp. No changed files were excluded according to the manifest.Results
Findings
Blocking
core/libs/prx/libSceIcu/Idna.cpp:102copiessizeof(hostInfo)bytes from guestpInfoafter validating only that its declared size is at least that large, and line 133 writes all ofhostInfoback.UIDNAInfouses a size field so callers can provide a versioned structure; with a larger size this code still reads/writes only the current fixed structure, while any supported smaller structure is rejected. Respect the guest structure's declared size when transferring fields, and avoid reading or writing beyond the size the guest supplied. This can cause invalid guest-memory access and breaks the intended struct-size compatibility contract.Non-blocking
None.
Not verified
To get this to a good state
UIDNAInfoguest-memory transfers to honor the caller's declared size, then rerun the relevant build and tests on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T08:47:49Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: bound the
length == -1guest string scan and reject lengths that cannot be represented by the backend call.What I ran
Reviewed head
af28c902f814def73c5c356336f1734f0f8e811efrom the prepared diff and pinned reader. No commands or tests were run; the test result in the PR description is author-reported.Results
Findings
Blocking
length == -1,ReadGuestU16Stringreads successive UTF-16 code units until it finds a terminator, with no bound on the scan or accumulated string. A non-terminated or very large guest input can cause unbounded reads and memory growth instead of returning or failing safely. Bound this scan to the API’s supported maximum and reject overlong input.core/libs/prx/libSceIcu/Idna.cpp:69Non-blocking
None.
Not verified
No files were excluded by the prepared manifest: all six changed files were read, including every added line. No build or test was run. The reported Fedora test and convention check were not independently verified; console behavior was not verified.
To get this to a good state
Bound and validate the
length == -1scan, then rerun the reported IDNA test and conventions check on the new head.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T10:12:34Z.
Review: COMMENTED
The rebuilt guest ICU recovered-signatures CTest passed on Linux with the bundled ICU backend. The new cases compare UTS46 name conversion results and check the returned information fields.
AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.