diff mbox series

[v1] eal: fix random device arguments in device iterator

Message ID 20211027082221.693957-1-xuemingl@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers show
Series [v1] eal: fix random device arguments in device iterator | expand

Checks

Context Check Description
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Functional fail Functional Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Xueming(Steven) Li Oct. 27, 2021, 8:22 a.m. UTC
Devargs used in device iterator initialization wasn't set to zero, random
data like bus string lead to invalid address access.

This patch initializes devargs.

Fixes: c99a2d4c6b7f ("eal: implement device iteration initialization")
Cc: stable@dpdk.org
Cc: Gaetan Rivet <grive@u256.net>

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 lib/eal/common/eal_common_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Marchand Nov. 4, 2021, 10:41 a.m. UTC | #1
On Wed, Oct 27, 2021 at 10:23 AM Xueming Li <xuemingl@nvidia.com> wrote:
>
> Devargs used in device iterator initialization wasn't set to zero, random
> data like bus string lead to invalid address access.
>
> This patch initializes devargs.
>
> Fixes: c99a2d4c6b7f ("eal: implement device iteration initialization")
> Cc: stable@dpdk.org
>
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>

Applied, thanks.


It seems a basic issue, could it be caught with a unit test?
Thanks.
diff mbox series

Patch

diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 148a23830ab..e1e9976d8dc 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -573,7 +573,7 @@  int
 rte_dev_iterator_init(struct rte_dev_iterator *it,
 		      const char *dev_str)
 {
-	struct rte_devargs devargs;
+	struct rte_devargs devargs = { .bus = NULL };
 	struct rte_class *cls = NULL;
 	struct rte_bus *bus = NULL;