← Back to Pull requests

Consolidate duplicate capability check lists flagged by ARC #1249

Merged
arichardson merged 1 files (41 lines) on Sep 16, 2026 16:20 UTC
View on GitHub
arichardson arichardson commented on Sep 11, 2026 21:58 UTC
Author

Follow-up to #1245 and #1238. Consolidate the duplicate lists that were flagged by ARC into Section 2.7.

Signed-off-by: Alex Richardson <alexrichardson@google.com>

Diff: 41 lines (+13 / -28) across 1 files Reviewer: tariqkurd-repo Review duration: 6862m
All Vouch review confidence checks passed
Residual risk 0.02 = Change Risk (0.25) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.25 · 41 lines diff across 1 files
0.25
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 5 substantive comment(s)
0.89
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
90%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.224
Real PR Conversation Timeline
9 items
tariqkurd-repo tariqkurd-repo commented on code on Sep 12, 2026 16:10 UTC
Code Review
src/cheri/riscv-unpriv-integration.adoc:1
@@ -823,16 +823,21 @@ In <<clen_access_summary_base>>, when there is no read or write width shown, the
 
 Every memory access must be authorized by a valid capability.
 
-Instruction fetches and data memory accesses raise an exception if the access is out of <<sec_cap_bounds_overview,bounds>>, or if the authorizing capability is missing the required <<AP-field,permissions>>:
+Instruction fetches and data memory accesses raise a CHERI exception if any of the following checks fail on the authorizing capability:
 
-* All load instructions require <<r_perm>> and are authorized by the capability in `{cs1}`
-* All store instructions require <<w_perm>> and are authorized by the capability in `{cs1}`
-* All AMO instructions require <<r_perm>> and <<w_perm>>, and are authorized by the capability in `{cs1}`
-* All instruction fetches require <<x_perm>> in <<pcc>>
-
-Instruction fetches are authorized by the program counter (<<pcc>>) which {cheri_base_ext_name} widens to a capability.
-
-NOTE: This allows code fetch to be bounded, preventing a wide range of attacks that subvert control flow with non-capability data.
+* The {ctag} must be set to one.
+** All memory access instruction encodings with `{cs1}={creg}0` are _reserved_ (since dereferencing <<null-cap>> in `{creg}0` always faults due to its {ctag} being zero).
+* The authorizing capability must not be sealed.
+* All <<section_cap_integrity,integrity>> checks on the authorizing capability must pass.
+* The access must not be out of <<sec_cap_bounds_overview,bounds>>.

I'd reverse the sense and say "all bytes of the access must be in bounds" which is more specific.

tariqkurd-repo tariqkurd-repo approved these changes on Sep 12, 2026 16:11 UTC
Approved Reviewer

one minor comment but look good!

arichardson arichardson commented on code on Sep 12, 2026 17:59 UTC
Code Review
src/cheri/riscv-unpriv-integration.adoc:1
@@ -823,16 +823,21 @@ In <<clen_access_summary_base>>, when there is no read or write width shown, the
 
 Every memory access must be authorized by a valid capability.
 
-Instruction fetches and data memory accesses raise an exception if the access is out of <<sec_cap_bounds_overview,bounds>>, or if the authorizing capability is missing the required <<AP-field,permissions>>:
+Instruction fetches and data memory accesses raise a CHERI exception if any of the following checks fail on the authorizing capability:
 
-* All load instructions require <<r_perm>> and are authorized by the capability in `{cs1}`
-* All store instructions require <<w_perm>> and are authorized by the capability in `{cs1}`
-* All AMO instructions require <<r_perm>> and <<w_perm>>, and are authorized by the capability in `{cs1}`
-* All instruction fetches require <<x_perm>> in <<pcc>>
-
-Instruction fetches are authorized by the program counter (<<pcc>>) which {cheri_base_ext_name} widens to a capability.
-
-NOTE: This allows code fetch to be bounded, preventing a wide range of attacks that subvert control flow with non-capability data.
+* The {ctag} must be set to one.
+** All memory access instruction encodings with `{cs1}={creg}0` are _reserved_ (since dereferencing <<null-cap>> in `{creg}0` always faults due to its {ctag} being zero).
+* The authorizing capability must not be sealed.
+* All <<section_cap_integrity,integrity>> checks on the authorizing capability must pass.
+* The access must not be out of <<sec_cap_bounds_overview,bounds>>.

Yeah that's better

