Fix ARM64 compatibility with kernel version-aware VMA collection#47
Merged
Fix ARM64 compatibility with kernel version-aware VMA collection#47
Conversation
Resolves issue #46: segfault_analyzer fails on ARM64 kernel 5.15.52 Problem: - bpf_find_vma helper (introduced in kernel 5.17) not available on older kernels - BPF verifier rejects program with 'invalid func unknown#180' error - ARM64 systems often run kernel 5.15.52 which lacks this helper Solution: - Add compile-time kernel version detection using LINUX_VERSION_CODE - Implement dual VMA collection methods: * Kernel 5.17+: Use modern bpf_find_vma() helper (optimal performance) * Kernel <5.17: Use manual VMA walking via task->mm->mmap (compatibility) - Automatic method selection at compile time - Safety bounds (max 1000 VMAs) to prevent infinite loops - File path extraction works on both implementation paths Benefits: - ARM64 compatibility on kernel 5.15.52 - Preserves VMA information for symbol resolution - No performance regression on modern kernels - Future-proof design with automatic detection - Maintains all existing segfault analysis capabilities The segfault analyzer now works on both modern and older kernel versions, automatically selecting the appropriate VMA collection method.
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.
What's changed
Problem:
Solution:
Benefits:
The segfault analyzer now works on both modern and older kernel versions, automatically selecting the appropriate VMA collection method.
Fixes #46