patch 'test/mbuf: fix mbuf data content check' has been queued to stable release 19.11.12

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Fri Feb 25 18:15:41 CET 2022


Hi,

FYI, your patch has been queued to stable release 19.11.12

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/27/22. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/0a8fdfb70e5c3bc49ce52b02cf94bbd367b304bd

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 0a8fdfb70e5c3bc49ce52b02cf94bbd367b304bd Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Thu, 3 Feb 2022 10:39:12 +0100
Subject: [PATCH] test/mbuf: fix mbuf data content check

[ upstream commit 985571b6b41ec49552b3d91c20060236c7c0fecb ]

When allocating a mbuf, its data content is most of the time zero'd but
nothing ensures this. This is especially wrong when building with
RTE_MALLOC_DEBUG, where data is poisoned to 0x6b on free.

This test reserves MBUF_TEST_DATA_LEN2 bytes in the mbuf data segment,
and sets this data to 0xcc.
Calling strlen(), the test may try to read more than MBUF_TEST_DATA_LEN2
which has been noticed when memory had been poisoned.

The mbuf data content is checked right after, so we can simply remove
strlen().

Fixes: 7b295dceea07 ("test/mbuf: add unit test cases")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
---
 app/test/test_mbuf.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 0208c31196..f231d37ffd 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2011,8 +2011,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
 			NULL);
 	if (data_copy == NULL)
 		GOTO_FAIL("%s: Error in reading packet data!\n", __func__);
-	if (strlen(data_copy) != MBUF_TEST_DATA_LEN2 - 5)
-		GOTO_FAIL("%s: Incorrect data length!\n", __func__);
 	for (off = 0; off < MBUF_TEST_DATA_LEN2 - 5; off++) {
 		if (data_copy[off] != (char)0xcc)
 			GOTO_FAIL("Data corrupted at offset %u", off);
@@ -2034,8 +2032,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
 	data_copy = rte_pktmbuf_read(m, hdr_len, 0, NULL);
 	if (data_copy == NULL)
 		GOTO_FAIL("%s: Error in reading packet data!\n", __func__);
-	if (strlen(data_copy) != MBUF_TEST_DATA_LEN2)
-		GOTO_FAIL("%s: Corrupted data content!\n", __func__);
 	for (off = 0; off < MBUF_TEST_DATA_LEN2; off++) {
 		if (data_copy[off] != (char)0xcc)
 			GOTO_FAIL("Data corrupted at offset %u", off);
-- 
2.35.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-25 16:58:46.088848652 +0100
+++ 0048-test-mbuf-fix-mbuf-data-content-check.patch	2022-02-25 16:58:44.292990460 +0100
@@ -1 +1 @@
-From 985571b6b41ec49552b3d91c20060236c7c0fecb Mon Sep 17 00:00:00 2001
+From 0a8fdfb70e5c3bc49ce52b02cf94bbd367b304bd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 985571b6b41ec49552b3d91c20060236c7c0fecb ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index f762befb69..d37aefd2e9 100644
+index 0208c31196..f231d37ffd 100644
@@ -31 +32 @@
-@@ -2042,8 +2042,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
+@@ -2011,8 +2011,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
@@ -40 +41 @@
-@@ -2065,8 +2063,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
+@@ -2034,8 +2032,6 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)


More information about the stable mailing list