feat: add GPU SIMT-aware eBPF verifier - #561
Open
yunwei37 wants to merge 2 commits into
Open
Conversation
Add a GPU-specific verification pass that extends standard eBPF safety checks with SIMT-aware constraints for safe device-side policy execution. The verifier pipeline runs PREVAIL (standard eBPF memory safety, bounded loops, type checking) followed by GPU-specific SIMT checks: - Warp-uniformity dataflow analysis: CFG-based fixed-point iteration tracking register and stack-slot uniformity, with metadata-driven helper classification (uniform vs lane-varying return values and out-parameter effects) - SIMT safety checks: reject lane-varying branch conditions, prohibited helpers (e.g., membar), non-uniform atomic addresses, and lane-varying map-update keys (checked via stack-byte uniformity with map-descriptor-aware key sizes) - Per-hook resource budgets with PREVAIL stats-based loop scaling - Map-value pointer provenance: loads from map_lookup results inherit key uniformity; context loads remain uniform (warp-leader model) - Warp-aggregation helper infrastructure for future __ballot_sync etc. Integration: - Verifier called in nv_attach_impl before PTX compilation - Supports BPFTIME_VERIFIER_LEVEL: STRICT (reject) / WARNING / NO_VERIFY - Strict rejection cleanly aborts the GPU attach process - GPU helpers registered via set_non_kernel_helpers() so PREVAIL accepts them without submodule modifications Test coverage: 24 test cases, 175 assertions - Unit tests: uniformity analysis, SIMT safety, resource budget - E2E tests: compiled .bpf.c programs (unsafe rejected, safe accepted) - Stress tests: stack propagation, multi-byte keys, dead code, unknown helpers, helper out-params, loop-aware budgets, descriptor fallback Eval data (benchmark/gpu/verifier/): - Correctness: 10/10 expected verdicts matched - False positives: 0/18 example programs falsely rejected - SIMT pass performance: 18-1284 μs (16-2048 instructions) - Live GPU demo (RTX 5090): verification adds ~3ms to policy load (<1% of total CUDA attach overhead) - Comparison: catches 5 GPU-specific hazard classes that standard eBPF verification misses Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Pass map descriptors explicitly to analyze_uniformity() instead of reading global state (critical correctness fix) - Remove accidentally committed 1.5MB ELF binary from live_demo - Fix -Wmissing-field-initializers warnings (add dump_btf_types_json) - Update safety_demo_results.md to reflect fail-closed fix Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Mar 30, 2026
Member
Author
|
CI triage update (2026-07-16): this branch is substantially behind/conflicting and has broad old failures/cancellations across CPU, runtime, Docker, bpftrace, and GPU jobs. This is not a narrowly fixable CI flake from current logs. It needs a rebase onto current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nv_attach_implGPU loading path, called before PTX compilationVerifier Pipeline
Key Design Decisions
set_non_kernel_helpers(), no submodule changesgpu_platformtable, not hard-coded IDsmap_lookupresults inherit key uniformityEval Results
Verification adds ~3ms to policy load (<1% of CUDA attach overhead). SIMT pass itself is 18-1284 μs for 16-2048 instruction programs.
lane-varying branches, prohibited helpers, non-uniform atomics, varying map keys, resource budget violations
Suggested eval paragraph for paper (RQ3)
Test plan
bpftime_gpu_verifier_tests— 35 assertions, 4 test casesbpftime_gpu_verifier_e2e_tests— 30 assertions, 4 test cases (compiled .bpf.c → bytecode → verifier)bpftime_gpu_verifier_stress_tests— 99 assertions, 10 test cases (gap-specific coverage)bpftime_verifier_tests— 11 assertions, 6 test cases (CPU regression)🤖 Generated with Claude Code