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)
commitfe9a5ca7e370e613a9a75a13008a3845ea759d6e
tree6c6981a0c4ce376319b687a1f9ef9e98619dd9e8
parentd203b0fd863a2261e5d00b97f3d060c4c2a6db71
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