Skip to content

Commit 47c9214

Browse files
image-dragonAlexei Starovoitov
authored andcommitted
bpf: fix the usage of BPF_TRAMP_F_SKIP_FRAME
Some places calculate the origin_call by checking if BPF_TRAMP_F_SKIP_FRAME is set. However, it should use BPF_TRAMP_F_ORIG_STACK for this propose. Just fix them. Signed-off-by: Menglong Dong <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 0c3772a commit 47c9214

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/riscv/net/bpf_jit_comp64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
11311131
store_args(nr_arg_slots, args_off, ctx);
11321132

11331133
/* skip to actual body of traced function */
1134-
if (flags & BPF_TRAMP_F_SKIP_FRAME)
1134+
if (flags & BPF_TRAMP_F_ORIG_STACK)
11351135
orig_call += RV_FENTRY_NINSNS * 4;
11361136

11371137
if (flags & BPF_TRAMP_F_CALL_ORIG) {

arch/x86/net/bpf_jit_comp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3289,7 +3289,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im
32893289

32903290
arg_stack_off = stack_size;
32913291

3292-
if (flags & BPF_TRAMP_F_SKIP_FRAME) {
3292+
if (flags & BPF_TRAMP_F_CALL_ORIG) {
32933293
/* skip patched call instruction and point orig_call to actual
32943294
* body of the kernel function.
32953295
*/

0 commit comments

Comments
 (0)