Skip to content

Extract slice metadata without references - #3629

Open
joshlf wants to merge 1 commit into
Gkpenpjjuex55evmm52puxsa34xtjgc7tfrom
Gro7m5vgpfdcy3pxtpl52hnbgworclnzw
Open

Extract slice metadata without references#3629
joshlf wants to merge 1 commit into
Gkpenpjjuex55evmm52puxsa34xtjgc7tfrom
Gro7m5vgpfdcy3pxtpl52hnbgworclnzw

Conversation

@joshlf

@joshlf joshlf commented Sep 5, 2026

Copy link
Copy Markdown
Member

KnownLayout's slice implementation materialized a shared reference solely to
read raw pointer metadata. That is invalid for null, dangling, unaligned, or
otherwise non-dereferenceable slice pointers even though metadata extraction
itself must accept them.

Use the safe raw-slice pointer length API on Rust 1.79 and newer. On older
supported compilers, capture a metadata candidate through raw-pointer hashing
and authenticate it with raw slice pointer equality before returning it.
Strengthen the implementer contract and cover null, dangling, deallocated,
unaligned, derived-DST, and boundary-toolchain cases.

Closes #3615

Authored by an AI agent acting on Josh Liebow-Feeser's behalf.


⬇️ Download this PR

Branch

git fetch origin refs/heads/Gro7m5vgpfdcy3pxtpl52hnbgworclnzw && git checkout -b pr-Gro7m5vgpfdcy3pxtpl52hnbgworclnzw FETCH_HEAD

Checkout

git fetch origin refs/heads/Gro7m5vgpfdcy3pxtpl52hnbgworclnzw && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Gro7m5vgpfdcy3pxtpl52hnbgworclnzw && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Gro7m5vgpfdcy3pxtpl52hnbgworclnzw

Stacked PRs enabled by GHerrit.

KnownLayout's slice implementation materialized a shared reference solely to
read raw pointer metadata. That is invalid for null, dangling, unaligned, or
otherwise non-dereferenceable slice pointers even though metadata extraction
itself must accept them.

Use the safe raw-slice pointer length API on Rust 1.79 and newer. On older
supported compilers, capture a metadata candidate through raw-pointer hashing
and authenticate it with raw slice pointer equality before returning it.
Strengthen the implementer contract and cover null, dangling, deallocated,
unaligned, derived-DST, and boundary-toolchain cases.

Closes #3615

*Authored by an AI agent acting on Josh Liebow-Feeser's behalf.*

gherrit-pr-id: Gro7m5vgpfdcy3pxtpl52hnbgworclnzw
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T00:05:47.839132Z 2e0e5c5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.89%. Comparing base (7ac962f) to head (2e0e5c5).

Additional details and impacted files
@@                          Coverage Diff                          @@
##           Gkpenpjjuex55evmm52puxsa34xtjgc7t    #3629      +/-   ##
=====================================================================
+ Coverage                              91.85%   91.89%   +0.03%     
=====================================================================
  Files                                     20       20              
  Lines                                   6093     6118      +25     
=====================================================================
+ Hits                                    5597     5622      +25     
  Misses                                   496      496              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants