From cdcee2ec9b81457f9059c3f3a007e69190672634 Mon Sep 17 00:00:00 2001 From: Hongbo Zheng Date: Thu, 22 Apr 2021 15:30:01 +0800 Subject: [PATCH] bpf: fix JSLT validation In function 'eval_jcc', judgment 'op == EBPF_JLT' occurs twice, as a result, the corresponding second statement cannot be accessed. This patch fix this problem. Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program") Cc: stable@dpdk.org Signed-off-by: Hongbo Zheng Signed-off-by: Min Hu (Connor) Acked-by: Konstantin Ananyev --- lib/bpf/bpf_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bpf/bpf_validate.c b/lib/bpf/bpf_validate.c index 9214f15038..7b1291b382 100644 --- a/lib/bpf/bpf_validate.c +++ b/lib/bpf/bpf_validate.c @@ -1115,7 +1115,7 @@ eval_jcc(struct bpf_verifier *bvf, const struct ebpf_insn *ins) eval_jsgt_jsle(trd, trs, frd, frs); else if (op == EBPF_JSLE) eval_jsgt_jsle(frd, frs, trd, trs); - else if (op == EBPF_JLT) + else if (op == EBPF_JSLT) eval_jslt_jsge(trd, trs, frd, frs); else if (op == EBPF_JSGE) eval_jslt_jsge(frd, frs, trd, trs); -- 2.20.1