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

Kevin Traynor ktraynor at redhat.com
Wed Dec 11 22:26:26 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

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/17/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.

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/8b828c9a108cd894620aeb6b9ea6041cafbcc2cb

Thanks.

Kevin.

---
>From 8b828c9a108cd894620aeb6b9ea6041cafbcc2cb 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 052aeeb7b..c92dc0ab6 100644
--- a/lib/librte_eal/common/malloc_elem.c
+++ b/lib/librte_eal/common/malloc_elem.c
@@ -293,4 +293,9 @@ split_elem(struct malloc_elem *elem, struct malloc_elem *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.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-11 21:24:15.411481735 +0000
+++ 0034-malloc-fix-realloc-padded-element-size.patch	2019-12-11 21:24:12.667651217 +0000
@@ -1 +1 @@
-From 90f538b8630b2782460aae46f346ddb4fc102011 Mon Sep 17 00:00:00 2001
+From 8b828c9a108cd894620aeb6b9ea6041cafbcc2cb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 90f538b8630b2782460aae46f346ddb4fc102011 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 658c9b5b7..afacb1813 100644
+index 052aeeb7b..c92dc0ab6 100644
@@ -24 +25 @@
-@@ -308,4 +308,9 @@ split_elem(struct malloc_elem *elem, struct malloc_elem *split_pt)
+@@ -293,4 +293,9 @@ split_elem(struct malloc_elem *elem, struct malloc_elem *split_pt)



More information about the stable mailing list