From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CF19A0C4B; Tue, 23 Nov 2021 21:22:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4856A40040; Tue, 23 Nov 2021 21:22:48 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2057.outbound.protection.outlook.com [40.107.244.57]) by mails.dpdk.org (Postfix) with ESMTP id 2F3C14003C for ; Tue, 23 Nov 2021 21:22:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oMWQpuys2J7DBj2fQNr6v+fYB7297fuL6HG4dULsdPr8CySz7wRVPsOXJMOYHdg+jbK3XdR/ovNCp7PTYNmsojgUeboMgpBQdZbeukWFEkZRBxTyioA1LNyDcVUUA5XGngSsSQg3XqiLpe2v1DH1eIfrRYwO/6vSyDAvBslFvBOjyRaEXzpBjiruIbBRB+IC6fNzAGl/Yj7obGrqn7PcESdmvGQiCXhr07UsbHevIBFeubmlI/qA+2oOHeAcCr4mNljjq2haxQMYVoWJhllLoZnXSZx7lkh3pmtkoEaSGPqcxWUGfOzUDq1e/El9pnmUmt5H1OzcyNK2hrb0NKd0Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qlOqsX0CMLIKVnfk7M2FQtox829igoGHE5qgzmglf8U=; b=gwdTxQK7zz9cer574S9jVxOOKOyuaAqDJGMC4VmgD0qHONhQcBmJjtHI0G4KclfBRB/8kd/BnzY91lgkfv90MAn9+3lMrqGuAqeb1ZRbBIqF12gCkslCYk/+5H25ZFPE/Eiv42EYR75F9rl1A+jjsC7Pb9lcp1s26IbgOY5v+au7zi84gr62CvEES36vRe0eMtiq4NZ1zDdjpCEYfe5O5DY8P2UGoFKVULwlK1IHOqKj4s0vlU7dZ6U9NSNCHWZwdtcJv2+g74aBIgsPJFiGgh1cK8NbM/qPMHUQpC46PzCg++JMYI6S3C8brTmIGAei5gS1Gm8O6tEUC0dimRhaJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qlOqsX0CMLIKVnfk7M2FQtox829igoGHE5qgzmglf8U=; b=XbYPfS+943iguPxveuvbx84dKW1UqXinJxn8xeW/k6DpNx/MpZ+2mZDiYSupCRMaD7/EQqaSckbq/ygwcvcgFJMVd/pTUTfGAyf1C/BPELBSvoAu2PiunTJq8RiA9C/PU684a+iETI4PUpdocqJKE1jHo2TW5xgcHtXwkleGEhI7nGQJZH6sOY+IUsWg7fgxPoUh69Mtm8okg+XfHqGuPOhBmAoTPI9Ueln/MCaua8byumGjuoZa6j19sD14GkUBta3zqEx+7Yn+w3Py8OYY2D+zyOFngltoA60A5zswrwkgyrOoK8vyGL+M1L4GX5aJ9vb7e/VCE6eYlczlQADJpw== Received: from MW4P222CA0020.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::25) by MN2PR12MB3390.namprd12.prod.outlook.com (2603:10b6:208:c9::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22; Tue, 23 Nov 2021 20:22:44 +0000 Received: from CO1NAM11FT061.eop-nam11.prod.protection.outlook.com (2603:10b6:303:114:cafe::cb) by MW4P222CA0020.outlook.office365.com (2603:10b6:303:114::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Tue, 23 Nov 2021 20:22:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT061.mail.protection.outlook.com (10.13.175.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4713.20 via Frontend Transport; Tue, 23 Nov 2021 20:22:43 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 23 Nov 2021 20:22:41 +0000 From: Dmitry Kozlyuk To: CC: Raslan Darawsheh , , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH] net/mlx5: fix segfault on close after failed start Date: Tue, 23 Nov 2021 22:22:27 +0200 Message-ID: <20211123202227.3318001-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 964bc539-2254-4f10-e3a0-08d9aebf0152 X-MS-TrafficTypeDiagnostic: MN2PR12MB3390: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gJOu5fIXFrf2XgaAc+uGqgR2q7jb11LRnB9GgNVw0IM6GpUHku7LWc9J9BMRuEnGkwOde7Ez6E7dDoo06zgkxqF+O056NHcox+LjDUajIRZ4Ky+GB+e2p4sUD73ieHJkQkrytiKdcbj6fBatg2tycRPosoxzg8c0DfVYSHBa9hivpn86w2ynJM9TSK5m0xuR/Bg929gIBUa5O3FC+UPQv3YDbwqs8N3JvIldSo14r2YJVBcApcxXXDksOuPukDXeSDid6GDlqr+QSe4glez79wNlsVmkog2/zGtRke7xxgR0apAVJdHL1rAlxTx8OnTDndzq3NpAeNwwgZ1K/BPf2GQgfydS9xGvKKrmsgswY8MzS0r8Vqeywy9o4Uu74+/0oQ3QFD4/Fjg4GCIXjLVEPjbIQQSz/SJ86zuT0NWZGjJYAyl5iFwMnw5g/Sa0zFBX7EeF5GgA3VVk3EGjCFeTFzlWoXuBm5kGW2ZZgCChkP4FOaG491Gj4d3UhMwNILFpoPPz2kq988zPZ0OT57hxsUlkqY9BfX3PXkSHdoRIu6JQBk7g/1o0dXu2yIMxd115W8g+tG7bIjNOXD/iptH01KNdfL+I0uR61awJjJKSF3Hp1ITDzQLTgr6gHRMTUSn2FIxJh3wUVCDV+lVlQoToZOSR1tYeRuiTRF2gzurUvl4FVOkUnFtZKuof/wDlZjsZHpLg4EEqWiuXwNdBlHK+yA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(7636003)(47076005)(86362001)(6666004)(83380400001)(82310400004)(316002)(36860700001)(2616005)(4744005)(70206006)(36756003)(6916009)(6286002)(426003)(356005)(4326008)(186003)(26005)(2906002)(70586007)(5660300002)(8936002)(7696005)(336012)(16526019)(107886003)(55016003)(54906003)(1076003)(508600001)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2021 20:22:43.2772 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 964bc539-2254-4f10-e3a0-08d9aebf0152 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT061.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3390 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org If mlx5_rxq_start() failed and rxq_ctrl was not initialized, mlx5_rxq_obj_verify() would segfaul in an attempt to dereference it. Add a check that rxq_ctrl is not NULL before accessing its members. Fixes: 09c2555303be ("net/mlx5: support shared Rx queue") Cc: xuemingl@nvidia.com Signed-off-by: Dmitry Kozlyuk Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_rxq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 480f4f9f07..dd15e158b4 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1271,6 +1271,8 @@ mlx5_rxq_obj_verify(struct rte_eth_dev *dev) struct mlx5_rxq_obj *rxq_obj; LIST_FOREACH(rxq_obj, &priv->rxqsobj, next) { + if (rxq_obj->rxq_ctrl == NULL) + continue; if (rxq_obj->rxq_ctrl->rxq.shared && !LIST_EMPTY(&rxq_obj->rxq_ctrl->owners)) continue; -- 2.25.1