fix(agent): library-load probe reads d_name basename, not bpf_d_path (JEF-68)#22
Merged
Merged
Conversation
…(JEF-68)
The mmap_file (library-load) fentry was verifier-rejected on 6.8 ("helper call is not
allowed in probe"): bpf_d_path is only callable from hooks on the kernel's d_path
allowlist, and security_mmap_file isn't on it (security_file_open is, so secret-read is
fine). Best-effort attach masked it, so LibraryLoaded had never fired on these kernels —
leaving JEF-51's reachability correlation with no data.
Fix: keep the cheap PROT_EXEC filter on mmap_file, but read the library *name* — the leaf
dentry's d_name basename — directly via bpf_probe_read_kernel(_str) (allowed in any program
type) instead of bpf_d_path. Userspace already used only the basename, so no userspace
change. vmlinux already carries dentry/qstr (no BTF regen needed).
eBPF crate type-checks; the Linux Docker builder compiles+links the BPF object (EXIT 0).
The kernel verifier only runs on-node, so the real confirmation is the post-deploy attach
of mmap_file + LibraryLoaded events flowing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VtjoJttCvBY4dzCoE4f9vP
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.
The
mmap_filelibrary-load probe was verifier-rejected on 6.8 —bpf_d_pathisn't allowed insecurity_mmap_file(not on the kernel's d_path allowlist;security_file_openis, so secret-read works). Best-effort attach masked it, soLibraryLoadednever fired → JEF-51 reachability had no data.Fix: keep the
PROT_EXECfilter, but read the leafdentry->d_namebasename viabpf_probe_read_kernel(allowed everywhere) instead ofbpf_d_path. Userspace already used only the basename → no userspace change; vmlinux already hasdentry/qstr.eBPF type-checks; Docker builder compiles+links (EXIT 0). Real gate is on-node: after deploy, confirm
mmap_fileattaches andLibraryLoadedevents flow.🤖 Generated with Claude Code