Skip to content

Rust: Update split_off models#21376

Open
geoffw0 wants to merge 3 commits intogithub:mainfrom
geoffw0:splitoff2
Open

Rust: Update split_off models#21376
geoffw0 wants to merge 3 commits intogithub:mainfrom
geoffw0:splitoff2

Conversation

@geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Feb 26, 2026

Convert split_off QL-defined barrier to a neutral model (which was always the intent).

Draft: this is atop 7 commits from #21375 , I'll rebase onto main after that is merged.

@geoffw0 geoffw0 added no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code labels Feb 26, 2026
@geoffw0 geoffw0 marked this pull request as ready for review March 6, 2026 17:24
@geoffw0 geoffw0 requested a review from a team as a code owner March 6, 2026 17:24
Copilot AI review requested due to automatic review settings March 6, 2026 17:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Rust standard-library modeling for split_off by replacing a QL-defined barrier with a models-as-data neutral model, aligning with the earlier intent to represent these “don’t treat as sink” cases in MaD.

Changes:

  • Removed the QL-defined barrier that previously suppressed uncontrolled-allocation-size flow into Vec::split_off / String::split_off.
  • Added MaD neutralModel entries for Vec::split_off and String::split_off to prevent spurious generated sink models.
  • Moved several From::from neutral-model entries for alloc types from core.model.yml into alloc.model.yml.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll Removes the dedicated split_off barrier so behavior is controlled via MaD instead.
rust/ql/lib/codeql/rust/frameworks/stdlib/core.model.yml Removes neutral-model entries for alloc-crate From::from impls (now hosted in alloc.model.yml).
rust/ql/lib/codeql/rust/frameworks/stdlib/alloc.model.yml Adds neutral models for split_off and relocates neutral models for several alloc From::from impls.

@geoffw0
Copy link
Contributor Author

geoffw0 commented Mar 6, 2026

Thanks for the quick review, I will wait for DCA and merge (assuming that is uneventful).

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

Labels

no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants