]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bpf, arm: fix emit_ldx_r and emit_mov_i using TMP_REG_1
authorNicolas Schichan <nschichan@freebox.fr>
Wed, 19 Dec 2018 21:40:42 +0000 (22:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Dec 2018 13:13:18 +0000 (14:13 +0100)
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>
arch/arm/net/bpf_jit_32.c

index ece2d1d43724b88c8bde71db75606677ca749731..dafeb5f81353efaed3d7b9ef4529d1e33c040ee9 100644 (file)
@@ -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;