[dpdk-stable] patch 'malloc: fix realloc padded element size' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:34:31 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.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 12/21/19. 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.

Thanks.

Luca Boccassi

---
>From 66c6f9f9bdb922ca64e03bc3762211bf481463c9 Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl at mellanox.com>
Date: Tue, 12 Nov 2019 14:50:28 +0000
Subject: [PATCH] malloc: fix realloc padded element size

[ upstream commit 90f538b8630b2782460aae46f346ddb4fc102011 ]

When resize a memory with next element, the original element size grows.
If the orginal element has padding, the real inner element size didn't
grow as well and this causes trailer verification failure when malloc
debug enabled.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Xueming Li <xuemingl at mellanox.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/librte_eal/common/malloc_elem.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c
index f6cbc42266..ea7a603dd8 100644
--- a/lib/librte_eal/common/malloc_elem.c
+++ b/lib/librte_eal/common/malloc_elem.c
@@ -136,6 +136,11 @@ split_elem(struct malloc_elem *elem, struct malloc_elem *split_pt)
 	next_elem->prev = split_pt;
 	elem->size = old_elem_size;
 	set_trailer(elem);
+	if (elem->pad) {
+		/* Update inner padding inner element size. */
+		elem = RTE_PTR_ADD(elem, elem->pad);
+		elem->size = old_elem_size - elem->pad;
+	}
 }
 
 /*
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:31.270361448 +0000
+++ 0124-malloc-fix-realloc-padded-element-size.patch	2019-12-19 14:32:26.325302188 +0000
@@ -1,15 +1,16 @@
-From 90f538b8630b2782460aae46f346ddb4fc102011 Mon Sep 17 00:00:00 2001
+From 66c6f9f9bdb922ca64e03bc3762211bf481463c9 Mon Sep 17 00:00:00 2001
 From: Xueming Li <xuemingl at mellanox.com>
 Date: Tue, 12 Nov 2019 14:50:28 +0000
 Subject: [PATCH] malloc: fix realloc padded element size
 
+[ upstream commit 90f538b8630b2782460aae46f346ddb4fc102011 ]
+
 When resize a memory with next element, the original element size grows.
 If the orginal element has padding, the real inner element size didn't
 grow as well and this causes trailer verification failure when malloc
 debug enabled.
 
 Fixes: af75078fece3 ("first public release")
-Cc: stable at dpdk.org
 
 Signed-off-by: Xueming Li <xuemingl at mellanox.com>
 Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
@@ -18,11 +19,11 @@
  1 file changed, 5 insertions(+)
 
 diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c
-index 658c9b5b79..afacb1813c 100644
+index f6cbc42266..ea7a603dd8 100644
 --- a/lib/librte_eal/common/malloc_elem.c
 +++ b/lib/librte_eal/common/malloc_elem.c
-@@ -307,6 +307,11 @@ split_elem(struct malloc_elem *elem, struct malloc_elem *split_pt)
- 	elem->next = split_pt;
+@@ -136,6 +136,11 @@ split_elem(struct malloc_elem *elem, struct malloc_elem *split_pt)
+ 	next_elem->prev = split_pt;
  	elem->size = old_elem_size;
  	set_trailer(elem);
 +	if (elem->pad) {


More information about the stable mailing list