linux/arch
Russell King 9c82ce5936 arm64/bpf: Remove 128MB limit for BPF JIT programs
commit b89ddf4cca upstream.

Commit 91fc957c9b ("arm64/bpf: don't allocate BPF JIT programs in module
memory") restricts BPF JIT program allocation to a 128MB region to ensure
BPF programs are still in branching range of each other. However this
restriction should not apply to the aarch64 JIT, since BPF_JMP | BPF_CALL
are implemented as a 64-bit move into a register and then a BLR instruction -
which has the effect of being able to call anything without proximity
limitation.

The practical reason to relax this restriction on JIT memory is that 128MB of
JIT memory can be quickly exhausted, especially where PAGE_SIZE is 64KB - one
page is needed per program. In cases where seccomp filters are applied to
multiple VMs on VM launch - such filters are classic BPF but converted to
BPF - this can severely limit the number of VMs that can be launched. In a
world where we support BPF JIT always on, turning off the JIT isn't always an
option either.

Fixes: 91fc957c9b ("arm64/bpf: don't allocate BPF JIT programs in module memory")
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <russell.king@oracle.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/bpf/1636131046-5982-2-git-send-email-alan.maguire@oracle.com
Reviewed-by: Tom Saeger <tom.saeger@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-29 10:58:25 +01:00
..
alpha
arc
arm Documentation, arch: Remove leftovers from CIFS_WEAK_PW_HASH 2022-01-27 11:05:21 +01:00
arm64 arm64/bpf: Remove 128MB limit for BPF JIT programs 2022-01-29 10:58:25 +01:00
csky
h8300
hexagon
ia64
m68k
microblaze
mips Documentation, arch: Remove leftovers from CIFS_WEAK_PW_HASH 2022-01-27 11:05:21 +01:00
nds32
nios2
openrisc
parisc
powerpc powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses 2022-01-27 11:05:24 +01:00
riscv riscv: dts: microchip: mpfs: Drop empty chosen node 2022-01-27 11:05:28 +01:00
s390
sh Documentation, arch: Remove leftovers from CIFS_WEAK_PW_HASH 2022-01-27 11:05:21 +01:00
sparc
um um: gitignore: Add kernel/capflags.c 2022-01-27 11:05:34 +01:00
x86
xtensa
.gitignore
Kconfig