[dpdk-stable] patch 'bpf: fix add/sub min/max estimations' has been queued to LTS release 18.11.10

Kevin Traynor ktraynor at redhat.com
Fri Jul 17 18:31:55 CEST 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/23/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/79ef320b85481100714bfe88fe6acf820d0e1253

Thanks.

Kevin.

---
>From 79ef320b85481100714bfe88fe6acf820d0e1253 Mon Sep 17 00:00:00 2001
From: Konstantin Ananyev <konstantin.ananyev at intel.com>
Date: Wed, 27 May 2020 15:16:50 +0100
Subject: [PATCH] bpf: fix add/sub min/max estimations

[ upstream commit 20c19d9df5f08840d96204dcc65437223c434325 ]

eval_add()/eval_sub() not always correctly estimate
minimum and maximum possible values of add/sub operations.

Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
---
 lib/librte_bpf/bpf_validate.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c
index 0cf41fa27c..f92c514614 100644
--- a/lib/librte_bpf/bpf_validate.c
+++ b/lib/librte_bpf/bpf_validate.c
@@ -225,5 +225,5 @@ eval_add(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk)
 
 	rv.u.min = (rd->u.min + rs->u.min) & msk;
-	rv.u.max = (rd->u.min + rs->u.max) & msk;
+	rv.u.max = (rd->u.max + rs->u.max) & msk;
 	rv.s.min = (rd->s.min + rs->s.min) & msk;
 	rv.s.max = (rd->s.max + rs->s.max) & msk;
@@ -253,8 +253,8 @@ eval_sub(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk)
 	struct bpf_reg_val rv;
 
-	rv.u.min = (rd->u.min - rs->u.min) & msk;
-	rv.u.max = (rd->u.min - rs->u.max) & msk;
-	rv.s.min = (rd->s.min - rs->s.min) & msk;
-	rv.s.max = (rd->s.max - rs->s.max) & msk;
+	rv.u.min = (rd->u.min - rs->u.max) & msk;
+	rv.u.max = (rd->u.max - rs->u.min) & msk;
+	rv.s.min = (rd->s.min - rs->s.max) & msk;
+	rv.s.max = (rd->s.max - rs->s.min) & msk;
 
 	/*
-- 
2.21.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-17 17:17:00.388237990 +0100
+++ 0007-bpf-fix-add-sub-min-max-estimations.patch	2020-07-17 17:16:59.963771790 +0100
@@ -1 +1 @@
-From 20c19d9df5f08840d96204dcc65437223c434325 Mon Sep 17 00:00:00 2001
+From 79ef320b85481100714bfe88fe6acf820d0e1253 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 20c19d9df5f08840d96204dcc65437223c434325 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
-index 6bd6f78e9b..80d21fabbe 100644
+index 0cf41fa27c..f92c514614 100644
@@ -21 +22 @@
-@@ -227,5 +227,5 @@ eval_add(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk)
+@@ -225,5 +225,5 @@ eval_add(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk)
@@ -28 +29 @@
-@@ -255,8 +255,8 @@ eval_sub(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk)
+@@ -253,8 +253,8 @@ eval_sub(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, uint64_t msk)



More information about the stable mailing list