fix(libharfbuzz): guard guest memory access in hb_ft_face_create_cached #27967
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27967"
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 JJenkx on 2026-11-27T22:53:56Z.
What
Complete guest-pointer guarding in
hb_ft_face_create_cached_nid_postfix(core/libs/prx/libharfbuzz/Export.cpp), bringinglibharfbuzzto 0 hits intools/guest_pointer_audit.py:GuestArenaPrepareHostRead_nid_no_patch+GuestReadable_nid_no_patch) beforeGuestCopyIn_nid_no_patchwhile preservingerrno.genericslot address viaoffsetof(FreeType::GuestFaceRec, generic)instead of direct member addressing, and hold an activeGuestArenaBeginHostWrite_nid_postfix/GuestArenaEndHostWrite_nid_postfixguard acrossGuestCopyOut_nid_no_patch(preservingerrnoacross entry and exit) before invoking any prior guest finalizer or writing the cached handle.GuestFaceand guard-page boundary regression tests tocore/libs/tests/GuestHarfBuzzFreeTypeShaping.cppand recorddocs/dev/debt/changes/fix-libharfbuzz-ft-face-guest-pointers.md.Tested
/usr/local/bin/cmake --build /mnt/sas-ssd/AnyPS5-work/agy/build-spec --target guest_harfbuzz_freetype_shaping_tests):ctest -R '^guest_harfbuzz_freetype_shaping(_nid)?$' --output-on-failure:2/2passed (guest_harfbuzz_freetype_shaping0.02 sec,guest_harfbuzz_freetype_shaping_nid0.02 sec).python3 tools/guest_pointer_audit.py libharfbuzz:0 direct guest pointer accesses in 0 exported functions.python3 tools/check_conventions.py --base origin/main: All conventions checks passed.python3 tools/pr_overlap.py --branch fix/libharfbuzz-ft-face-guest-pointers: No overlap with open pull requests.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 PrivacyOnion on 2026-11-27T22:59:20Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
43252c83c0:tools/check_conventions.pypassed.guest_harfbuzz_freetype_shaping_testsbuilt cleanly.guest_harfbuzz_freetype_shaping):core/libs/prx/libharfbuzz/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-11-28T05:39:20Z.
Review: APPROVED
Checked head
43252c83c0. All on Windows 11 with WinLibs GCC 15.2 (Release), applied tomain4c7578e0a4together with #27997, #27996, #27978, #27975, #27973, #27971, #27969, #27964, #27958, #27950, #27949, #27946, #27945, #27943, #27938, #27936.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded.guest_harfbuzz_freetype_shapingandguest_harfbuzz_freetype_shaping_nidpass. In the full CPU suite (5,131 tests) the only failures are unrelated:windows_read_trap_unknownfails onmaintoo (fixed in #28028), andframe_capture_minimizeis a timeout under load that passes on its own.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T08:20:15Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the code and tests I read support the stated guest-pointer guards, though console fault behavior remains unverified.
What I ran
Reviewed head
43252c83c04fb3629513ad4573b51763d83fb306. I read the prepared description, commits, manifest and diff, plus all three changed files and targeted guest-memory helper implementations at the pinned head. No commands or tests were run; the test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the reported build,
ctest, guest-pointer audit, conventions check, or PR-overlap check. I did not verify console fault behavior. The review bundle'sfiles.jsonwas unavailable; the manifest lists three changed files and all three were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T09:24:21Z.
Review: COMMENTED
The Linux
guest_harfbuzz_freetype_shapingCTest passed with the patched HarfBuzz and guest FreeType libraries. The fixture checks normal shaping through the cached face path and verifies that the read-only face case leaves the generic callback count at zero.AI-assisted: yes.