]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: use bpf_prog_pack for bpf_dispatcher
authorSong Liu <song@kernel.org>
Mon, 26 Sep 2022 18:47:38 +0000 (11:47 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 27 Sep 2022 03:40:43 +0000 (20:40 -0700)
commit19c02415da2345d0dda2b5c4495bc17cc14b18b5
tree64cebe945349bf772b0d4cdb212ee1fc55d38215
parent30b8fdbbe31b2422f46fcd6d3960e563affe76d7
bpf: use bpf_prog_pack for bpf_dispatcher

Allocate bpf_dispatcher with bpf_prog_pack_alloc so that bpf_dispatcher
can share pages with bpf programs.

arch_prepare_bpf_dispatcher() is updated to provide a RW buffer as working
area for arch code to write to.

This also fixes CPA W^X warnning like:

CPA refuse W^X violation: 8000000000000163 -> 0000000000000163 range: ...

Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20220926184739.3512547-2-song@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/x86/net/bpf_jit_comp.c
include/linux/bpf.h
include/linux/filter.h
kernel/bpf/core.c
kernel/bpf/dispatcher.c