← Back to Pull requests

sbpf, vm: read program text with FD_LOAD #11149

Open
unknown opened this pull request with 185 lines diff across 2 files
View on GitHub
unknown unknown commented on Aug 31, 2026 18:53 UTC
Author

Addresses #10341.

On the lenient path a program's text section can land at an odd address, making every instruction read a misaligned load. As far as I can tell Agave accepts and runs such programs, since it reads instructions byte by byte and never checks alignment (https://github.com/anza-xyz/sbpf/blob/v0.14.4/src/ebpf.rs#L675-L684), so rejecting them on our side would diverge. Instead this reads the text words through FD_LOAD, which compiles down to the exact same load as before, so the interpreter doesn't pay for it.

One thing I left alone: the text pointer itself is still typed as if it were aligned, which strictly speaking is still UB even with nothing reading through it. Cleaning that up means retyping the field and touching a bunch of signatures, and that felt too big for a first PR here. Happy to do the wider version instead if that's preferred.

The tests guard the parity, not the UB: a program with oddly placed text has to keep loading and validating exactly like an aligned one, so a well-meaning alignment check can't slip in later. The UB itself they can't catch, since the sanitizer report doesn't fail the build and x86 shrugs the load off, so the ubsan job going quiet is the only visible change there.

I ran the loader and VM unit tests under both gcc and clang with ubsan: the misaligned-load report shows up without the fix and is gone with it. The workspace-backed tests wouldn't run in my environment, so those ride on CI.

Diff: 185 lines (+138 / -47) across 2 files Reviewer: valentynkit Review duration: 66186m
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.43) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 185 lines diff across 2 files
0.43
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
44%
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
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.313
Real PR Conversation Timeline
1 comments
"Review active on #11149"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 44.7% 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: 42.7% (MEDIUM) · Higher = larger blast radius
42.7%
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: 44.7% · Lower = rushed or shallow review
44.7%
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: 23.6% · Safe to merge
23.6%