]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Do not mark insn as seen under speculative path verification
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 28 May 2021 13:47:27 +0000 (13:47 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 14 Jun 2021 21:06:06 +0000 (23:06 +0200)
commitc35d81a3132d18b3e9f8555347c406a903f6ff95
tree6c6981a0c4ce376319b687a1f9ef9e98619dd9e8
parent4a9e333330cea57604503885f9766f76666f2c2b
bpf: Do not mark insn as seen under speculative path verification

... in such circumstances, we do not want to mark the instruction as seen given
the goal is still to jmp-1 rewrite/sanitize dead code, if it is not reachable
from the non-speculative path verification. We do however want to verify it for
safety regardless.

With the patch as-is all the insns that have been marked as seen before the
patch will also be marked as seen after the patch (just with a potentially
different non-zero count). An upcoming patch will also verify paths that are
unreachable in the non-speculative domain, hence this extension is needed.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Reviewed-by: Benedict Schlueter <benedict.schlueter@rub.de>
Reviewed-by: Piotr Krysiuk <piotras@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c