Skip to content
Commit f22c64cd authored by Zi Shen Lim's avatar Zi Shen Lim Committed by Greg Kroah-Hartman
Browse files

arm64: bpf: fix mod-by-zero case

commit 14e589ff upstream.

Turns out in the case of modulo by zero in a BPF program:
	A = A % X;  (X == 0)
the expected behavior is to terminate with return value 0.

The bug in JIT is exposed by a new test case [1].

[1] https://lkml.org/lkml/2015/11/4/499



Signed-off-by: default avatarZi Shen Lim <zlim.lnx@gmail.com>
Reported-by: default avatarYang Shi <yang.shi@linaro.org>
Reported-by: default avatarXi Wang <xi.wang@gmail.com>
CC: Alexei Starovoitov <ast@plumgrid.com>
Fixes: e54bcde3

 ("arm64: eBPF JIT compiler")
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 40c5dde6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment