bpf: skip compat hooks when !IA32_EMULATION#297
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughChangesThe PR adds x86_64 kernel-configuration detection for Compat syscall hook gating
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant EbpfTracer
participant KernelConfig
participant CompatHooks
participant ExecEventsTest
EbpfTracer->>KernelConfig: check CONFIG_IA32_EMULATION
KernelConfig-->>EbpfTracer: loading decision
EbpfTracer->>CompatHooks: disable autoload when unavailable
ExecEventsTest->>KernelConfig: check CONFIG_IA32_EMULATION
KernelConfig-->>ExecEventsTest: test decision
Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces conditional loading of compat syscall hooks based on the kernel configuration (CONFIG_IA32_EMULATION) on x86_64 platforms, preventing load failures when legacy 32-bit emulation is disabled. Feedback on the changes suggests explicitly disabling these compat programs on all non-x86_64 architectures (such as aarch64 or riscv64) in both the tracer and the verifier complexity tool to avoid load failures on those platforms. Additionally, it is recommended to replace Option::is_none_or with map_or to maintain compatibility with older Rust toolchains.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| pub fn should_load_compat_syscall_hooks(kconfig: Option<&HashMap<String, ConfigSetting>>) -> bool { | ||
| // procfs omits `# CONFIG_IA32_EMULATION is not set`, so the option is absent | ||
| // from a successfully read configuration when support is disabled. | ||
| kconfig.is_none_or(|configs| configs.contains_key("CONFIG_IA32_EMULATION")) |
There was a problem hiding this comment.
Option::is_none_or was stabilized in Rust 1.82.0. To maintain compatibility with older Rust toolchains (MSRV), we can use map_or(true, ...) which is functionally identical and supported since Rust 1.0.0.
| kconfig.is_none_or(|configs| configs.contains_key("CONFIG_IA32_EMULATION")) | |
| kconfig.map_or(true, |configs| configs.contains_key("CONFIG_IA32_EMULATION")) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #297 +/- ##
==========================================
- Coverage 82.25% 82.21% -0.05%
==========================================
Files 84 84
Lines 21026 21057 +31
==========================================
+ Hits 17295 17311 +16
- Misses 3731 3746 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit
Bug Fixes
Tests