summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKaitao Cheng <chengkaitao@kylinos.cn>2026-05-21 06:23:03 +0300
committerAlexei Starovoitov <ast@kernel.org>2026-05-21 12:47:45 +0300
commite6919ff67c1e612ec1ce3be51dba6e7ffc47997a (patch)
treefd5bbe65f635ace35da708ba2d7e2cd0372a1cfb /include/linux
parent187baa10963ac9f1db5123fa2ab761ab34ea06b9 (diff)
downloadlinux-e6919ff67c1e612ec1ce3be51dba6e7ffc47997a.tar.xz
bpf: refactor __bpf_list_add to take insertion point via **prev_ptr
Refactor __bpf_list_add to accept (node, head, struct list_head **prev_ptr, ..) instead of (node, head, bool tail, ..). Load prev from *prev_ptr after INIT_LIST_HEAD(h), so we never dereference an uninitialized h->prev when head was 0-initialized (e.g. push_back passes &h->prev). When prev is not the list head, validate that prev is in the list via its owner. Prepares for bpf_list_add(head, new, prev, ..) to insert after a given list node. Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn> Reviewed-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20260521032306.97118-6-kaitao.cheng@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions