]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: enable access to ax register also from verifier rewrite
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 2 Jan 2019 23:58:29 +0000 (00:58 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 3 Jan 2019 00:01:24 +0000 (16:01 -0800)
commitf5279b8ed69c16bf2f5db0d5b64ff89dea45f23d
tree4f1d5e9561299532a0aba9a59496d488c27cfcda
parent272f1ccda6daa08ff7a90fe0552798514f8d0228
bpf: enable access to ax register also from verifier rewrite

Right now we are using BPF ax register in JIT for constant blinding as
well as in interpreter as temporary variable. Verifier will not be able
to use it simply because its use will get overridden from the former in
bpf_jit_blind_insn(). However, it can be made to work in that blinding
will be skipped if there is prior use in either source or destination
register on the instruction. Taking constraints of ax into account, the
verifier is then open to use it in rewrites under some constraints. Note,
ax register already has mappings in every eBPF JIT.

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