bpf: Move checks for reserved fields out of the main pass

Check reserved fields of each insn once in a prepass
instead of repeatedly rechecking them during the main verifier pass.

Link: https://lore.kernel.org/r/20260411200932.41797-1-alexei.starovoitov@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
Alexei Starovoitov
2026-04-11 15:24:41 -07:00
parent 57205e2dd9
commit ae3f8ca2ba
2 changed files with 201 additions and 148 deletions
+200 -147
View File
File diff suppressed because it is too large Load Diff
@@ -10,7 +10,7 @@
{
"junk insn2",
.insns = {
BPF_RAW_INSN(1, 0, 0, 0, 0),
BPF_RAW_INSN(BPF_LDX | BPF_MEM | BPF_W, 0, 0, 0, 1),
BPF_EXIT_INSN(),
},
.errstr = "BPF_LDX uses reserved fields",