[ Sasha's backport helper bot ]
Hi,
Summary of potential issues: ⚠️ Found follow-up fixes in mainline
The upstream commit SHA1 provided is correct: 1a80dbcb2dbaf6e4c216e62e30fa7d3daa8001ce
WARNING: Author mismatch between patch and upstream commit: Backport author: jianqi.ren.cn@windriver.com Commit author: Andrii Nakryikoandrii@kernel.org
Status in newer kernel trees: 6.14.y | Present (exact SHA1) 6.12.y | Present (exact SHA1) 6.6.y | Present (different SHA1: 876941f533e7)
Found fixes commits: 2884dc7d08d9 bpf: Fix a potential use-after-free in bpf_link_free()
Note: The patch differs from the upstream commit: --- 1: 1a80dbcb2dbaf ! 1: 40f6d480a2072 bpf: support deferring bpf_link dealloc to after RCU grace period @@ Metadata ## Commit message ## bpf: support deferring bpf_link dealloc to after RCU grace period
+ commit 1a80dbcb2dbaf6e4c216e62e30fa7d3daa8001ce upstream. + BPF link for some program types is passed as a "context" which can be used by those BPF programs to look up additional information. E.g., for multi-kprobes and multi-uprobes, link is used to fetch BPF cookie values. @@ Commit message Acked-by: Jiri Olsa jolsa@kernel.org Link: https://lore.kernel.org/r/20240328052426.3042617-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov ast@kernel.org + [fixed conflicts due to missing commits 89ae89f53d20 + ("bpf: Add multi uprobe link")] + Signed-off-by: Jianqi Ren jianqi.ren.cn@windriver.com + Signed-off-by: He Zhe zhe.he@windriver.com
## include/linux/bpf.h ## @@ include/linux/bpf.h: struct bpf_link { @@ kernel/bpf/syscall.c: void bpf_link_inc(struct bpf_link *link) + bpf_link_free_id(link->id); if (link->prog) { -+ sleepable = link->prog->sleepable; ++ sleepable = link->prog->aux->sleepable; /* detach BPF program, clean up used resources */ link->ops->release(link); bpf_prog_put(link->prog); @@ kernel/bpf/syscall.c: static int bpf_raw_tp_link_fill_link_info(const struct bpf };
## kernel/trace/bpf_trace.c ## -@@ kernel/trace/bpf_trace.c: static int bpf_kprobe_multi_link_fill_link_info(const struct bpf_link *link, +@@ kernel/trace/bpf_trace.c: static void bpf_kprobe_multi_link_dealloc(struct bpf_link *link)
static const struct bpf_link_ops bpf_kprobe_multi_link_lops = { .release = bpf_kprobe_multi_link_release, - .dealloc = bpf_kprobe_multi_link_dealloc, + .dealloc_deferred = bpf_kprobe_multi_link_dealloc, - .fill_link_info = bpf_kprobe_multi_link_fill_link_info, - }; - -@@ kernel/trace/bpf_trace.c: static int bpf_uprobe_multi_link_fill_link_info(const struct bpf_link *link, - - static const struct bpf_link_ops bpf_uprobe_multi_link_lops = { - .release = bpf_uprobe_multi_link_release, -- .dealloc = bpf_uprobe_multi_link_dealloc, -+ .dealloc_deferred = bpf_uprobe_multi_link_dealloc, - .fill_link_info = bpf_uprobe_multi_link_fill_link_info, };
+ static void bpf_kprobe_multi_cookie_swap(void *a, void *b, int size, const void *priv) ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success |