From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 0F8C55B3C for ; Mon, 30 Jul 2018 18:17:36 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkArQ-00009D-Vf; Mon, 30 Jul 2018 16:17:29 +0000 From: Christian Ehrhardt To: Dariusz Stojaczyk Cc: Anatoly Burakov , dpdk stable Date: Mon, 30 Jul 2018 18:12:31 +0200 Message-Id: <20180730161342.16566-106-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730161342.16566-1-christian.ehrhardt@canonical.com> References: <20180730161342.16566-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'mem: avoid crash on memseg query with invalid address' has been queued to stable release 18.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 16:17:36 -0000 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 --- >>From 2a52089e410619de1590e591cddb26824354e574 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk 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 Acked-by: Anatoly Burakov --- 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