]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/bpf: use unsigned division instruction for 64-bit operations
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Wed, 12 Jun 2019 18:51:40 +0000 (00:21 +0530)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 13 Jun 2019 21:07:00 +0000 (23:07 +0200)
commit8e9e846a5e187daa6be1a6460014cfaea4938013
tree5bc7151508fe910ab38e5ec09a74545abfc63f3a
parente1706e9eab362a2db3ad7b301f1e7ed0d59631c6
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: efaa46924fa47a ("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>
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/net/bpf_jit.h
arch/powerpc/net/bpf_jit_comp64.c