summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2026-06-15 03:24:26 +0300
committerAlexei Starovoitov <ast@kernel.org>2026-06-15 03:24:33 +0300
commita6f615db083d0993bad9ca8fe226d1c996c4bf5b (patch)
tree4e5dc3ee1bfff46cd4c1dfb39ee490144e1f18c3 /include
parent16deef8de06ed69aa79d037a168a70407a84a5ca (diff)
parentdf29003c55115737a8fb4f8a60c6c2bba4c4a484 (diff)
downloadlinux-a6f615db083d0993bad9ca8fe226d1c996c4bf5b.tar.xz
Merge branch 'bpf-allow-uprobe_multi-binary-specified-by-file-descriptor'
Jiri Olsa says: ==================== bpf: Allow uprobe_multi binary specified by file descriptor Add ability to open uprobe_multi link on top of binary identified by file descriptor. This allows us to avoid the race where the binary is replaced between path resolution and attachment, ensuring we monitor the intended binary. v1: https://lore.kernel.org/bpf/20260609104244.588321-1-jolsa@kernel.org/T/#m0275d5f39805c57dc8fd3308c640237dc7aec4db v2: https://lore.kernel.org/bpf/20260610143627.804790-1-jolsa@kernel.org/T/#m153e18fa426140fdcc773cc97b10e006531656c0 v3 changes: - guard t_user acesss with access_ok [sashiko] v2 changes: - move path retrieval in separate function so CLASS(..) is not used in function with goto-based cleanup [sashiko] - force zero path_fd in case BPF_F_UPROBE_MULTI_PATH_FD is not set [sashiko] - add space around | in bpf_uprobe_multi_link_attach [Alexei] ==================== Link: https://patch.msgid.link/20260611114230.950379-1-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/bpf.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 11dd610fa5fa..89b36de5fdbb 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -1327,7 +1327,11 @@ enum {
* BPF_TRACE_UPROBE_MULTI attach type to create return probe.
*/
enum {
- BPF_F_UPROBE_MULTI_RETURN = (1U << 0)
+ /* Get return uprobe. */
+ BPF_F_UPROBE_MULTI_RETURN = (1U << 0),
+
+ /* Get path from provided path_fd. */
+ BPF_F_UPROBE_MULTI_PATH_FD = (1U << 1),
};
/* link_create.netfilter.flags used in LINK_CREATE command for
@@ -1864,6 +1868,7 @@ union bpf_attr {
__u32 cnt;
__u32 flags;
__u32 pid;
+ __u32 path_fd;
} uprobe_multi;
struct {
union {