bpf_binprm_set_interp(9)
π NAME π
okay bestie, this is bpf_binprm_set_interp(9) from the Kernel API Manual (section 9), and its whole job is selecting the interpreter for the current exec. yes, thatβs the vibe. π¦
β¨ SYNOPSIS β¨
__bpf_kfunc int bpf_binprm_set_interp (struct linux_binprm *bprm , const
char *path , size_t path__sz );
πΈ ARGUMENTS πΈ
bprmβ the binary that is being executed. main character of this exec.pathβ absolute path to the interpreter. must be absolute, no cap.path__szβ size of thepathbuffer, including the terminating NUL. donβt forget the NUL, bestie. π
π DESCRIPTION π
so this kfunc is for the load program of a struct binfmt_misc_ops handler β call it there before you return zero. and listen: the verifier will reject this call from any other program, including the handlerβs own match program. like, it's giving βstrict guest list only.β π
the path gets opened with the credentials of the task doing the exec, and that happens after the program returns. if you call it again, youβre replacing the selection β same thing happens if you select an interpreter the entry bound with bpf_binprm_select_interp. so yes, last pick wins energy. β¨
β RETURN β
0 on success, a negative errno on failure. periodt. π«Ά
π SEE ALSO π
go peek at the Kernel file ./fs/binfmt_misc_bpf.c, plus these besties:
binfmt_misc_get_ops(9)bpf_binprm_select_interp(9)bpf_binprm_set_interp_arg(9)bpf_binprm_set_flags(9)
okay thatβs the page, bestie β source/version ./fs, date October 2026, signing off π
β¨
π¦ 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