diff options
| author | Kaitao Cheng <chengkaitao@kylinos.cn> | 2026-05-21 06:23:03 +0300 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-05-21 12:47:45 +0300 |
| commit | e6919ff67c1e612ec1ce3be51dba6e7ffc47997a (patch) | |
| tree | fd5bbe65f635ace35da708ba2d7e2cd0372a1cfb /include/linux | |
| parent | 187baa10963ac9f1db5123fa2ab761ab34ea06b9 (diff) | |
| download | linux-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
