diff options
author | Nicolas Schichan <nschichan@freebox.fr> | 2018-12-20 00:40:42 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-21 16:13:18 +0300 |
commit | ad962d20d4eb1e690ace8ca9e390e2b05a786999 (patch) | |
tree | b137316c82f5ca37aebeb48c14c6dce48a81d3ec | |
parent | f1e1eb5c90b6b6a359e584e01468ce0c05801f4d (diff) | |
download | linux-ad962d20d4eb1e690ace8ca9e390e2b05a786999.tar.xz |
bpf, arm: fix emit_ldx_r and emit_mov_i using TMP_REG_1
emit_ldx_r() and emit_a32_mov_i() were both using TMP_REG_1 and
clashing with each other. Using TMP_REG_2 in emit_ldx_r() fixes
the issue.
Fixes: ec19e02b343 ("ARM: net: bpf: fix LDX instructions")
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | arch/arm/net/bpf_jit_32.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index ece2d1d43724..dafeb5f81353 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c @@ -915,7 +915,7 @@ static inline void emit_str_r(const u8 dst, const u8 src, bool dstk, /* dst = *(size*)(src + off) */ static inline void emit_ldx_r(const u8 dst[], const u8 src, bool dstk, s32 off, struct jit_ctx *ctx, const u8 sz){ - const u8 *tmp = bpf2a32[TMP_REG_1]; + const u8 *tmp = bpf2a32[TMP_REG_2]; const u8 *rd = dstk ? tmp : dst; u8 rm = src; s32 off_max; |