You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(libSceFont): safely copy out render weight scale in sceFontGetRenderEffectWeight - #574
Source commit: 62a68a5f7d7175c41370027aa77978fd2ed6df20. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.
What
Safely copy out render weight scale and mode in sceFontGetRenderEffectWeight via CopyOutGuest, preserving caller errno and returning SCE_FONT_ERROR_INVALID_PARAMETER if destination pointers are unwritable.
Tested
guest_font_tests (passed)
tools/check_conventions.py --base origin/main
Checklist
Code follows the style guidelines of this project
Tests have been added or updated
Documentation has been updated
Dependencies have been added or updated
Fixes: none
Unblocks: none
Depends on: none
GPUs tested: none
AI-assisted: yes
Summary by CodeRabbit
Bug Fixes
Improved error handling when retrieving font render effect weights, including invalid or unwritable output parameters. Failed reads now reset requested outputs to defaults.
Tests
Added checks for invalid font handles, null or invalid output pointers, and preservation of errno.
Documentation
Recorded the behavior for unwritable outputs and noted that console behavior for unmapped memory remains unverified.
No actionable comments were generated in the recent review.
Walkthrough
Changes: Font render-effect weight query
Layer / File(s)
Summary
Render-effect output handling and validation core/libs/prx/libSceFont/src/Style.cpp, core/libs/tests/GuestFont.cpp, docs/dev/debt/changes/fix-libSceFont-getRenderEffectWeight-copyout.md
The query stages requested outputs locally and reports invalid parameters when guest copies fail. Tests cover invalid handles, null outputs, invalid output addresses, and preserved errno. The debt note documents copy-out behavior and says console behavior for unmapped memory is unmeasured.
Change: Bug fix
Merge Risk: Minimal · up to 62a68
This change makes the font render-effect weight query handle unwritable output pointers safely by returning an invalid-parameter error and preserving errno. No actionable merge-blocking risk was identified.
Security architecture risk: Minimal · up to 62a68
libSceFont replaces direct writes through guest-supplied pointers with checked copy-out, without changing the export or its font-handle and renderer checks. Copy-out is not all-or-nothing: callers should use the returned values only on success.
Security review details
Security Blast Radius
observed — The changed success path is reached through the existing guest query after the existing font-handle and renderer checks. It copies only the requested weight scales and mode to caller-selected destinations. The GuestFont changes exercise that query; they do not add a production entrypoint.
Trust Boundaries and Controls
observed — Guest-supplied addresses no longer reach the style getter as write targets. CopyOutGuest preserves errno on normal return and delegates each scalar write to libc's GuestArena and platform write checks. Those checks do not by themselves establish guest-only address ownership.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 5280204a-5f4d-4977-be3b-c86a4f24352a
Commits
Reviewing files that changed from the base of the PR and between 4131f51 and 62a68a5.
Limit details: You’ve used all 10 included reviews currently available.
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
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
Safely copy out render weight scale and mode in
sceFontGetRenderEffectWeightviaCopyOutGuest, preserving callererrnoand returningSCE_FONT_ERROR_INVALID_PARAMETERif destination pointers are unwritable.Tested
Checklist
Summary by CodeRabbit
errno.