Repository navigation
fix(libSceFreeType): report guest-input throws as faults - #29230
Conversation
Move the unreadable-pointer rejections in the module, outline-storage, variations, build-info, size-request and FT_New_Library paths from NotImplemented_nid_no_patch to GuestFault_nid_no_patch (boykopovar#28739). FreeType 2.13.3 dereferences each of these pointers for a non-null input. FT_Get_Module with a null name and FT_Remove_Module with a null module now return before reading the library, as FreeType does, instead of throwing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head b1dffdfb476ac24d8bbe467b45c1aad71351f053 against the prepared diff and manifest. Used repo_read.py for source context. No tests or builds were run.
python3 repo_read.py cat core/libs/prx/libSceFreeType/src/ModuleManagement.cpp 1 76
python3 repo_read.py cat core/libs/prx/libSceFreeType/src/SizeRequest.cpp 1 40
python3 repo_read.py cat core/libs/prx/libSceFreeType/Export.cpp 175 205
python3 repo_read.py cat core/libs/prx/libSceFreeType/src/BuildInfo.cpp 1 74
python3 repo_read.py cat core/libs/prx/libSceFreeType/src/OutlineStorage.cpp 1 90
python3 repo_read.py cat core/libs/prx/libSceFreeType/src/Variations.cpp 1 55
python3 repo_read.py cat core/libs/tests/GuestFreeTypeModuleManagement.cpp 90 142
python3 repo_read.py cat core/libs/tests/GuestFreeTypeBuildInfo.cpp 1 152
python3 repo_read.py cat core/libs/tests/GuestFreeTypeOutlineStorage.cpp 90 158
python3 repo_read.py cat core/libs/tests/GuestFreeTypeVariations.cpp 140 180
python3 repo_read.py cat core/libs/tests/GuestFreeTypeRequestSize.cpp 175 205
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | All 10 changed files reviewed; none excluded. |
| Tests and build | not run | The description reports Windows test results; not independently run. |
Negative control
Not run; no tests were run during this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
The changed wrappers convert unreadable guest input to guest faults and preserve the null-input paths described in the PR: ModuleManagement.cpp, OutlineStorage.cpp, SizeRequest.cpp, Variations.cpp, Export.cpp, and BuildInfo.cpp.
Not verified
Tests, builds, console behavior, and Linux/macOS behavior were not run or confirmed. All 10 changed files in the manifest were reviewed; files.json lists no exclusions.
To get this to a good state
Nothing required.
Progress report (ba2a804 → b1dffdf)📈 System libraries: 49.18% (+0.02%, +8 implemented functions) ✅ 8 implemented
Changed libraries (implemented exports)
|
What
Eight libSceFreeType exports forward every valid input to the bundled FreeType 2.13.3 but still reached
NotImplemented_nid_no_patchon guest-input paths: an unreadable or misalignedFT_Libraryhandle (one this module did not create), an unreadable module name, an unreadableFT_Memoryrecord, face or size request. FreeType 2.13.3 dereferences each of these pointers for a non-null input, so this moves the sites toGuestFault_nid_no_patch(#28739). Part of #23391's per-library migration; same approach as #28912 (libharfbuzz) and #28898 (libcairo).Sites, checked against FreeType 2.13.3 at the commit
docs/dev/debt/libSceFreeType.mdcites (42608f77f2):ModuleManagement.cpp: the library handle read byFT_Get_Module,FT_Get_Renderer,FT_Remove_ModuleandFT_Add_Default_Modules. FreeType readslibrary->modules(ftobjs.c:5199),library->renderers.headthroughFT_Lookup_Renderer(ftobjs.c:4537),library->modulesfor a non-null module (ftobjs.c:5288) andlibrary->num_modulesthroughFT_Add_Module(ftobjs.c:5098). The module name copy:FT_Get_Modulecompares it withft_strcmp(ftobjs.c:5203).OutlineStorage.cpp:FT_Outline_NewandFT_Outline_Donereadlibrary->memory(ftoutln.c:316, ftoutln.c:450).Variations.cpp:FT_Done_MM_Varreadslibrary->memory(ftmm.c:159).BuildInfo.cpp:FT_Get_TrueType_Engine_TypecallsFT_Get_Moduleon a non-null library (ftobjs.c:5683).Export.cpp:FT_New_Libraryallocates through theFT_Memoryrecord (ftobjs.c:5507).SizeRequest.cpp:FT_Request_Sizereadsface->sizeandreq->width(ftobjs.c:3456-3459).Behaviour change, following the same source:
FT_Get_Modulewith a null name returns null, andFT_Remove_Modulewith a null module returnsFT_Err_Invalid_Driver_Handle, before the library is read (ftobjs.c:5196, ftobjs.c:5286). Before, an unreadable library with a null name or module threw.Left as
NotImplemented_nid_no_patch: a size request wider than the hostFT_Long(Windows),FT_Done_FreeTypeof a library made with a guestFT_Memory, theFT_Outline_Renderprobe on an unsupported host, and the LCD filter exports (the console's build options are not known).Glyph.cpp,CacheManager.cppand the property exports are left to #28019 and #27220.Console behaviour is not measured. No title is known to be unblocked.
Changed libraries (implemented exports)
Tested
Windows 11 Pro 10.0.26100, Ryzen 9 5950X, WinLibs MinGW-w64 GCC, Release, on
main67da974831.ctest -R freetype: 116 of 116 passed.guest_freetype_module_management,guest_freetype_build_info,guest_freetype_variations,guest_freetype_outline_storage,guest_freetype_request_sizeandguest_freetype_library_object: 3 of 3 runs each.core/libs/prx/libSceFreeTypefrommainfail (0 of 4).tools/check_conventions.pypasses;tools/pr_overlap.py --branch: no overlap with the 1698 open pull requests.Not tested: Linux, macOS, a title.
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)🤖 Generated with Claude Code
Summary by CodeRabbit