bpf_list_push_front(9)
π bpf_list_push_front β add a node to the front of a BPF linked list
okay so bestie, welcome to the bpf_list_push_front(9) page. that (9) means it's a kernel API manual page, and today we're learning how to shove a node onto the front of a BPF linked list. yes, front. like cutting the line. iconic behavior honestly π
β¨ SYNOPSIS β¨
__bpf_kfunc int bpf_list_push_front (struct bpf_list_head *head , struct
bpf_list_node *node , struct btf_struct_meta *meta , u64 off );
that's the whole signature, no cap. four args, one return, let's go π¦
π«Ά ARGUMENTS π«Ά
headβ the list head. the actual list you're messing with πnodeβ the node you're inserting. the new main character πmetaβ struct metadata, and it's verifier-supplied. you don't touch this.offβ the offset ofnodewithin the containing object, also verifier-supplied. again, not your job π
πΈ DESCRIPTION πΈ
so what actually happens: node gets inserted at the front of head. that's it. that's the whole vibe.
BUT β and this is the part everyone asks about β the verifier rewrites meta and off for you. like literally rewrites them. BPF programs do not set them. so don't try, bestie, it's not gonna go how you think π
β RETURN β
0on success β¨ slay-EINVALifnodeis already linked π (it's already in a list, it cannot be in two, that's not how this works)
π₯ SEE ALSO π₯
the whole friend group, fr fr. this is the kernel file ./kernel/bpf/helpers.c crew:
bpf_obj_new(9)bpf_percpu_obj_new(9)bpf_obj_drop(9)bpf_percpu_obj_drop(9)bpf_refcount_acquire(9)bpf_list_push_back(9)bpf_rbtree_add(9)bpf_task_acquire(9)bpf_task_release(9)bpf_cgroup_acquire(9)bpf_cgroup_release(9)bpf_cgroup_ancestor(9)bpf_cgroup_from_id(9)bpf_task_under_cgroup(9)bpf_task_get_cgroup1(9)bpf_task_from_pid(9)bpf_task_from_vpid(9)bpf_dynptr_slice(9)bpf_dynptr_slice_rdwr(9)bpf_dynptr_copy(9)bpf_dynptr_memset(9)bpf_iter_bits_new(9)bpf_iter_bits_next(9)bpf_iter_bits_destroy(9)bpf_copy_from_user_str(9)bpf_copy_from_user_task_str(9)bpf_strcmp(9)bpf_strcasecmp(9)bpf_strnchr(9)bpf_strchr(9)bpf_strchrnul(9)bpf_strrchr(9)bpf_strnlen(9)bpf_strlen(9)bpf_strspn(9)bpf_strcspn(9)bpf_strstr(9)bpf_strcasestr(9)bpf_strnstr(9)bpf_strncasestr(9)bpf_lookup_user_key(9)bpf_lookup_system_key(9)bpf_key_put(9)bpf_verify_pkcs7_signature(9)bpf_task_work_schedule_signal(9)bpf_task_work_schedule_resume(9)bpf_timer_cancel_async(9)
mwah π this page lives in ./kernel/bpf, dated October 2026, and the manual entry is bpf_list_push_front(9). go push something to the front, you got this π§
π¦ 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