linux/arch
Russell King b89ddf4cca arm64/bpf: Remove 128MB limit for BPF JIT programs
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
2021-11-08 22:16:26 +01:00
..
alpha Core: 2021-11-02 06:20:58 -07:00
arc Tracing updates for 5.16: 2021-11-01 20:05:19 -07:00
arm Core: 2021-11-02 06:20:58 -07:00
arm64 arm64/bpf: Remove 128MB limit for BPF JIT programs 2021-11-08 22:16:26 +01:00
csky Tracing updates for 5.16: 2021-11-01 20:05:19 -07:00
h8300 Scheduler updates: 2021-11-01 13:48:52 -07:00
hexagon sched: Add wrapper for get_wchan() to keep task blocked 2021-10-15 11:25:14 +02:00
ia64 audit/stable-5.16 PR 20211101 2021-11-01 21:17:39 -07:00
m68k Core: 2021-11-02 06:20:58 -07:00
microblaze Tracing updates for 5.16: 2021-11-01 20:05:19 -07:00
mips Core: 2021-11-02 06:20:58 -07:00
nds32 Tracing updates for 5.16: 2021-11-01 20:05:19 -07:00
nios2 Scheduler updates: 2021-11-01 13:48:52 -07:00
openrisc Scheduler updates: 2021-11-01 13:48:52 -07:00
parisc Core: 2021-11-02 06:20:58 -07:00
powerpc audit/stable-5.16 PR 20211101 2021-11-01 21:17:39 -07:00
riscv Core: 2021-11-02 06:20:58 -07:00
s390 Core: 2021-11-02 06:20:58 -07:00
sh RCU pull request for v5.16 2021-11-01 20:25:38 -07:00
sparc Core: 2021-11-02 06:20:58 -07:00
um Core: 2021-11-02 06:20:58 -07:00
x86 - Do not #GP on userspace use of CLI/STI but pretend it was a NOP to 2021-11-02 07:56:47 -07:00
xtensa Core: 2021-11-02 06:20:58 -07:00
.gitignore
Kconfig Tracing updates for 5.16: 2021-11-01 20:05:19 -07:00