]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf, x64: Add predicate for bpf2bpf with tailcalls support in JIT
authorTony Ambardar <tony.ambardar@gmail.com>
Fri, 17 Jun 2022 10:57:34 +0000 (12:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:41:04 +0000 (14:41 +0200)
commitb8b5bef0062da686482fc34397e7fce6336819e4
tree55b03328c9beb4dda1398dafa3ae4379fea20f1a
parent88d7bb43fad7bffe55865ba42d0e276ce3aa3d9c
bpf, x64: Add predicate for bpf2bpf with tailcalls support in JIT

[ Upstream commit 95acd8817e66d031d2e6ee7def3f1e1874819317 ]

The BPF core/verifier is hard-coded to permit mixing bpf2bpf and tail
calls for only x86-64. Change the logic to instead rely on a new weak
function 'bool bpf_jit_supports_subprog_tailcalls(void)', which a capable
JIT backend can override.

Update the x86-64 eBPF JIT to reflect this.

Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
[jakub: drop MIPS bits and tweak patch subject]
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220617105735.733938-2-jakub@cloudflare.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/net/bpf_jit_comp.c
include/linux/filter.h
kernel/bpf/core.c
kernel/bpf/verifier.c