[dpdk-stable] patch 'ip_frag: fix overflow in key comparison' has been queued to LTS release 16.11.9

Luca Boccassi bluca at debian.org
Mon Oct 29 13:53:27 CET 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/31/18. 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. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Luca Boccassi

---
>From 70279544fa63fa39d374b71446b253b492af66c5 Mon Sep 17 00:00:00 2001
From: Li Han <han.li1 at zte.com.cn>
Date: Wed, 1 Aug 2018 22:01:03 -0400
Subject: [PATCH] ip_frag: fix overflow in key comparison

[ upstream commit 8721e07478c6edc9565645047742f79c654cfd1b ]

in struct ip_frag_key,src_dst[] type is uint64_t.
but "val" which to store the calc restult ,type is uint32_t.
we may lost high 32 bit key. and function return value is int,
but it won't return < 0.

Signed-off-by: Li Han <han.li1 at zte.com.cn>
Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
---
 lib/librte_ip_frag/ip_frag_common.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/librte_ip_frag/ip_frag_common.h b/lib/librte_ip_frag/ip_frag_common.h
index 835e4f93f..ffba1b49b 100644
--- a/lib/librte_ip_frag/ip_frag_common.h
+++ b/lib/librte_ip_frag/ip_frag_common.h
@@ -98,10 +98,11 @@ ip_frag_key_invalidate(struct ip_frag_key * key)
 }
 
 /* compare two keys */
-static inline int
+static inline uint64_t
 ip_frag_key_cmp(const struct ip_frag_key * k1, const struct ip_frag_key * k2)
 {
-	uint32_t i, val;
+	uint32_t i;
+	uint64_t val;
 	val = k1->id ^ k2->id;
 	for (i = 0; i < k1->key_len; i++)
 		val |= k1->src_dst[i] ^ k2->src_dst[i];
-- 
2.19.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-10-29 12:48:14.825564651 +0000
+++ 0018-ip_frag-fix-overflow-in-key-comparison.patch	2018-10-29 12:48:14.474417981 +0000
@@ -1,8 +1,10 @@
-From 8721e07478c6edc9565645047742f79c654cfd1b Mon Sep 17 00:00:00 2001
+From 70279544fa63fa39d374b71446b253b492af66c5 Mon Sep 17 00:00:00 2001
 From: Li Han <han.li1 at zte.com.cn>
 Date: Wed, 1 Aug 2018 22:01:03 -0400
 Subject: [PATCH] ip_frag: fix overflow in key comparison
 
+[ upstream commit 8721e07478c6edc9565645047742f79c654cfd1b ]
+
 in struct ip_frag_key,src_dst[] type is uint64_t.
 but "val" which to store the calc restult ,type is uint32_t.
 we may lost high 32 bit key. and function return value is int,
@@ -15,10 +17,10 @@
  1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/lib/librte_ip_frag/ip_frag_common.h b/lib/librte_ip_frag/ip_frag_common.h
-index 0fdcc7d0f..0f62e2e16 100644
+index 835e4f93f..ffba1b49b 100644
 --- a/lib/librte_ip_frag/ip_frag_common.h
 +++ b/lib/librte_ip_frag/ip_frag_common.h
-@@ -75,10 +75,11 @@ ip_frag_key_invalidate(struct ip_frag_key * key)
+@@ -98,10 +98,11 @@ ip_frag_key_invalidate(struct ip_frag_key * key)
  }
  
  /* compare two keys */


More information about the stable mailing list