]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: bpf: Annotate JITed code for BTI
authorMark Brown <broonie@kernel.org>
Wed, 6 May 2020 19:51:32 +0000 (20:51 +0100)
committerWill Deacon <will@kernel.org>
Thu, 7 May 2020 16:53:20 +0000 (17:53 +0100)
commit95c5ed7d380fad743b1a3a7bc5b8cee467d1d0c8
tree88e80af33df552d3947701536401eedf38592828
parente86545bbebba097f378068edc6a771af06abe429
arm64: bpf: Annotate JITed code for BTI

In order to extend the protection offered by BTI to all code executing in
kernel mode we need to annotate JITed BPF code appropriately for BTI. To
do this we need to add a landing pad to the start of each BPF function and
also immediately after the function prologue if we are emitting a function
which can be tail called. Jumps within BPF functions are all to immediate
offsets and therefore do not require landing pads.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20200506195138.22086-6-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/net/bpf_jit.h
arch/arm64/net/bpf_jit_comp.c