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

Kevin Traynor ktraynor at redhat.com
Mon Feb 21 16:35:45 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.11.1

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/26/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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/6e1bc26cdebb761b8152a58e1b566812498e494c

Thanks.

Kevin

---
>From 6e1bc26cdebb761b8152a58e1b566812498e494c 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 f54d1d7c00..2a037a12da 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2032,6 +2032,4 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
 	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)
@@ -2055,6 +2053,4 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
 	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)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-21 15:22:47.942207110 +0000
+++ 0156-test-mbuf-fix-mbuf-data-content-check.patch	2022-02-21 15:22:44.306704610 +0000
@@ -1 +1 @@
-From 985571b6b41ec49552b3d91c20060236c7c0fecb Mon Sep 17 00:00:00 2001
+From 6e1bc26cdebb761b8152a58e1b566812498e494c 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 f54d1d7c00..2a037a12da 100644
@@ -31 +32 @@
-@@ -2043,6 +2043,4 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
+@@ -2032,6 +2032,4 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
@@ -38 +39 @@
-@@ -2066,6 +2064,4 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
+@@ -2055,6 +2053,4 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)



More information about the stable mailing list