bpf_put_file(9)
π bpf_put_file(9)
okay so bestie, this page comes from the Kernel API Manual, and itβs all about bpf_put_file β the BPF kfunc that puts a reference on the supplied file. Itβs giving βreference hygiene is self-careβ energy π
β¨
π NAME π
bpf_put_file β put a reference on the supplied file. periodt π
β¨ SYNOPSIS β¨
__bpf_kfunc void bpf_put_file (struct file *file );
πΈ ARGUMENTS πΈ
fileβ the file to put a reference on. thatβs the whole assignment, bestie π«Ά
π¦ DESCRIPTION π¦
Put a reference on the supplied file. okay so thatβs the vibe: only referenced file pointers may be passed to this BPF kfunc, fr fr.
π¨ no cap: attempting to pass an unreferenced file pointer β or any other arbitrary pointer for that matter β will result in the BPF program being rejected by the BPF verifier. thatβs not a drill, bestie π
This BPF kfunc may only be called from BPF LSM programs. periodt. π
π₯ SEE ALSO π₯
- Kernel file
./fs/bpf_fs_kfuncs.c bpf_get_task_exe_file(9)bpf_path_d_path(9)bpf_get_dentry_xattr(9)bpf_get_file_xattr(9)bpf_set_dentry_xattr_locked(9)bpf_remove_dentry_xattr_locked(9)bpf_set_dentry_xattr(9)bpf_remove_dentry_xattr(9)bpf_cgroup_read_xattr(9)bpf_sock_read_xattr(9)bpf_real_data_inode(9)
mwah π β source: ./fs, date: October 2026, and yes bestie this is still bpf_put_file(9) energy. bye π«Άπ
π¦ 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