linux-brain/arch/powerpc
Daniel Borkmann 2b70de4ea9 bpf, ppc64: fix out of bounds access in tail call
[ upstream commit d269176e76 ]

While working on 16338a9b3a ("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: ce0761419f ("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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-11 16:21:35 +01:00
..
boot powerpc/corenet: explicitly disable the SDHC controller on kmcoge4 2017-11-15 15:53:13 +01:00
configs Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux into next 2016-10-11 20:07:56 +11:00
crypto crypto: hash - annotate algorithms taking optional key 2018-02-25 11:05:43 +01:00
include powerpc/64s: Improve RFI L1-D cache flush fallback 2018-02-25 11:05:50 +01:00
kernel powerpc/64s: Improve RFI L1-D cache flush fallback 2018-02-25 11:05:50 +01:00
kvm powerpc/64s: Simple RFI macro conversions 2018-02-25 11:05:50 +01:00
lib powerpc/64s: Add support for RFI flush of L1-D cache 2018-02-13 12:35:54 +01:00
math-emu powerpc: Correct emulated mtfsf instruction 2014-04-07 10:33:11 +10:00
mm powerpc/64: Invalidate process table caching after setting process table 2017-12-14 09:28:17 +01:00
net bpf, ppc64: fix out of bounds access in tail call 2018-03-11 16:21:35 +01:00
oprofile powerpc/sparse: Make a bunch of things static 2016-09-13 17:35:47 +10:00
perf powerpc/perf: Fix oops when grouping different pmu events 2018-02-25 11:05:47 +01:00
platforms powerpc/powernv: Check device-tree for RFI flush settings 2018-02-13 12:35:55 +01:00
scripts powerpc/ftrace: Add Kconfig & Make glue for mprofile-kernel 2016-03-07 14:53:56 +11:00
sysdev powerpc/ipic: Fix status get and status clear 2017-12-20 10:07:28 +01:00
xmon powerpc/xmon: Don't use ld on 32-bit 2016-09-13 17:37:02 +10:00
Kconfig powerpc/64s: Wire up cpu_show_meltdown() 2018-02-13 12:35:55 +01:00
Kconfig.debug powerpc/mm: Catch usage of cpu/mmu_has_feature() before jump label init 2016-08-01 11:15:06 +10:00
Makefile powerpc: Fix compiling a BE kernel with a powerpc64le toolchain 2017-12-14 09:28:17 +01:00
relocs_check.sh powerpc/64: whitelist unresolved modversions CRCs 2016-09-22 14:46:31 +02:00