Skip to content

reject location aliased to two object types in reflection verify#9183

Open
fr-manvi wants to merge 1 commit into
google:masterfrom
fr-manvi:reflection-verify-aliased-type
Open

reject location aliased to two object types in reflection verify#9183
fr-manvi wants to merge 1 commit into
google:masterfrom
fr-manvi:reflection-verify-aliased-type

Conversation

@fr-manvi

Copy link
Copy Markdown

The reflection SafeBuffer verifier deduped verified tables by buffer position only:

  • two differently typed fields aliased onto the same child offset let the second reference skip verification
  • buf_loc_to_obj_idx then keeps a type those bytes were never checked against (last writer wins)
  • SafeBuffer reads that offset under the wrong layout: a multi-GB out of bounds slice range, or a &str built over unchecked bytes (invalid UTF-8) straight from the safe API

record_obj_idx now rejects any location reached as two object types. Forward only uoffsets keep the root and legitimate same type sharing untouched. Added a regression test that aliases enemy (Monster) and testempty (Stat) onto one table and asserts the verifier rejects it.

@fr-manvi
fr-manvi requested a review from dbaileychess as a code owner July 22, 2026 08:11
@github-actions github-actions Bot added the rust label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant