Linux/linux 0fd4759kernel/bpf verifier.c

bpf: fix pattern matches for direct packet access

Alexander had a test program with direct packet access, where
the access test was in the form of data + X > data_end. In an
unrelated change to the program LLVM decided to swap the branches
and emitted code for the test in form of data + X <= data_end.
We hadn't seen these being generated previously, thus verifier
would reject the program. Therefore, fix up the verifier to
detect all test cases, so we don't run into such issues in the
future.

Fixes: b4e432f1000a ("bpf: enable BPF_J{LT, LE, SLT, SLE} opcodes in verifier")
Reported-by: Alexander Alemayhu <alexander at alemayhu.com>
Signed-off-by: Daniel Borkmann <daniel at iogearbox.net>
Acked-by: Alexei Starovoitov <ast at kernel.org>
Acked-by: John Fastabend <john.fastabend at gmail.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
DeltaFile
+24-0kernel/bpf/verifier.c
+24-01 files

UnifiedSplitRaw