]> git.itanic.dy.fi Git - linux-stable/commit
bpf: move tmp variable into ax register in interpreter
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 28 Jan 2019 20:23:22 +0000 (21:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 07:15:44 +0000 (08:15 +0100)
commit433303ac92e55585095be37c7272e3beecae8fbf
tree43438d2a1be99d691dfb088e4f56a6cccbaec0f2
parent629b8af182e103042aea3970e9d8e7c0e8dc5d79
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