Skip to content

[kani] Prove zero-only pointer validation - #3652

Open
joshlf wants to merge 1 commit into
G56sp4dsuukjpe3trlzhqbkuvl6f53jkgfrom
Gzi6kdmiqx3hi24gccqw5f6pebmv47idc
Open

[kani] Prove zero-only pointer validation#3652
joshlf wants to merge 1 commit into
G56sp4dsuukjpe3trlzhqbkuvl6f53jkgfrom
Gzi6kdmiqx3hi24gccqw5f6pebmv47idc

Conversation

@joshlf

@joshlf joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member

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


Latest Update: v52 — Compare vs v51

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v51 v50 v49 v48 v47 v46 v45 v44 v43 v42 v41 v40 v39 v38 v37 v36 v35 v34 v33 v32 v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v52 v51 v50 v49 v48 v47 v46 v45 v44 v43 v42 v41 v40 v39 v38 v37 v36 v35 v34 v33 v32 v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v51 v50 Base
v50 v49 Base
v49 v48 Base
v48 v47 Base
v47 v46 Base
v46 v45 Base
v45 v44 Base
v44 v43 Base
v43 v42 Base
v42 v41 Base
v41 v40 Base
v40 v39 Base
v39 v38 Base
v38 v37 Base
v37 v36 Base
v36 v35 Base
v35 v34 Base
v34 v33 Base
v33 v32 Base
v32 v31 Base
v31 v30 Base
v30 v29 Base
v29 v28 Base
v28 v27 Base
v27 v26 Base
v26 v25 Base
v25 v24 Base
v24 v23 Base
v23 v22 Base
v22 v21 Base
v21 v20 Base
v20 v19 Base
v19 v18 Base
v18 v17 Base
v17 v16 Base
v16 v15 Base
v15 v14 Base
v14 v13 Base
v13 v12 Base
v12 v11 Base
v11 v10 Base
v10 v9 Base
v9 v8 Base
v8 v7 Base
v7 v6 Base
v6 v5 Base
v5 v4 Base
v4 v3 Base
v3 v2 Base
v2 v1 Base
v1 Base
⬇️ Download this PR

Branch

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Gzi6kdmiqx3hi24gccqw5f6pebmv47idc

Stacked PRs enabled by GHerrit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 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 ⚠️ Failed 2026-09-09T17:20:59.261924Z 4c03bd0 Manual request
🔒 Security Review Completed 2026-09-08T21:37:38.944305Z 7493c98 Manual request
ℹ️ 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.

@google-cla

google-cla Bot commented Sep 7, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov-commenter

codecov-commenter commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.89%. Comparing base (3580b1d) to head (4c03bd0).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           G56sp4dsuukjpe3trlzhqbkuvl6f53jkg    #3652   +/-   ##
==================================================================
  Coverage                              91.89%   91.89%           
==================================================================
  Files                                     20       20           
  Lines                                   6118     6118           
==================================================================
  Hits                                    5622     5622           
  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.

@joshlf
joshlf force-pushed the Gzi6kdmiqx3hi24gccqw5f6pebmv47idc branch from e8753b0 to 88a28f5 Compare September 7, 2026 17:14
@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from 3a882af to 0e35235 Compare September 7, 2026 17:14
@joshlf
joshlf force-pushed the Gzi6kdmiqx3hi24gccqw5f6pebmv47idc branch from 88a28f5 to 82d27ac Compare September 7, 2026 17:47
@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from 0e35235 to 61ff28d Compare September 7, 2026 17:47
@joshlf
joshlf force-pushed the Gzi6kdmiqx3hi24gccqw5f6pebmv47idc branch from 82d27ac to c0a2e4c Compare September 7, 2026 18:13
@joshlf

joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head c0a2e4c68cb1318286bfbbe61c818fbd42251adf; in particular, challenge the documented proof domain and exclusions, and verify that expected behavior comes from an independent safe Rust, standard-library, language, or explicitly labeled policy oracle.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0a2e4c68c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread zerocopy/src/impls.rs
// produces `Option::<T>::None`.
macro_rules! zero_only_pointer_proof {
($proof:ident, $ty:ty, $value:ident => $assertion:expr) => {
#[kani::proof]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add an unwind bound to the pointer harnesses

On the 64-bit Kani CI target, each generated harness reaches pointer::is_zeroed, which iterates over all eight pointer bytes, but these proofs have no #[kani::unwind(...)] bound. Kani's default bound is insufficient for the all-zero path to complete, so the unwinding assertion fails instead of establishing the documented domain; the existing four-byte array proof above uses #[kani::unwind(5)] for this reason. Add a bound sufficient for the pointer-size loop (nine on the current target) to the generated harnesses.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the current revision. Every generated pointer harness now has #[kani::unwind(9)], which covers the eight-byte pointer scan on the verified 64-bit target, and the focused pointer proof passes with unwinding assertions enabled.

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

Comment thread zerocopy/src/impls.rs Outdated
Comment on lines +1529 to +1531
// Excludes: This does not claim that rejected nonzero bytes are invalid
// Rust pointers. It also excludes provenance, fat pointers, other pointees,
// function signatures and ABIs, and non-Kani targets.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude Kani's incomplete invalid-value checking

The exclusions mention provenance but omit Kani's incomplete checking of invalid Rust values, which is material here because the public read path materializes raw-pointer and niche-pointer values before the safe observations run. If that path regresses and constructs an invalid Option<&mut _>, function pointer, or Box representation, Kani is not a complete oracle for the resulting immediate UB, so this proof cannot establish that obligation even though it starts from initialized bytes. Add invalid-value checking to the stated soundness boundary rather than presenting the listed exclusions as complete.

AGENTS.md reference: zerocopy/AGENTS.md:L67-L73

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the current revision. The exclusions now call out incomplete invalid-value checking in Kani. In addition, arbitrary bytes are passed only to the raw non-materializing validator; the public read is invoked solely for independently safe null/None witnesses, so these harnesses no longer materialize public values based on the validator under test.

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: c0a2e4c68c

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from 2d90423 to cc19271 Compare September 7, 2026 19:04
@joshlf
joshlf force-pushed the Gzi6kdmiqx3hi24gccqw5f6pebmv47idc branch from c0a2e4c to 48967ac Compare September 7, 2026 19:04
@joshlf

joshlf commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head 48967acdf5a366c01ce6313490a036166b24226d; in particular, challenge the documented proof domain and exclusions, and verify that expected behavior comes from an independent safe Rust, standard-library, language, or explicitly labeled policy oracle.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48967acdf5

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread zerocopy/src/impls.rs
Comment on lines +1538 to +1540
// Domain: Every initialized eight-byte source sequence for the thin
// pointer-bearing monomorphizations below. Eight bytes is the pointer size
// of the common 64-bit Kani CI target documented above.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document the omitted proof-bound dimensions

When this harness is audited or its Kani configuration changes, the stated domain does not disclose its allocation or assumption bounds, and it leaves readers to infer the eight-iteration scan and why unwind 9 is sufficient from the implementation. The repository’s formal-verification guidance requires each of those dimensions to be documented independently; add an explicit statement such as Assumptions: none; allocation: no dynamic allocation; loop: eight byte checks with unwind bound 9 so the claimed proof scope is reproducible rather than implementation-inferred.

AGENTS.md reference: zerocopy/AGENTS.md:L67-L73

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the current revision. The pointer-family scope now states that every harness uses fixed eight-byte stack inputs, performs no dynamic allocation, contains no explicit proof loop, and uses no kani::assume; every initialized eight-byte input is unconstrained. #[kani::unwind(9)] bounds the modeled eight-byte scans with unwinding assertions enabled.

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 48967acdf5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@joshlf
joshlf force-pushed the Gzi6kdmiqx3hi24gccqw5f6pebmv47idc branch from 48967ac to 53ae6e6 Compare September 7, 2026 23:05
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review current head 8ed91709d5ed8f75d8b0ec7a53012dfb270856ee; in particular, challenge the documented proof domain and exclusions, and verify that expected behavior comes from an independent safe Rust, standard-library, language, or explicitly labeled policy oracle.

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

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 8ed91709d5

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from 3879072 to ed4cbd6 Compare September 9, 2026 01:53
@joshlf
joshlf force-pushed the Gzi6kdmiqx3hi24gccqw5f6pebmv47idc branch from 8ed9170 to 95247f7 Compare September 9, 2026 01:53
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

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

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 95247f762b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@joshlf
joshlf force-pushed the Gzi6kdmiqx3hi24gccqw5f6pebmv47idc branch from 95247f7 to b643033 Compare September 9, 2026 02:28
@joshlf
joshlf force-pushed the G56sp4dsuukjpe3trlzhqbkuvl6f53jkg branch from ed4cbd6 to bdccd1c Compare September 9, 2026 02:28
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

Please review exact head b643033e3f9c2e816372181da032768acf530739.

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

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: b643033e3f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

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

@codex review

Exact-head review request: 9509491

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 9509491b8a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@joshlf
joshlf force-pushed the Gzi6kdmiqx3hi24gccqw5f6pebmv47idc branch from 9509491 to 98be607 Compare September 9, 2026 05:30
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

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

@codex review

Exact-head review request: 98be607

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 98be607d07

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

gherrit-pr-id: Gzi6kdmiqx3hi24gccqw5f6pebmv47idc
@joshlf

joshlf commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

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

@codex review

Exact-head review request: 4c03bd0

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Provided git ref 4c03bd092429697bbda2f180ac83c8dd8585ce0d does not exist
ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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