[dpdk-stable] patch 'kni: fix crash with null name' has been queued to LTS release 16.11.8

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Aug 10 11:06:23 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.8

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/12/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From 4599762e58b07baac76656b9c89929841cb432c8 Mon Sep 17 00:00:00 2001
From: Dan Gora <dg at adax.com>
Date: Thu, 28 Jun 2018 15:58:38 -0700
Subject: [PATCH] kni: fix crash with null name

[ upstream commit e716b639856cc4baa46bc6d5bc63bcc1d6bd9cf9 ]

Fix a segmentation fault which occurs when the kni_autotest is run
in the 'test' application.

This segmenation fault occurs when rte_kni_get() is called with a
NULL value for 'name'.

Fixes: 0c6bc8ef70ba ("kni: memzone pool for alloc and release")

Signed-off-by: Dan Gora <dg at adax.com>
Acked-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 lib/librte_kni/rte_kni.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index c3f9208c12..0c6641bfa4 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -678,6 +678,9 @@ rte_kni_get(const char *name)
 	struct rte_kni_memzone_slot *it;
 	struct rte_kni *kni;
 
+	if (name == NULL || name[0] == '\0')
+		return NULL;
+
 	/* Note: could be improved perf-wise if necessary */
 	for (i = 0; i < kni_memzone_pool.max_ifaces; i++) {
 		it = &kni_memzone_pool.slots[i];
-- 
2.18.0



More information about the stable mailing list