diff options
author | Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> | 2019-06-12 20:51:40 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-06-13 23:07:00 +0200 |
commit | 758f2046ea040773ae8ea7f72dd3bbd8fa984501 (patch) | |
tree | 5bc7151508fe910ab38e5ec09a74545abfc63f3a /arch/powerpc/net/bpf_jit.h | |
parent | bpf: fix div64 overflow tests to properly detect errors (diff) | |
download | linux-758f2046ea040773ae8ea7f72dd3bbd8fa984501.tar.xz linux-758f2046ea040773ae8ea7f72dd3bbd8fa984501.zip |
powerpc/bpf: use unsigned division instruction for 64-bit operations
BPF_ALU64 div/mod operations are currently using signed division, unlike
BPF_ALU32 operations. Fix the same. DIV64 and MOD64 overflow tests pass
with this fix.
Fixes: 156d0e290e969c ("powerpc/ebpf/jit: Implement JIT compiler for extended BPF")
Cc: stable@vger.kernel.org # v4.8+
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'arch/powerpc/net/bpf_jit.h')
-rw-r--r-- | arch/powerpc/net/bpf_jit.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h index dcac37745b05..1e932898d430 100644 --- a/arch/powerpc/net/bpf_jit.h +++ b/arch/powerpc/net/bpf_jit.h @@ -116,7 +116,7 @@ ___PPC_RA(a) | IMM_L(i)) #define PPC_DIVWU(d, a, b) EMIT(PPC_INST_DIVWU | ___PPC_RT(d) | \ ___PPC_RA(a) | ___PPC_RB(b)) -#define PPC_DIVD(d, a, b) EMIT(PPC_INST_DIVD | ___PPC_RT(d) | \ +#define PPC_DIVDU(d, a, b) EMIT(PPC_INST_DIVDU | ___PPC_RT(d) | \ ___PPC_RA(a) | ___PPC_RB(b)) #define PPC_AND(d, a, b) EMIT(PPC_INST_AND | ___PPC_RA(d) | \ ___PPC_RS(a) | ___PPC_RB(b)) |