Introduction
Imagine a world where binaries can be moved around and executed without fixed interpreter concerns. This is exactly what the new support for $ORIGIN in the Linux kernel promises, an advancement made possible through the use of eBPF. Let's break down this advancement and see what it means for the Nix ecosystem and similar systems.
What is $ORIGIN?
$ORIGIN is an environment variable used in Unix systems to reference the path of the binary itself. This allows binaries to find their associated libraries, regardless of their location. Until recently, this feature was not directly supported by the Linux kernel.
The Challenge of Relocatable Binaries
The need for relocatable binaries has become critical with the rise of containers and multi-platform development environments. Tools like Nix, Buck, and Bazel seek to optimize these processes. However, the lack of direct support for $ORIGIN in the Linux kernel has been a major hurdle.
Farid Zakaria's Proposal
During the TacoSprint 2026 event, Farid Zakaria proposed a bold idea: patch the Linux kernel to support $ORIGIN. His approach involved integrating this feature into the kernel's Virtual File System (VFS) subsystem.
The eBPF Intervention
Christian Brauner, the VFS maintainer, suggested an innovative approach: using eBPF to integrate this feature. eBPF, or Extended Berkeley Packet Filter, allows programs to run in the kernel securely and efficiently. This opens the door to a programmable selection of interpreters via binfmt_misc.
How Does It Work?
The idea is to leverage an eBPF program to dynamically determine the interpreter to use for a given binary. The program uses structures like linux_binprm to check and load the correct interpreter based on the binary's path.
Implications and Benefits
With this advancement, developers can now create and manage binaries that dynamically adapt to their environment. This simplifies dependency management and improves application portability.
Conclusion
The addition of support for $ORIGIN in the Linux kernel, albeit partially, marks a turning point for Linux-based systems. It could transform how applications are deployed and managed in the future.
Let's discuss your project in 15 minutes.