tariqkurd-repo tariqkurd-repo commented on code on Sep 14, 2026 09:59 UTC
Code Review
src/cheri/riscv-unpriv-integration.adoc:1
@@ -823,16 +823,21 @@ In <<clen_access_summary_base>>, when there is no read or write width shown, the
 
 Every memory access must be authorized by a valid capability.
 
-Instruction fetches and data memory accesses raise an exception if the access is out of <<sec_cap_bounds_overview,bounds>>, or if the authorizing capability is missing the required <<AP-field,permissions>>:
+Instruction fetches and data memory accesses raise a CHERI exception if any of the following checks fail on the authorizing capability:
 
-* All load instructions require <<r_perm>> and are authorized by the capability in `{cs1}`
-* All store instructions require <<w_perm>> and are authorized by the capability in `{cs1}`
-* All AMO instructions require <<r_perm>> and <<w_perm>>, and are authorized by the capability in `{cs1}`
-* All instruction fetches require <<x_perm>> in <<pcc>>
-
-Instruction fetches are authorized by the program counter (<<pcc>>) which {cheri_base_ext_name} widens to a capability.
-
-NOTE: This allows code fetch to be bounded, preventing a wide range of attacks that subvert control flow with non-capability data.
+* The {ctag} must be set to one.
+** All memory access instruction encodings with `{cs1}={creg}0` are _reserved_ (since dereferencing <<null-cap>> in `{creg}0` always faults due to its {ctag} being zero).
+* The authorizing capability must not be sealed.
+* All <<section_cap_integrity,integrity>> checks on the authorizing capability must pass.
+* The access must not be out of <<sec_cap_bounds_overview,bounds>>.
+ifdef::invalid_address_viol[]

why the ifdef? will this text be excluded in unpriv so we need a duplicate section in priv? hoefully we can avoid that with the merged manual.

tariqkurd-repo tariqkurd-repo commented on code on Sep 14, 2026 10:04 UTC
Code Review
src/cheri/riscv-unpriv-integration.adoc:1
@@ -823,16 +823,21 @@ In <<clen_access_summary_base>>, when there is no read or write width shown, the
 
 Every memory access must be authorized by a valid capability.
 
-Instruction fetches and data memory accesses raise an exception if the access is out of <<sec_cap_bounds_overview,bounds>>, or if the authorizing capability is missing the required <<AP-field,permissions>>:
+Instruction fetches and data memory accesses raise a CHERI exception if any of the following checks fail on the authorizing capability:
 
-* All load instructions require <<r_perm>> and are authorized by the capability in `{cs1}`
-* All store instructions require <<w_perm>> and are authorized by the capability in `{cs1}`
-* All AMO instructions require <<r_perm>> and <<w_perm>>, and are authorized by the capability in `{cs1}`
-* All instruction fetches require <<x_perm>> in <<pcc>>
-
-Instruction fetches are authorized by the program counter (<<pcc>>) which {cheri_base_ext_name} widens to a capability.
-
-NOTE: This allows code fetch to be bounded, preventing a wide range of attacks that subvert control flow with non-capability data.
+* The {ctag} must be set to one.
+** All memory access instruction encodings with `{cs1}={creg}0` are _reserved_ (since dereferencing <<null-cap>> in `{creg}0` always faults due to its {ctag} being zero).
+* The authorizing capability must not be sealed.
+* All <<section_cap_integrity,integrity>> checks on the authorizing capability must pass.
+* The access must not be out of <<sec_cap_bounds_overview,bounds>>.

* All bytes of the access must be in <<sec_cap_bounds_overview,bounds>>.

arichardson arichardson commented on code on Sep 14, 2026 17:12 UTC
Code Review
src/cheri/riscv-unpriv-integration.adoc:1
@@ -823,16 +823,21 @@ In <<clen_access_summary_base>>, when there is no read or write width shown, the
 
 Every memory access must be authorized by a valid capability.
 
-Instruction fetches and data memory accesses raise an exception if the access is out of <<sec_cap_bounds_overview,bounds>>, or if the authorizing capability is missing the required <<AP-field,permissions>>:
+Instruction fetches and data memory accesses raise a CHERI exception if any of the following checks fail on the authorizing capability:
 
