-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bpf2bpf local function calls with stack usage #784
Conversation
Signed-off-by: Dave Thaler <[email protected]>
WalkthroughThe changes in this pull request involve updates to the Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🔇 Additional comments (3)ebpf-samples (1)
The subproject commit update aligns with the PR objectives to include test cases for bpf2bpf local function calls. Let's verify the dependency and commit: test-data/subtract.yaml (1)
The added error message properly complements the existing upper bound check by ensuring the lower bound of stack access stays within the subprogram's stack frame. This aligns well with the PR's objective of fixing stack usage in bpf2bpf local function calls. Let's verify the consistency of stack size constants across the codebase: ✅ Verification successfulStack size constants and bound checks are consistently defined and used across the codebase The verification shows that:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify stack size constants are consistently defined and used
# Expected: Find definitions of EBPF_TOTAL_STACK_SIZE and EBPF_SUBPROGRAM_STACK_SIZE
# and their usage in stack bound checks
# Search for stack size constant definitions
echo "=== Stack size constant definitions ==="
rg "EBPF_(TOTAL|SUBPROGRAM)_STACK_SIZE"
# Search for stack bound checking patterns
echo "=== Stack bound checking patterns ==="
rg "r10\.stack_offset.*EBPF.*STACK_SIZE"
Length of output: 5237 test-data/stack.yaml (1)
The updated error message now directly references Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
Turns out clang/gcc generate code that depends on r10 being updated by the platform across function calls. This PR corrects the verifier to have the expected behavior and tests it with an actual sample ELF generated by clang.
Summary by CodeRabbit
New Features
Bug Fixes
ebpf_domain_t
class, simplifying access checks and ensuring correct memory management.Refactor
Documentation