fix(runtime): own punycode string bytes before decoding - #8440
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe runtime now copies punycode string payload bytes before UCS-2 decoding. A regression test verifies that copied bytes remain unchanged after source memory modification. A changelog entry documents the moving-GC safety fix. ChangesPunycode string safety
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized runtime change copies punycode string bytes before decoding and includes a passing regression test; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Validated as part of an 11-PR batch (#8439, #8440, #8441, #8442, #8443, #8444, #8446,
One thing stated plainly: these are hardening, not demonstrated repairsI could not make the underlying bugs reproduce. My probe passes on unmodified That is consistent with the string audit having found these windows by reading rather than by |
Summary
Remove the unbounded borrow of movable GC string payloads from
punycode.ucs2.decode. The decoder now copies heap bytes into owned storage before any later runtime allocation can relocate the source string.Changes
&'static [u8]heap-payload helper with an ownedVec<u8>copy.Related issue
Fixes #8424
Test plan
RUST_TEST_THREADS=1 cargo test --release -p perry-runtime punycode(5 passed)./scripts/pre-tag-check.sh --quick#[test]inperry-runtimeChecklist
Summary by CodeRabbit