Skip to content

Commit 8690f47

Browse files
nschichandavem330
authored andcommitted
ARM: net: make BPF_LD | BPF_IND instruction trigger r_X initialisation to 0.
Without this patch, if the only instructions using r_X are of the BPF_LD | BPF_IND type, r_X would not be reset to 0, using whatever value was there when entering the jited code. With this patch, r_X will be correctly marked as used so it will be reset to 0 in the prologue code. This fix also makes the test "LD_IND byte default X" pass in the test_bpf module when the ARM JIT is enabled. Signed-off-by: Nicolas Schichan <nschichan@freebox.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 598c12d commit 8690f47

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm/net/bpf_jit_32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ static int build_body(struct jit_ctx *ctx)
614614
case BPF_LD | BPF_B | BPF_IND:
615615
load_order = 0;
616616
load_ind:
617+
update_on_xread(ctx);
617618
OP_IMM3(ARM_ADD, r_off, r_X, k, ctx);
618619
goto load_common;
619620
case BPF_LDX | BPF_IMM:

0 commit comments

Comments
 (0)