summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-02-27 00:00:47 +0300
committerAlexei Starovoitov <ast@kernel.org>2018-02-27 06:58:09 +0300
commitd269176e766c71c998cb75b4ea8cbc321cc0019d (patch)
treeeab10ae38510366a09272649438b9257218cbb03 /lib
parentd40bc96257fe070796c63934913f95cc183016b0 (diff)
downloadlinux-d269176e766c71c998cb75b4ea8cbc321cc0019d.tar.xz
bpf, ppc64: fix out of bounds access in tail call
While working on 16338a9b3ac3 ("bpf, arm64: fix out of bounds access in tail call") I noticed that ppc64 JIT is partially affected as well. While the bound checking is correctly performed as unsigned comparison, the register with the index value however, is never truncated into 32 bit space, so e.g. a index value of 0x100000000ULL with a map of 1 element would pass with PPC_CMPLW() whereas we later on continue with the full 64 bit register value. Therefore, as we do in interpreter and other JITs truncate the value to 32 bit initially in order to fix access. Fixes: ce0761419fae ("powerpc/bpf: Implement support for tail calls") Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions