bpf_binprm_select_interp(9)
π bpf_binprm_select_interp(9) π
hii bestie, welcome to the kernel API manual β¨ this one is short but lowkey iconic, and it's literally about running an exec under an interpreter the entry bound π«Ά
πΈ NAME πΈ
bpf_binprm_select_interp β run this exec under an interpreter the entry bound π
β¨ SYNOPSIS β¨
__bpf_kfunc int bpf_binprm_select_interp (struct linux_binprm *bprm , const char *name , size_t name__sz );
π ARGUMENTS π
bprmβ the binary that is being executed πnameβ the name the interpreter was registered under π·οΈname__szβ size of thenamebuffer, including the terminating NUL π§
π¦ DESCRIPTION π¦
okay so this is meant to be called from the load program of a struct binfmt_misc_ops handler instead of bpf_binprm_set_interp β it selects one of the interpreters the matched entry was registered with, and each of those was opened once when the entry was registered π₯
nothing is resolved at exec time, so no filesystem view can redirect the interpreter β no cap, that's the whole point π
the interpreter runs under the path the entry registered it under π£οΈ and calling it again replaces the selection π periodt.
π₯ RETURN π₯
0on success π-ENOENTif the matched entry bound no interpreter of that name π- a negative
errnoon failure π
π SEE ALSO π
kernel file ./fs/binfmt_misc_bpf.c and the whole squad: binfmt_misc_get_ops(9), bpf_binprm_set_interp(9), bpf_binprm_set_interp_arg(9), bpf_binprm_set_flags(9) π
xoxo π from ./fs, October 2026 β bpf_binprm_select_interp(9) π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms