This repository has been archived by the owner on Dec 14, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf, ppc64: fix out of bounds access in tail call
[ upstream commit d269176 ] While working on 16338a9 ("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: ce07614 ("powerpc/bpf: Implement support for tail calls") Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Naveen N. Rao <[email protected]> Tested-by: Naveen N. Rao <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information