DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix verification of device context
@ 2017-07-26  5:43 Shachar Beiser
  2017-07-26  9:06 ` Adrien Mazarguil
  2017-07-26 13:30 ` [dpdk-dev] [PATCH 0/6] fix ethdev device detach Gaetan Rivet
  0 siblings, 2 replies; 23+ messages in thread
From: Shachar Beiser @ 2017-07-26  5:43 UTC (permalink / raw)
  To: dev; +Cc: Shachar Beiser, Adrien Mazarguil, Nelio Laranjeiro, stable

Get interface name function lacks verification of device context.
It might lead to segmentation fault when trying to query the name
after the device is closed.fixing it by adding the missing verification

Fixes: cd89f22a1e9770 ("net/mlx5: remove unused interface name query")
Cc: stable@dpdk.org

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index b70b7b9..6e67461 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -173,6 +173,10 @@ struct priv *
 	char match[IF_NAMESIZE] = "";
 
 	{
+		if (priv->ctx == NULL) {
+			DEBUG("The device is closed, cannot query interface name ");
+			return -1;
+		}
 		MKSTR(path, "%s/device/net", priv->ctx->device->ibdev_path);
 
 		dir = opendir(path);
-- 
1.8.3.1

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

end of thread, other threads:[~2017-08-08  8:39 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26  5:43 [dpdk-dev] [PATCH] net/mlx5: fix verification of device context Shachar Beiser
2017-07-26  9:06 ` Adrien Mazarguil
2017-07-26  9:21   ` Shachar Beiser
2017-07-26 12:55     ` Gaëtan Rivet
2017-07-26 13:30 ` [dpdk-dev] [PATCH 0/6] fix ethdev device detach Gaetan Rivet
2017-07-26 13:30   ` [dpdk-dev] [PATCH 1/6] ethdev: fix device state on detach Gaetan Rivet
2017-07-26 13:30   ` [dpdk-dev] [PATCH 3/6] net/mlx4: advertize the detach capability Gaetan Rivet
2017-07-26 13:30   ` [dpdk-dev] [PATCH 4/6] net/mlx5: " Gaetan Rivet
2017-07-26 13:30   ` [dpdk-dev] [PATCH 5/6] app/testpmd: let the user know device detach failed Gaetan Rivet
2017-07-26 13:30   ` [dpdk-dev] [PATCH 6/6] doc: announce ethdev API change for detach flag Gaetan Rivet
2017-07-26 13:35   ` [dpdk-dev] [PATCH v2 0/6] fix ethdev device detach Gaetan Rivet
2017-07-26 13:35     ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix device state on detach Gaetan Rivet
2017-07-26 13:35     ` [dpdk-dev] [PATCH v2 2/6] ethdev: properly check detach capability Gaetan Rivet
2017-07-26 13:35     ` [dpdk-dev] [PATCH v2 3/6] net/mlx4: advertize the " Gaetan Rivet
2017-07-26 13:35     ` [dpdk-dev] [PATCH v2 4/6] net/mlx5: " Gaetan Rivet
2017-07-26 13:35     ` [dpdk-dev] [PATCH v2 5/6] app/testpmd: let the user know device detach failed Gaetan Rivet
2017-07-26 13:35     ` [dpdk-dev] [PATCH v2 6/6] doc: announce ethdev API change for detach flag Gaetan Rivet
2017-07-28 15:54       ` Mcnamara, John
2017-07-31  9:40       ` [dpdk-dev] [PATCH v3] " Gaetan Rivet
2017-08-08  8:37         ` Thomas Monjalon
2017-07-30  7:33     ` [dpdk-dev] [PATCH v2 0/6] fix ethdev device detach Shachar Beiser
2017-07-31  8:57     ` Adrien Mazarguil
2017-07-31  9:31       ` Thomas Monjalon

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