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 72591A0350; Mon, 28 Feb 2022 17:01:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4732D4068C; Mon, 28 Feb 2022 17:01:21 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2059.outbound.protection.outlook.com [40.107.244.59]) by mails.dpdk.org (Postfix) with ESMTP id 773DF40683; Sun, 27 Feb 2022 13:38:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HFnCFFN1sGjAbL3bGDIynyM7S4aN52FMDeqB68lfdRpf8S3Yf2uNNxlVho0UqHAwfNRqGpBMMQCbleB6nYMvXN1rdZjG7dbYFPfvAbR2sOk5IRxujEn8iIUftiGRDdqlUuspZ2PuAZq0BgZAErNH7/8rrR+6W4UBob6qMkqV80hcY8+v6ISXAfPd2E5SUCAMdXso2S27SGz1bkv4NYcwWffTzZ0Ses+4qbdIc1CHo2+otXvjapRoXuvrFuiQTtlMO7Dz7Ssff4GkHTqCwvz2xtG8io6CmN/0Y1bHi5YU2WT6P/Acx3WQJnMd4daw1ko/rg6nJTP/g1udd+UMQq6WJA== 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=KgCvki+kQbZ6Sls6cdVVmLStxz4H+Cc3sNBOG4oeg7Q=; b=ffwZfkXURTD0Z8dhdFxAPsyE3ttt2x+fe+10Zk8SaKONrn0pk/Wj2WVNjL4vo8hEkaZMODgXQ/ji/Lb8S8Gymo7LOVKWy4J61xIait7ARPWg6bS035FPBSX6tB5eflFHSy0zbf6naRhNHz/WaSFzfT47UtLgCbv9Vk4PvF/Ts52gNcHEZIOzBOE6LM8iP2DNatUx22FtmZgm2fWPC6svxeVtSqR5YHUW/3eU/GTlmxpDA1VoqdOJDqAT53D8ys0o6Y3yXtWPcEERC5/8M3A1cfTYRuZEHJnHTt0XYd5Fy9bok+qXlM7a9AfXo77I02aHfMl/e/Gd6NHbSOyHuIxVMg== 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=KgCvki+kQbZ6Sls6cdVVmLStxz4H+Cc3sNBOG4oeg7Q=; b=Mu5AJgbZ4C6GhTwH4eGTCIC8zzVIDireFRxwUTQYKj8uppKzyvCzpdyVvrSBmJCUr2i5m7DUoJ5TF34jq4uXucZ/cpSqilQozvGNHjgePpS+WjRJAPH9MneaKmfVREj4YIcajtJZLYsFGLiitIqdVrFNSDZfLCdE5zFMoGY8D7wKPGP85D4HoLkaMSUHoJLCNB6//6QC6T6sQJqIWTdJBYKaibwHiQ71ZziJTrlAKLnI2rmu7ScoEgJ21GX0MzCGIu9NQussjqA2qGFnE8qEtRgnX77X64sErPdTibCAzP9FyVGaNupDf0NAGgaGZ2IilJuzYQa9lJYleTckx59xiw== Received: from DM4PR12MB5341.namprd12.prod.outlook.com (2603:10b6:5:39e::18) by BY5PR12MB4195.namprd12.prod.outlook.com (2603:10b6:a03:200::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Sun, 27 Feb 2022 12:38:09 +0000 Received: from DM4PR12MB5341.namprd12.prod.outlook.com ([fe80::14fc:9732:15e8:1106]) by DM4PR12MB5341.namprd12.prod.outlook.com ([fe80::14fc:9732:15e8:1106%4]) with mapi id 15.20.5017.026; Sun, 27 Feb 2022 12:38:09 +0000 From: Idan Hackmon To: "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: AQHYKJ+sObkDph4hP0S7m4/OP6uUN6yg8hIAgAZoBtCAAAFb4A== Date: Sun, 27 Feb 2022 12:38:09 +0000 Message-ID: References: <20220223093205.4240-1-adham@nvidia.com> <20220223093205.4240-2-adham@nvidia.com> In-Reply-To: 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: 288e7a67-989d-44b9-d730-08d9f9ee0312 x-ms-traffictypediagnostic: BY5PR12MB4195: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: CaV/3TRWJBgvI6SzZhSwjMTG9T5i/x37gYhfRo5bEgtC0YpEZC9Tk+849YPO9Mb+5YCIgdBhJU1Mux0Qjj77409FeF7YiRVO9j+XBpqt89zyXOLvXHeTiHqAuB1WxXFndMr03bDgGL1/d5rTH9Ms/prpUz//5VHMhemv/CFqY/aJAY4EJYD2tlSIYZ4hFbzMOMxLpW6tyHRjp8IRRJMwb59crGW0BZboXU24Gd5/aWR4CE7mK3jpCn8fFinjcODPWmL5e+i/i6WcHHwAG7A/3jwb6IC3A/fOzTZp+3m17AGVTyIaklzhQ4BuZ5+AeHJVE/9q5grsUS3gz3jMxoXLRJcMDbPm692iIAVlTMxdODPH+2+0uQY+PJ8g0K8fRO7LahRFdDJRQ/H2H76NGRzqzu5NvdvuL6UP3oWIpu4Rksbn2GkRozNPkbvTZkWh9JtnsipoAPmCuP627SfFEauiOySgvkhAsFP+NWc0tuc+ziFU8CReZHsF9FbJI+xNdayxlqJ9Mk5ytF1X/qbeYhqnWzR5IbbpvfYXjz0b//r74hSz/i3IpvJwFwWY33npUgbjGSAI/MelJrT58jbiRSCa/3eHnpmBN5Z1PU1Jfk7JLYL3RRaBbZRLhop3AggfxLSPPOyTctbk+l78EG15anacIqubEOi1m94Oic9QV+2ezEb6sDWL4zEDTlxi6ugwLmARp62soHbWuRSWl7pU4oXBYA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5341.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(83380400001)(76116006)(38070700005)(4326008)(71200400001)(8676002)(64756008)(66556008)(66946007)(5660300002)(66476007)(66446008)(52536014)(316002)(6916009)(54906003)(86362001)(8936002)(2906002)(186003)(26005)(6506007)(33656002)(7696005)(55016003)(508600001)(122000001)(53546011)(38100700002)(9686003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vNRtreINN6UmIWDfMFqjOfarGPXtpmIIB+jTNyTKrxsU5Ybs5uEHnb38WMny?= =?us-ascii?Q?vh7aU50BrTvgWdknPKSHqf4/Vx5Xsk1qy7bPB7PbEWEu4pc7SmMWYcUix/hx?= =?us-ascii?Q?iPsMlb67zWVwOiRXZ/Bg9GqiqNTvupCalHIcJ5+fn3ThH1OyqyaRZb6LXbA+?= =?us-ascii?Q?oc4Wis4SiaSH0fjyZQrZ78VlLAQZGR5VWv1z+KvdFQ+ttspKBwa4LNth4uaw?= =?us-ascii?Q?ARiHbeo46m9KN9RSsmmIEcRLQ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K?= =?us-ascii?Q?0wTdxe5DpsnARCuLKfGdWXxO0hPPMCDd1bYKucFwNwjFOxR5SXeYhMW84Jbz?= =?us-ascii?Q?H52nQkekidcHKmyyWJzAgdw76G6u89Ka+k8lWI6PZr8FFuY5bKV2zTMj0sYa?= =?us-ascii?Q?Z0lz02/DNMqy5m5RfXiBuddFxtTLdPy3gir+FFa6rbRGQ2HzIYHqBYaSv/hO?= =?us-ascii?Q?MXPI+x7cKS3vD4Z7ImGjjFjQVqB6Iqslb0z4JjP9dgs+rvTGiasROsqpsszs?= =?us-ascii?Q?TB165lnaTqY6NyDlyswRyDhdSdpMJqKP/pQGmA4SyFFT4ob53JRM8X67GMNF?= =?us-ascii?Q?+Z3ZVdBV0sLNtcMayCeOCC5zgDvQaP+lM54nt84NF6VXzhRASSXifyUj29ct?= =?us-ascii?Q?X0CPwMcKquXEWblAtlX2ZzfBpONVWKkcbJNGPfXSYAUW7mslAzyjEbClqvqS?= =?us-ascii?Q?j6TBhwTwKPe3FiQ3V5BO9gyHKp1KF/bEFBYWOsjOLmWS9+HAxwgeNDa+/0jM?= =?us-ascii?Q?hRp4RG/WSXaabUegMnk3w6k=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: DM4PR12MB5341.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 288e7a67-989d-44b9-d730-08d9f9ee0312 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2022 12:38:09.7172 (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: qt48jTTlDKUkiiYBB3g0BkRNW8yg4WapHh0rJNX6dPcXleSuVLKoVmQqfFFb/dK9Cex3nFBqVEWvk+wRaYAw7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4195 X-Mailman-Approved-At: Mon, 28 Feb 2022 17:01:19 +0100 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 > -----Original Message----- > From: Adham Masarwah > Sent: Sunday, February 27, 2022 2:33 PM > To: Idan Hackmon > Subject: RE: [PATCH] net/mlx5: fix destroying empty matchers list >=20 > > Subject: [PATCH] net/mlx5: fix destroying empty matchers list > > > > The table remove callback function is trying to destroy the matchers > > list associated with table entries without checking if the list is > > valid, which causes nullptr dereference. > > Fixed by validating the matchers list before destroying it. > > > > Issue can be reproduced with testpmd on Windows, when you run: > > port close all > > > > Fixes: 1872635570be ("net/mlx5: make matcher list thread safe") > > Cc: stable@dpdk.org > > > > Signed-off-by: Adham Masarwah > > Acked-by: Viacheslav Ovsiienko > > --- > > drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > 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); } > > > > -- > > 2.16.1.windows.4 >=20 > Acked-by: Tal Shnaiderman Tested-by: Idan Hackmon