This book is a catalogue of what CAP_BPF plus CAP_PERFMON (or CAP_SYS_ADMIN) actually permits on a modern aarch64 Linux kernel. Every chapter ships with a reproducible POC that runs under a Docker harness, a BEFORE/AFTER line on stdout, and an honest note when the primitive did not fire on the test kernel. Nothing here is a zero-day, an escalation from unprivileged, or a verifier bug. Read Chapter 0: What CAP_BPF Actually Permits first — it pins down the threat model, the non-claims, and how to read the rest of the catalogue.

Start here

Act I — Foundations

  1. Chapter 0: What CAP_BPF Actually Permits — threat model, non-claims, and how to read this book.
  2. Chapter 1: The Mirror Controls — cap_capable as an observation channel when override-return refuses to fire.
  3. Chapter 2: The OverlayFS Trojan Horse — forging upperdir writes the lowerdir never sees.
  4. Chapter 3: The FUSE Audit Black-Hole — userspace filesystems as a bypass for in-kernel audit.
  5. Chapter 4: The Phantom Syscall — tracepoint-driven syscall behaviour without touching the syscall table.
  6. Chapter 5: Slipping the Cgroup Leash — teaching the kernel to miscount CPU accounting. 5b. Chapter 5b: The Ghost NIC — sock_ops and XDP as a phantom interface invisible to ip link.
  7. Chapter 6: Silencing SELinux — AVC hook that does not fire on the test kernel (see Chapter 21).

Act II — Kernel Intrusion

  1. Chapter 7: Device-cgroup Houdini — slipping past device-cgroup allow/deny enforcement.
  2. Chapter 8: Keyring Heist — reading keyring payloads that were never meant to leave the kernel.
  3. Chapter 9: PID Namespace Doppelgänger — impersonating PIDs across namespace boundaries.
  4. Chapter 10: Inode Cloak — the d_reclen swallow trick for hiding directory entries.
  5. Chapter 11: IRQ Affinity Chaos — steering interrupts away from the cores that would notice.
  6. Chapter 12: eBPF Signed-Driver Swap — substituting driver behaviour without touching the signed module.

Act III — Total Control

  1. Chapter 14: SCHED_FIFO Impersonator — claiming realtime priority without the paperwork.
  2. Chapter 15: NetNS VLAN Ghost — VLAN-tagged exfil across network namespaces.
  3. Chapter 16: Seccomp TID Hop — escaping a seccomp filter by hopping threads.
  4. Chapter 18: eBPF Token Bypass — what the token model actually gates and what it does not.
  5. Chapter 19: What This Book Actually Demonstrated — the closing argument before the autopsy.

Synthesis

  1. Chapter 20: What We Proved — The Taxonomy — five primitive classes, three motions, cross-referenced to every firing chapter.
  2. Chapter 21: Skip Accounting — Primitives That Needed Another Kernel — the six primitives that refused to fire, with the kernel-environment reason for each.
  3. Chapter 22: The Defender Playbook — inventory, restrict, baseline, audit.

The harness

Every claim in this catalogue runs out of dBPF-pocs/harness/proof.py. The harness builds each POC, attaches it, triggers the primitive, and records both the BEFORE/AFTER lines and any verifier refusals or missing hooks. One-command reproduction:

1
2
3
4
docker run --rm -it --privileged --pid=host \
  -v /sys:/sys -v /sys/kernel/debug:/sys/kernel/debug -v /sys/fs/bpf:/sys/fs/bpf \
  -v $PWD/dBPF-pocs:/w -w /w \
  dbpf-harness:latest python3 /w/harness/proof.py

Scope

  • This book does not document zero-days, privilege escalation without CAP_BPF, or verifier bugs. Remove the capability from the threat model and every chapter stops working.
  • Every chapter was reproduced on kernel 6.12.54-linuxkit aarch64 via Docker Desktop on macOS. Other kernels may expose more — see Chapter 21: Skip Accounting — Primitives That Needed Another Kernel for the primitives that did not fire here and the kernel conditions they would need.