Skip to content

fix(agent): library-load probe reads d_name basename, not bpf_d_path (JEF-68)#22

Merged
thejefflarson merged 1 commit into
mainfrom
fix/jef-68-library-load-basename
Jun 21, 2026
Merged

fix(agent): library-load probe reads d_name basename, not bpf_d_path (JEF-68)#22
thejefflarson merged 1 commit into
mainfrom
fix/jef-68-library-load-basename

Conversation

@thejefflarson

Copy link
Copy Markdown
Owner

The mmap_file library-load probe was verifier-rejected on 6.8 — bpf_d_path isn't allowed in security_mmap_file (not on the kernel's d_path allowlist; security_file_open is, so secret-read works). Best-effort attach masked it, so LibraryLoaded never fired → JEF-51 reachability had no data.

Fix: keep the PROT_EXEC filter, but read the leaf dentry->d_name basename via bpf_probe_read_kernel (allowed everywhere) instead of bpf_d_path. Userspace already used only the basename → no userspace change; vmlinux already has dentry/qstr.

eBPF type-checks; Docker builder compiles+links (EXIT 0). Real gate is on-node: after deploy, confirm mmap_file attaches and LibraryLoaded events flow.

🤖 Generated with Claude Code

…(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
@thejefflarson thejefflarson merged commit 4b77d2d into main Jun 21, 2026
4 checks passed
@thejefflarson thejefflarson deleted the fix/jef-68-library-load-basename branch June 21, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant