Skip to content

Commit 9ff1b95

Browse files
olsajirigregkh
authored andcommitted
bpf: Force uprobe bpf program to always return 0
[ Upstream commit f505005 ] 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: Sasha Levin <[email protected]>
1 parent 36ede57 commit 9ff1b95

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
@@ -3205,7 +3205,6 @@ static int uprobe_prog_run(struct bpf_uprobe *uprobe,
32053205
struct bpf_prog *prog = link->link.prog;
32063206
bool sleepable = prog->sleepable;
32073207
struct bpf_run_ctx *old_run_ctx;
3208-
int err = 0;
32093208

32103209
if (link->task && !same_thread_group(current, link->task))
32113210
return 0;
@@ -3218,7 +3217,7 @@ static int uprobe_prog_run(struct bpf_uprobe *uprobe,
32183217
migrate_disable();
32193218

32203219
old_run_ctx = bpf_set_run_ctx(&run_ctx.run_ctx);
3221-
err = bpf_prog_run(link->link.prog, regs);
3220+
bpf_prog_run(link->link.prog, regs);
32223221
bpf_reset_run_ctx(old_run_ctx);
32233222

32243223
migrate_enable();
@@ -3227,7 +3226,7 @@ static int uprobe_prog_run(struct bpf_uprobe *uprobe,
32273226
rcu_read_unlock_trace();
32283227
else
32293228
rcu_read_unlock();
3230-
return err;
3229+
return 0;
32313230
}
32323231

32333232
static bool

0 commit comments

Comments
 (0)