Rust: Add support for defining barriers and barrier guards using models-as-data#21475
Rust: Add support for defining barriers and barrier guards using models-as-data#21475owen-mc wants to merge 14 commits intogithub:mainfrom
Conversation
|
I have opened owen-mc#6 against this branch. |
4af95da to
56d459a
Compare
|
Fix for barrier guards: owen-mc#7 |
9b1e73e to
bde9378
Compare
| Rerun has been triggered. |
There was a problem hiding this comment.
Pull request overview
Adds Rust dataflow support for defining flow barriers and barrier guards via models-as-data, wiring them through the shared flow summary infrastructure and exposing a small Rust-facing API plus tests.
Changes:
- Introduces shared and Rust-specific flow-summary support for barrier and barrier-guard elements/specs.
- Adds Rust models-as-data extensibles (
barrierModel,barrierGuardModel) and a publicFlowBarrierlibrary API to consume them. - Updates Rust library tests to exercise barrier and barrier-guard behavior using an
.ext.ymlMaD extension.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll | Adds barrier/barrier-guard element/spec plumbing to shared flow-summary implementation. |
| rust/ql/test/library-tests/dataflow/barrier/main.rs | Extends the Rust test program with barrier and barrier-guard scenarios. |
| rust/ql/test/library-tests/dataflow/barrier/inline-flow.ql | Updates inline flow test configuration to use the new barrier API. |
| rust/ql/test/library-tests/dataflow/barrier/inline-flow.ext.yml | Adds MaD extension rows for a barrier and a barrier guard used by the test. |
| rust/ql/test/library-tests/dataflow/barrier/inline-flow.expected | Updates expected results for the inline flow test. |
| rust/ql/lib/codeql/rust/dataflow/internal/empty.model.yml | Ensures barrier/barrier-guard extensibles have at least one definition (empty) in the pack. |
| rust/ql/lib/codeql/rust/dataflow/internal/SsaImpl.qll | Adds internal support for parameterized barrier guards. |
| rust/ql/lib/codeql/rust/dataflow/internal/Node.qll | Fixes typos in source/sink node documentation comments. |
| rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll | Defines MaD extensible predicates and model pretty-printing for barriers and barrier guards. |
| rust/ql/lib/codeql/rust/dataflow/internal/FlowSummaryImpl.qll | Adjusts Rust flow-summary integration to support barrier node extraction details. |
| rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll | Wires barriers/barrier-guards into Rust dataflow via barrier nodes and guard checks. |
| rust/ql/lib/codeql/rust/dataflow/FlowBarrier.qll | Adds a public Rust library entry point for barriers and barrier guards (and barrierNode). |
| * the value referred to by `input` is assumed to lead to a parameter of a call | ||
| * (possibly `self`), and the call is guarding the parameter. | ||
| * `branch` is either `true` or `false`, indicating which branch of the guard | ||
| * is protecting the parameter. |
There was a problem hiding this comment.
The barrierGuardModel doc comment has a couple issues: the sentence at line 115 starts with a lowercase "the", and branch is documented as boolean (true/false) even though the predicate parameter is a string. Please adjust the wording to be grammatically consistent and clarify the expected string values (for example, literal strings "true"/"false").
| * the value referred to by `input` is assumed to lead to a parameter of a call | |
| * (possibly `self`), and the call is guarding the parameter. | |
| * `branch` is either `true` or `false`, indicating which branch of the guard | |
| * is protecting the parameter. | |
| * The value referred to by `input` is assumed to lead to a parameter of a call | |
| * (possibly `self`), and the call is guarding the parameter. | |
| * `branch` is either `"true"` or `"false"` (as a string literal), indicating which | |
| * branch of the guard is protecting the parameter. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| Rerun has been triggered. |
No description provided.