]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: move tmp variable into ax register in interpreter
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 2 Jan 2019 23:58:28 +0000 (00:58 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 3 Jan 2019 00:01:24 +0000 (16:01 -0800)
commite09ba024d87f60b6bb512ca61c9e3a274eaa83f6
tree2fefab1821f1de1dc02d94ad6aa1be59e08f056c
parent0dc57db4148cedc7441351d02b87b0e446163a0f
bpf: move tmp variable into ax register in interpreter

This change moves the on-stack 64 bit tmp variable in ___bpf_prog_run()
into the hidden ax register. The latter is currently only used in JITs
for constant blinding as a temporary scratch register, meaning the BPF
interpreter will never see the use of ax. Therefore it is safe to use
it for the cases where tmp has been used earlier. This is needed to later
on allow restricted hidden use of ax in both interpreter and JITs.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/filter.h
kernel/bpf/core.c