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 99B8AA034C; Wed, 23 Feb 2022 11:39:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71A5B40E5A; Wed, 23 Feb 2022 11:39:43 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2077.outbound.protection.outlook.com [40.107.212.77]) by mails.dpdk.org (Postfix) with ESMTP id 7294640DF6; Wed, 23 Feb 2022 11:39:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MOfL3WrCRFlt9kRfGMLFsrdINlZkp4xDycR0AHbCzHxcNhP2b47MzEqPAnaUNMNgByaDeiUsGyp7/1vijMSX8qStjppA6oGFYpYuKJ3MsQqK7RjxZLpwcCzOE8ZYGfb8/YtbA1VlhPM+yvx6h7lgcPiwBZIjFt9Ovtb3wGWn4XI7tdVWLa+5Ho23MfK8miCfoSoRz4UyfEdAqHkiWQ/m+IytPaF4CHbim+ylUWiwOyrrmXUPp9YgFafMZkfA1xn0eCU8k/Ho5BmA2HarOShe5kLC2QLCqeXoB/DZ7CNkQLUuXooBc+JPWPnewI8aiH2QnScncLy/yVXF8unjcmDV9g== 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=2dVjFaSMZARO0YVJHCxBQzGiEl82v7mN8jjt7MGsYc8=; b=KrZZMZtMN2LhbwgLDAjNTXsFwmuQbdhzF22d+lTUFMV51RfMv5OxDezklfS/5/uAaqmy2My+Tj5ZyxgkX07V2aUh7hVd0OvuHEjAeUHQVPyL9Ho9SXbTt9Dzxwrp5led2ZVN75s9Vp2LrZK+Tmfffgx4hpT3cQZIlGs58hlzZZa50Hr5yru/fWWqP0PDdAudqItKCKdFSkO898s4V1gOG8eRiajpmuIozXOAUs9I7m5s5SqE14D8ujP9b7mEMcdG37NzjBlTimbUAsb+HcJCAmIsR8nN9fphb1Gk+cRvSVgqwkYcaAyAUjN9IRL2XWumjr2JdIr7eFQ8K+8zT3sLxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=2dVjFaSMZARO0YVJHCxBQzGiEl82v7mN8jjt7MGsYc8=; b=uBulBVG2OTIM3OVmrtHvMUlcG4EZKWLJFrUDoJOFkjgn73Jlvi0ps40kLOV4l0Akki1XbPG5zHpLUF+dWywyqb8vHuW9LAKokwBRU9/3slpZztMtb0EVKC8haCC0etPj/iEVFMLMwL/equ7srACNMcvikrimGaoXzrNAz+T0uF/GVYMvfh3cGJHb8onkWSU0maTfY1LiK922HadajjbL/Njn0V4GKRzaiw1HMr0b1mSOUaaVqG6S1GCWuXAcqusdmm7MpjMd1gAJeRWLk3GyiyL3LdWFXBfzpIlIAwX4oxk+1r5HhCXEKpxiyAmyLtNs5FeQXgKQc/iPH3nwY8HghA== Received: from DM4PR12MB5389.namprd12.prod.outlook.com (2603:10b6:5:39e::8) by CY4PR12MB1720.namprd12.prod.outlook.com (2603:10b6:903:121::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24; Wed, 23 Feb 2022 10:39:40 +0000 Received: from DM4PR12MB5389.namprd12.prod.outlook.com ([fe80::9c18:b83d:16b8:c4c]) by DM4PR12MB5389.namprd12.prod.outlook.com ([fe80::9c18:b83d:16b8:c4c%7]) with mapi id 15.20.5017.022; Wed, 23 Feb 2022 10:39:40 +0000 From: Tal Shnaiderman To: Adham Masarwah , "dev@dpdk.org" CC: "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Matan Azrad , Slava Ovsiienko , Tamer Hleihel , "erfrimod@microsoft.com" , "stable@dpdk.org" Subject: RE: [PATCH] net/mlx5: fix destroying empty matchers list Thread-Topic: [PATCH] net/mlx5: fix destroying empty matchers list Thread-Index: AQHYKJhKoXvYpWrd/kG0hVIWprSj76yg3z+AgAASarA= Date: Wed, 23 Feb 2022 10:39:40 +0000 Message-ID: References: <20220223093205.4240-1-adham@nvidia.com> <20220223093205.4240-2-adham@nvidia.com> In-Reply-To: <20220223093205.4240-2-adham@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a20bd9e9-fbf8-4333-a6da-08d9f6b8cbd8 x-ms-traffictypediagnostic: CY4PR12MB1720:EE_ x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vt9pQmCFNan/V/5YGfc0PK8+rRqve/p9JVC3cdEjyjmUZIFoavkHWF6yIHDmIpIWvL8vl//C5qkB2D0/GTCHc5jV3CHb329c8t9557LUB92m6OETNc5lASbVKBY4YYK7dFWDS03GxIEY3EI3t+qIf1bPH6o1/gIOoBzbZwq9nezkFadoeMcf0aDDzdiQzZvJPyJVSbsGVCXORdF59EqKBp6mTvdrqFILqsNu33WtP6tAy+Bg3YQz6y//TE+b18RWj42zG2lVdt180eXgAXQ7/cKqq/poq9EmwIEQQ7TtKTIZxez/upcRhSzCDO6sZ28heGeob5O9eSTizwpD6bqgd4x/9Gtexm43iwrW6cm5OT4TZDD1X3Gc2xCDFV/VnARSsG72g83hNeEaY1Vhk5UR47tFcHG/yG9W9smNH6ybYeGiBUzM5+HeAw+kpVbF6Efll4StMSXpS7y/Y3O2zpUHUVyx83bRQGgNrhChD8wlh4C2OnSFMvCAL2PRcoLQBLaj55M/Ve9ldJUYAGA87fDK6EzI1HHUzepvUqbZeiEDSnmes21DJNf35dQ2NqQ0B+pqVPVp0Z+EixCeAqbsZYgRQKfV9hk/wl04w1YLdiMsAlHXo2dCjSU0CJtOMl6j4aa6qtXqmltyZcUNFwQaUIiYgWqbK5vfnIAtf2ZqJQNMcKwU/BXgR18ormNeuUgXKZr39QLxIb6i4/WdhtrTUJsY9w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5389.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(186003)(26005)(9686003)(66556008)(66946007)(508600001)(6506007)(7696005)(76116006)(66446008)(86362001)(54906003)(316002)(64756008)(110136005)(8676002)(71200400001)(122000001)(66476007)(38070700005)(83380400001)(4326008)(38100700002)(55016003)(5660300002)(52536014)(33656002)(2906002)(8936002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?mJxbXuAuDiBJrS4fAfsN55ysg+Q5G5JpdNzv5OCO/b6by6UAlyutRbp3Dckg?= =?us-ascii?Q?9oHvOQ3PJtxN6qOIoMAH9R9dTKcqVVvKXQ3rFpYsukalXV3BqZ/idAb9G8N9?= =?us-ascii?Q?1407aSgW5Wx4p6c6spNRyZCHuSl5oT/Ct87y11MYbOXllP2dbqAJ/UWYG5x+?= =?us-ascii?Q?1sqQiRRvbDxQayBwBypNWhMW3ldKBwFIKV8w9AIlSsa6Ef9hiAo5GKbYjmwI?= =?us-ascii?Q?b0h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pLdwwAF?= =?us-ascii?Q?ccdLeAQxhraDFbV6HWKxKwK14NUqwnxMq2ukqj309yZWJUqYA6xJZABzgzLD?= =?us-ascii?Q?HPfgWcA+LT5erHC2jhmtQi67uLpoX7/elWs5wk1JbWhVBZyo60cT4PflgJ7s?= =?us-ascii?Q?rcy79I1dSLguD6OjAcDclrXwZq5jYVBpt7kAV3nDjsa/h/xsblwH+gU8FTF4?= =?us-ascii?Q?icr5b0uLJTmr/+IoOOs5b24C8xQ9XBh/Otou3ECVfA42YwJwc11FwbxbtSwt?= =?us-ascii?Q?bbE80tvLoPAcTBK4gfCyhETJCjRcKcBxE1r8ScmVxzL0vauJI2zCcq3kkRHS?= =?us-ascii?Q?IeoVbma/dlcojiOWwLu6Ip1StflXefruJPHSdnGyAK9WuJFXy9XeU5utAzB1?= =?us-ascii?Q?huMMCVu/thd8pc7LyvO2Z6Zr0Rx7ghkIxteLYnkjv8FV/Y5icgpcsUOEDZFq?= =?us-ascii?Q?tGeEC/OO2IKHaQ0KzaWM/RrQl+EV+1HhXeh25D13bU9CTutAxxWxXJD4Uhxn?= =?us-ascii?Q?AA=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5389.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a20bd9e9-fbf8-4333-a6da-08d9f6b8cbd8 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Feb 2022 10:39:40.2304 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: q+5xtrckpE9oUnmZ+6LBITzJjweVtU8rtVnWAKBfc6x2EuJu7c1IJ19cgglvwAnzhbtJqZi0jalR5z8GtzLOUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1720 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 > Subject: [PATCH] net/mlx5: fix destroying empty matchers list >=20 > The table remove callback function is trying to destroy the matchers list > associated with table entries without checking if the list is valid, whic= h causes > nullptr dereference. > Fixed by validating the matchers list before destroying it. >=20 > Issue can be reproduced with testpmd on Windows, when you run: > port close all >=20 > Fixes: 1872635570be ("net/mlx5: make matcher list thread safe") > Cc: stable@dpdk.org >=20 > Signed-off-by: Adham Masarwah > Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c index ef9c66eddf..baef252a7a 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -10503,7 +10503,8 @@ flow_dv_tbl_remove_cb(void *tool_ctx, struct > mlx5_list_entry *entry) > tbl_data->tunnel->tunnel_id : 0, > tbl_data->group_id); > } > - mlx5_list_destroy(tbl_data->matchers); > + if (tbl_data->matchers) > + mlx5_list_destroy(tbl_data->matchers); > mlx5_ipool_free(sh->ipool[MLX5_IPOOL_JUMP], tbl_data->idx); } >=20 > -- > 2.16.1.windows.4 Acked-by: Tal Shnaiderman