HeadlinesBriefing favicon HeadlinesBriefing.com

Linux Kernel Adds $ORIGIN Support via eBPF

Hacker News •
×

During Taco Sprint 2026, I explored relocatable binaries in Nix by proposing a Linux kernel patch for $ORIGIN support in PT_INTERP and shebang. VFS maintainer Christian Brauner responded constructively, suggesting eBPF as a programmable interpreter selection mechanism via binfmt_misc.

The resulting eBPF program registers with binfmt_misc to dynamically resolve interpreters, supporting $ORIGIN in both ELF headers and shebangs. John Ericson advocated for non-fixed interpreters, benefiting Nix, Buck, and Bazel. Christian's patch series introduces new dispatch modes, notably the L flag, which substitutes the registered interpreter for the binary's PT_INTERP without identity leakage.

This makes binfmt_misc a transparent PT_INTERP override, allowing stock dynamic loaders to work unchanged. Once merged into -next and released, I'll upstream a NixOS module registering $ORIGIN support at boot, gated on a new PT_INTERP_NIX segment for opt-in relocatable binaries.