DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] bpf: fix unreachable statement
@ 2021-04-22  7:30 Min Hu (Connor)
  2021-04-22 11:23 ` Ananyev, Konstantin
  0 siblings, 1 reply; 3+ messages in thread
From: Min Hu (Connor) @ 2021-04-22  7:30 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, konstantin.ananyev

From: HongBo Zheng <zhenghongbo3@huawei.com>

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 <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 lib/librte_bpf/bpf_validate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c
index 9214f15..7b1291b 100644
--- a/lib/librte_bpf/bpf_validate.c
+++ b/lib/librte_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.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] bpf: fix unreachable statement
  2021-04-22  7:30 [dpdk-dev] [PATCH] bpf: fix unreachable statement Min Hu (Connor)
@ 2021-04-22 11:23 ` Ananyev, Konstantin
  2021-05-05 10:23   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ananyev, Konstantin @ 2021-04-22 11:23 UTC (permalink / raw)
  To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh, Ananyev, Konstantin



> From: HongBo Zheng <zhenghongbo3@huawei.com>
> 
> 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 <zhenghongbo3@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  lib/librte_bpf/bpf_validate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c
> index 9214f15..7b1291b 100644
> --- a/lib/librte_bpf/bpf_validate.c
> +++ b/lib/librte_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);
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] bpf: fix unreachable statement
  2021-04-22 11:23 ` Ananyev, Konstantin
@ 2021-05-05 10:23   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2021-05-05 10:23 UTC (permalink / raw)
  To: Ananyev, Konstantin; +Cc: Min Hu (Connor), dev, Yigit, Ferruh

22/04/2021 13:23, Ananyev, Konstantin:
> > From: HongBo Zheng <zhenghongbo3@huawei.com>
> > 
> > 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 <zhenghongbo3@huawei.com>
> > Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied, thanks




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-05 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22  7:30 [dpdk-dev] [PATCH] bpf: fix unreachable statement Min Hu (Connor)
2021-04-22 11:23 ` Ananyev, Konstantin
2021-05-05 10:23   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).