diff options
author | Nicolas Schichan <nschichan@freebox.fr> | 2015-10-02 16:39:12 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-05 17:01:08 +0300 |
commit | 8690f47d6e76d4300eeb316ba4773f7de3da63f7 (patch) | |
tree | a6e736739e26ec735f50272f079950c95e33365e /arch | |
parent | 598c12d0ba6de9060f04999746eb1e015774044b (diff) | |
download | linux-8690f47d6e76d4300eeb316ba4773f7de3da63f7.tar.xz |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/net/bpf_jit_32.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 876060bcceeb..b8efb8cd1f73 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c @@ -614,6 +614,7 @@ load_common: case BPF_LD | BPF_B | BPF_IND: load_order = 0; load_ind: + update_on_xread(ctx); OP_IMM3(ARM_ADD, r_off, r_X, k, ctx); goto load_common; case BPF_LDX | BPF_IMM: |