patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v1] eal: fix random device arguments in device iterator
@ 2021-10-27  8:22 Xueming Li
  2021-11-04 10:41 ` David Marchand
  0 siblings, 1 reply; 2+ messages in thread
From: Xueming Li @ 2021-10-27  8:22 UTC (permalink / raw)
  To: dev; +Cc: xuemingl, stable, Gaetan Rivet, Gaetan Rivet

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(-)

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;
 
-- 
2.33.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH v1] eal: fix random device arguments in device iterator
  2021-10-27  8:22 [dpdk-stable] [PATCH v1] eal: fix random device arguments in device iterator Xueming Li
@ 2021-11-04 10:41 ` David Marchand
  0 siblings, 0 replies; 2+ messages in thread
From: David Marchand @ 2021-11-04 10:41 UTC (permalink / raw)
  To: Xueming Li; +Cc: dev, dpdk stable, Gaetan Rivet, vijay.srivastava

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.

-- 
David Marchand


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-04 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27  8:22 [dpdk-stable] [PATCH v1] eal: fix random device arguments in device iterator Xueming Li
2021-11-04 10:41 ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).