diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2022-12-06 15:33:43 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-12-06 19:14:38 -0800 |
commit | bffdeaa8a5af7200b0e74c9d5a41167f86626a36 (patch) | |
tree | aa79e45550ea589b05d5b86292bccdce0d1e4c85 /include/linux/bpf_verifier.h | |
parent | d8939cb0a03ce7e4e69f65bbd31b79fe42f7d5e6 (diff) | |
download | linux-bffdeaa8a5af7200b0e74c9d5a41167f86626a36.tar.gz linux-bffdeaa8a5af7200b0e74c9d5a41167f86626a36.tar.bz2 linux-bffdeaa8a5af7200b0e74c9d5a41167f86626a36.zip |
bpf: decouple prune and jump points
BPF verifier marks some instructions as prune points. Currently these
prune points serve two purposes.
It's a point where verifier tries to find previously verified state and
check current state's equivalence to short circuit verification for
current code path.
But also currently it's a point where jump history, used for precision
backtracking, is updated. This is done so that non-linear flow of
execution could be properly backtracked.
Such coupling is coincidental and unnecessary. Some prune points are not
part of some non-linear jump path, so don't need update of jump history.
On the other hand, not all instructions which have to be recorded in
jump history necessarily are good prune points.
This patch splits prune and jump points into independent flags.
Currently all prune points are marked as jump points to minimize amount
of changes in this patch, but next patch will perform some optimization
of prune vs jmp point placement.
No functional changes are intended.
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20221206233345.438540-2-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/bpf_verifier.h')
-rw-r--r-- | include/linux/bpf_verifier.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h index c07b351a5bc7..70d06a99f0b8 100644 --- a/include/linux/bpf_verifier.h +++ b/include/linux/bpf_verifier.h @@ -452,6 +452,7 @@ struct bpf_insn_aux_data { /* below fields are initialized once */ unsigned int orig_idx; /* original instruction index */ bool prune_point; + bool jmp_point; }; #define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */ |