[dpdk-stable] patch 'mem: avoid crash on memseg query with invalid address' has been queued to stable release 18.05.1

Christian Ehrhardt christian.ehrhardt at canonical.com
Mon Jul 30 18:12:31 CEST 2018


Hi,

FYI, your patch has been queued to stable release 18.05.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 08/01/18. So please
shout if anyone has objections.

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 2a52089e410619de1590e591cddb26824354e574 Mon Sep 17 00:00:00 2001
From: Dariusz Stojaczyk <dariuszx.stojaczyk at intel.com>
Date: Mon, 4 Jun 2018 07:33:41 +0200
Subject: [PATCH] mem: avoid crash on memseg query with invalid address

[ upstream commit 09037cf36c0888b6310d0e56739954e7bf691f97 ]

When trying to use it with an address that's not
managed by DPDK it would segfault due to a missing
check. The doc says this function returns either
a pointer or NULL, so let it do so.

Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")

Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk at intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/librte_eal/common/eal_common_memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 4f0688f9d..ecc5bb248 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -536,6 +536,9 @@ virt2memseg(const void *addr, const struct rte_memseg_list *msl)
 	void *start, *end;
 	int ms_idx;
 
+	if (msl == NULL)
+		return NULL;
+
 	/* a memseg list was specified, check if it's the right one */
 	start = msl->base_va;
 	end = RTE_PTR_ADD(start, (size_t)msl->page_sz * msl->memseg_arr.len);
-- 
2.17.1



More information about the stable mailing list