-* All load instructions require <<r_perm>> and are authorized by the capability in `{cs1}`
-* All store instructions require <<w_perm>> and are authorized by the capability in `{cs1}`
-* All AMO instructions require <<r_perm>> and <<w_perm>>, and are authorized by the capability in `{cs1}`
-* All instruction fetches require <<x_perm>> in <<pcc>>
-
-Instruction fetches are authorized by the program counter (<<pcc>>) which {cheri_base_ext_name} widens to a capability.
-
-NOTE: This allows code fetch to be bounded, preventing a wide range of attacks that subvert control flow with non-capability data.
+* The {ctag} must be set to one.
+** All memory access instruction encodings with `{cs1}={creg}0` are _reserved_ (since dereferencing <<null-cap>> in `{creg}0` always faults due to its {ctag} being zero).
+* The authorizing capability must not be sealed.
+* All <<section_cap_integrity,integrity>> checks on the authorizing capability must pass.
+* The access must not be out of <<sec_cap_bounds_overview,bounds>>.
+ifdef::invalid_address_viol[]

Not sure I just copied that from your previous text.

tariqkurd-repo tariqkurd-repo commented on code on Sep 14, 2026 18:52 UTC
Code Review
src/cheri/riscv-unpriv-integration.adoc:1
@@ -823,16 +823,21 @@ In <<clen_access_summary_base>>, when there is no read or write width shown, the
 
 Every memory access must be authorized by a valid capability.
 
-Instruction fetches and data memory accesses raise an exception if the access is out of <<sec_cap_bounds_overview,bounds>>, or if the authorizing capability is missing the required <<AP-field,permissions>>:
+Instruction fetches and data memory accesses raise a CHERI exception if any of the following checks fail on the authorizing capability:
 
-* All load instructions require <<r_perm>> and are authorized by the capability in `{cs1}`
-* All store instructions require <<w_perm>> and are authorized by the capability in `{cs1}`
-* All AMO instructions require <<r_perm>> and <<w_perm>>, and are authorized by the capability in `{cs1}`
-* All instruction fetches require <<x_perm>> in <<pcc>>
-
-Instruction fetches are authorized by the program counter (<<pcc>>) which {cheri_base_ext_name} widens to a capability.
-
-NOTE: This allows code fetch to be bounded, preventing a wide range of attacks that subvert control flow with non-capability data.
+* The {ctag} must be set to one.
+** All memory access instruction encodings with `{cs1}={creg}0` are _reserved_ (since dereferencing <<null-cap>> in `{creg}0` always faults due to its {ctag} being zero).
+* The authorizing capability must not be sealed.
+* All <<section_cap_integrity,integrity>> checks on the authorizing capability must pass.
+* The access must not be out of <<sec_cap_bounds_overview,bounds>>.
+ifdef::invalid_address_viol[]

ok let's drop it then

tariqkurd-repo tariqkurd-repo commented on code on Sep 14, 2026 18:52 UTC
Code Review
src/cheri/riscv-unpriv-integration.adoc:1
@@ -823,16 +823,21 @@ In <<clen_access_summary_base>>, when there is no read or write width shown, the
 
 Every memory access must be authorized by a valid capability.
 
-Instruction fetches and data memory accesses raise an exception if the access is out of <<sec_cap_bounds_overview,bounds>>, or if the authorizing capability is missing the required <<AP-field,permissions>>:
+Instruction fetches and data memory accesses raise a CHERI exception if any of the following checks fail on the authorizing capability:
 
-* All load instructions require <<r_perm>> and are authorized by the capability in `{cs1}`
-* All store instructions require <<w_perm>> and are authorized by the capability in `{cs1}`
-* All AMO instructions require <<r_perm>> and <<w_perm>>, and are authorized by the capability in `{cs1}`
-* All instruction fetches require <<x_perm>> in <<pcc>>
-
-Instruction fetches are authorized by the program counter (<<pcc>>) which {cheri_base_ext_name} widens to a capability.
-
-NOTE: This allows code fetch to be bounded, preventing a wide range of attacks that subvert control flow with non-capability data.
+* The {ctag} must be set to one.
+** All memory access instruction encodings with `{cs1}={creg}0` are _reserved_ (since dereferencing <<null-cap>> in `{creg}0` always faults due to its {ctag} being zero).
+* The authorizing capability must not be sealed.
+* All <<section_cap_integrity,integrity>> checks on the authorizing capability must pass.
+* All bytes of the access must be in <<sec_cap_bounds_overview,bounds>>.
+ifdef::invalid_address_viol[]
+* The virtual address in the authorizing capability must not be invalid if virtual memory is enabled.
+endif::[]

* The virtual address in the authorizing capability must not be invalid if virtual memory is enabled.

Assignees
arichardson arichardson
Labels
risk: low confidence: 90.6% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 25.4% (LOW) · Higher = larger blast radius
25.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 90.6% · Lower = rushed or shallow review
90.6%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 2.4% · Safe to merge
2.4%