Skip to content

Commit c32f17b

Browse files
committed
bpf: Force uprobe bpf program to always return 0
JIRA: https://issues.redhat.com/browse/RHEL-85485 commit f505005 Author: Jiri Olsa <[email protected]> Date: Fri Nov 8 14:45:33 2024 +0100 bpf: Force uprobe bpf program to always return 0 As suggested by Andrii make uprobe multi bpf programs to always return 0, so they can't force uprobe removal. Keeping the int return type for uprobe_prog_run, because it will be used in following session changes. Fixes: 89ae89f ("bpf: Add multi uprobe link") Suggested-by: Andrii Nakryiko <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Signed-off-by: Viktor Malik <[email protected]>
1 parent 11f7b3e commit c32f17b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/trace/bpf_trace.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3208,7 +3208,6 @@ static int uprobe_prog_run(struct bpf_uprobe *uprobe,
32083208
struct bpf_prog *prog = link->link.prog;
32093209
bool sleepable = prog->sleepable;
32103210
struct bpf_run_ctx *old_run_ctx;
3211-
int err = 0;
32123211

32133212
if (link->task && !same_thread_group(current, link->task))
32143213
return 0;
@@ -3221,7 +3220,7 @@ static int uprobe_prog_run(struct bpf_uprobe *uprobe,
32213220
migrate_disable();
32223221

32233222
old_run_ctx = bpf_set_run_ctx(&run_ctx.run_ctx);
3224-
err = bpf_prog_run(link->link.prog, regs);
3223+
bpf_prog_run(link->link.prog, regs);
32253224
bpf_reset_run_ctx(old_run_ctx);
32263225

32273226
migrate_enable();
@@ -3230,7 +3229,7 @@ static int uprobe_prog_run(struct bpf_uprobe *uprobe,
32303229
rcu_read_unlock_trace();
32313230
else
32323231
rcu_read_unlock();
3233-
return err;
3232+
return 0;
32343233
}
32353234

32363235
static bool

0 commit comments

Comments
 (0)