DeepConcepts

Linux kernel / bpf / attach points / enforcement

Where an eBPF Program Attaches Decides Whether It Can Say No

The misconception

That eBPF is one capability you turn on, so any eBPF tool can see and block anything. A tracepoint's return value is discarded — it is a notification and nothing else. A kprobe on an internal function can only change the outcome through bpf_override_return, which needs CONFIG_BPF_KPROBE_OVERRIDE, must sit at function entry, and only works on functions a kernel developer explicitly added to the error-injection whitelist; none of the functions on the ordinary exec, open, connect or write paths are on it. A BPF LSM program is the one that returns a decision the kernel obeys — and even there, 54 of the 277 LSM hooks return void, so attaching to one of those buys observation too. The failure mode is believing a tracing tool is blocking when it is only watching, or reaching for a SIGKILL and not noticing that sched_process_exec fires after begin_new_exec, which the kernel's own comment calls the point of no return.

15 min

An eBPF program's return value is only a decision if the kernel code that called it is written to consume one, so what a program can observe and whether it can change the outcome are both fixed by the attach point, and the useful question about any attach point is where it sits relative to the moment the action becomes irreversible.

The lesson that sent you here

  • Kernel Enforcement Cannot See Intent

    That putting Tetragon or Falco under an agent contains it, because eBPF sees everything and blocks in-kernel at microsecond latency. Coverage really is that good and the block really does hold. The gap is semantic: the hook sees an outbound connection to an allowed address, not that a prompt injection caused it or that the bytes are rows from a table the agent was never meant to query. Because a legitimate agent's paths, hosts and processes drift prompt to prompt, a learned allowlist is either loose enough to contain the attacker's primitives too or tight enough to break the agent — and the settings in between shrink to nothing as that drift grows. The designs that work concede this by construction: they use eBPF to see and to redirect, and put the decision at a layer that has the nouns — an L7 proxy, a per-agent identity, a network policy, an admission rule. The cost of not knowing that is a control that is trusted, correct, and produces no security.

1 published lesson depends on this concept, which is what moves it up the writing queue. Nothing is hidden behind this page — it has not been written.

Why this concept is on the site

Topics are chosen from places engineers visibly get stuck, and the sources are kept with the lesson so the claim is checkable.