kernel_optimize_test/arch/s390
Colin Ian King e3a9548ae5 s390/bpf: Perform r1 range checking before accessing jit->seen_reg[r1]
[ Upstream commit 91091656252f5d6d8c476e0c92776ce9fae7b445 ]

Currently array jit->seen_reg[r1] is being accessed before the range
checking of index r1. The range changing on r1 should be performed
first since it will avoid any potential out-of-range accesses on the
array seen_reg[] and also it is more optimal to perform checks on r1
before fetching data from the array. Fix this by swapping the order
of the checks before the array access.

Fixes: 0546231057 ("s390/bpf: Add s390x eBPF JIT compiler backend")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/bpf/20210715125712.24690-1-colin.king@canonical.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-28 14:35:37 +02:00
..
appldata
boot s390/mem_detect: fix tprot() program check new psw handling 2021-07-20 16:05:44 +02:00
configs
crypto
hypfs
include s390: introduce proper type handling call_on_stack() macro 2021-07-25 14:36:17 +02:00
kernel s390/traps: do not test MONITOR CALL without CONFIG_BUG 2021-07-25 14:36:17 +02:00
kvm KVM: s390: get rid of register asm usage 2021-07-14 16:55:56 +02:00
lib
mm s390: mm: Fix secure storage access exception handling 2021-07-14 16:55:43 +02:00
net s390/bpf: Perform r1 range checking before accessing jit->seen_reg[r1] 2021-07-28 14:35:37 +02:00
oprofile
pci
purgatory s390: disable SSP when needed 2021-07-20 16:05:42 +02:00
tools
Kbuild
Kconfig s390: appldata depends on PROC_SYSCTL 2021-07-14 16:56:42 +02:00
Kconfig.debug
Makefile s390: disable SSP when needed 2021-07-20 16:05:42 +02:00