bpf: move tmp variable into ax register in interpreter
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 28 Jan 2019 20:28:22 +0000 (21:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 07:14:40 +0000 (08:14 +0100)
commitb855e310374063360af5fb3bbbd0cc66ca189dc0
tree8aabc78b6e3dd07efe46ad14d06846744bc52c6b
parent333a31c89ae2d991a8a54034e369526cbb384b13
bpf: move tmp variable into ax register in interpreter

[ commit 144cd91c4c2bced6eb8a7e25e590f6618a11e854 upstream ]

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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/filter.h
kernel/bpf/core.c