Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp395093lqb; Tue, 4 Jun 2024 15:00:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/++Gb2RpGkWsO+bjXeDLLBsZjMhWDAikxZsWK/lRbfXCuq+zzYtmZOjQUde0m/4/VfcVR0izOmywifOwcFNKcdADzQDurEVS+CO3Gtg== X-Google-Smtp-Source: AGHT+IHO+5Yxv6R3ij735+3LyW5GPA8+VzqBteB7oCKeWMgjwwMQM60llNpGawfcAhLKBQ+ClG6Z X-Received: by 2002:a05:6359:5f86:b0:199:30ee:6fe2 with SMTP id e5c5f4694b2df-19c6c7b1653mr84580455d.18.1717538415413; Tue, 04 Jun 2024 15:00:15 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6da0b90eb3bsi32526a12.647.2024.06.04.15.00.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 15:00:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D7vhzEGq; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-201429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8F262B22365 for ; Tue, 4 Jun 2024 21:58:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0C1514D297; Tue, 4 Jun 2024 21:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="D7vhzEGq" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A752684E1C; Tue, 4 Jun 2024 21:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.11 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717538313; cv=fail; b=i9470JdIIWSozgPvIhwkr23RT2EZ6NQpixPTXGPsa86dyhQxeZ7IWDXVsYpj7EyrjAfGRAKOVP+k5qFf6Nk1x7IgS4bjXCPcs4daFQI0EBPhER/exMpqR7UbejCc+tuUcSThXvf9e05aY0f5tAB82oakoAjpRv4sWwXdEdJId/4= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717538313; c=relaxed/simple; bh=x6RrwsvIac3rkk/YPkqikUzodMLLymQlh/yMocwd4tg=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=rDkY7SGH+4J9vyDJfTF2j5fxM+JYGhlhlia/dTYLXLVwkyNrE/xFgwFFqEq6TIUSlalKuEpTetP7QoSwVkt4HeyPRXAbec9RoWWcSgmztmjpDByL008ICD8bnLOS22/9wJbS6hf9U0h6a3N/skhFEFCZNSjmeeZ/y5LnIJqmx1M= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=D7vhzEGq; arc=fail smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717538312; x=1749074312; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=x6RrwsvIac3rkk/YPkqikUzodMLLymQlh/yMocwd4tg=; b=D7vhzEGq/4acKpXs56Irdnh8qqwfWKceOc4yxJFFtCBYWtp0H7xyf+Lm Tidry8IWeZLRACF6jSscFEySB/jq2u+/+gIZc8H7/4Yrq4h1lQDcxmcGR JhiDPtCe4WXy2aNOge95zpQFZkaKKDGM/3eTo1bmJqWBrYZsxLRAZSiOS kF9mF5kTE2gCZE1hTEJTWnMNpY/3S14zMxBeVXoTr7XX3pUrSPzI+gcYu +XqfBzTnj1gR7yvIAL4H6L8NAkr/dqLcoTZx6XYBgRJiEzaqCzY/gYrtH af2FDEhztpuGo8LKrB4dyhlfuoJLz7Ngu8ZbR3lZ7XmkNVXegl/aKeGET g==; X-CSE-ConnectionGUID: ZXgr8YZbTH+IvutnuMB3xQ== X-CSE-MsgGUID: OGdObCEoRFaRlzIDatOjRg== X-IronPort-AV: E=McAfee;i="6600,9927,11093"; a="24746654" X-IronPort-AV: E=Sophos;i="6.08,214,1712646000"; d="scan'208";a="24746654" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2024 14:58:30 -0700 X-CSE-ConnectionGUID: aYOU2iI6RpqYtUkjYBSusQ== X-CSE-MsgGUID: zHkXj69sR/uN/rL1VShiMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,214,1712646000"; d="scan'208";a="37499685" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Jun 2024 14:58:30 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 4 Jun 2024 14:58:29 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 4 Jun 2024 14:58:29 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 4 Jun 2024 14:58:29 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.40) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 4 Jun 2024 14:58:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C2Jrd3yJVy20qWDvxgNFYZQDcXezWixTytX7abfIDa0xLiRaBfIzesnG3/eEaNUAh0/McDEZPw8zhePGw+iQSCGSmyS8glDPNtV5r3A/7aCjFPgYAemBPuheypvD5fk23L+8db3Bs21MH3ri3QoWTWWIwlcZ5F2hvI0oqU1gbrN2at+Jz9PAxPAmR/0IBMkGra1EVjfS8RCRdX5Y6lDxUR4E32wr6HeEFws2xQd98mVncZ50AoATR7Pgpmb1Wdrd2I0Zw4C22CWihX4vXd/U+NYpU7uPuFaaK97IGVNomj4esMKsRDqc44Wg3VCXKIxLWQw7glb8MuWNrR+aL4i0yQ== 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=zxh2V/6R0w9lGIzo351dNDuz/cvTeshpd8gduq8CyrQ=; b=FCjARvGHVaM7NXtcjHP7zHfbsdTB2NzCCmFuRNUfNDyUq+fj8VtKoEqkzb1WSsLlIds5/GiVHIFngWCkE8upzNrWp4nWeOLVFtgzy60oFyeI2uLEqRkH1ohYdn4bFXShzgJkvaJ6EoDQL/BXcpt5ftmqi6aQE8HIBlTFUN58ptv+YW8RtCFd2pdGE8MMQ6eOE3ijkmAGe6l578HoFwmGJse8ndmxPxoarC3oElsr02q+2sDV8cCAZaUjNYpfCUZATaOlJI3fw7l2bMsYXXuCM7lwg5sXluejb+1qCRGmP2RRoZ/ga/dzIzODRaLcp4QG4BVprWTfrQGwT/5rFyqtgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB5089.namprd11.prod.outlook.com (2603:10b6:303:9b::16) by CY8PR11MB6819.namprd11.prod.outlook.com (2603:10b6:930:61::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 21:58:25 +0000 Received: from CO1PR11MB5089.namprd11.prod.outlook.com ([fe80::7de8:e1b1:a3b:b8a8]) by CO1PR11MB5089.namprd11.prod.outlook.com ([fe80::7de8:e1b1:a3b:b8a8%3]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 21:58:25 +0000 Message-ID: <2b09c707-208c-43ea-870a-1c637ca8ed53@intel.com> Date: Tue, 4 Jun 2024 14:58:22 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] net/mlx5: Fix tainted pointer delete is case of flow rules creation fail To: Aleksandr Mishin , Mark Bloch CC: Saeed Mahameed , Leon Romanovsky , Tariq Toukan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , Maor Gottlieb , Shay Drory , Jianbo Liu , Jinjie Ruan , , , , References: <20240604100552.25201-1-amishin@t-argos.ru> Content-Language: en-US From: Jacob Keller In-Reply-To: <20240604100552.25201-1-amishin@t-argos.ru> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR04CA0288.namprd04.prod.outlook.com (2603:10b6:303:89::23) To CO1PR11MB5089.namprd11.prod.outlook.com (2603:10b6:303:9b::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB5089:EE_|CY8PR11MB6819:EE_ X-MS-Office365-Filtering-Correlation-Id: 41bfea1c-c5a7-4379-2af4-08dc84e17575 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|366007|376005|7416005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?c3Vla1EwY2E5VytZb0dNUmh5U3RWRE8xYTdMNEd0bGRneXY5ZDh3T0M4dFlw?= =?utf-8?B?dHNPNkFYSXNUbEhGUjN6eEFRNit1NVBGQ2dvcmJnMjRjK052OEw2QkZBNmhj?= =?utf-8?B?Q3VIQVQ3TExqdzdsc1MydEtyeTdJTVVZdEFIdTdpWHhZaU9aK3dhVVZXaXJ3?= =?utf-8?B?ellFR1F2S1lqZmFXTDZi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NW9WeWVuazNnemd5cHFBLzRrc1U4TVgwVEYxSkxFV1pMWU8wenpYK0Jqdzk2?= =?utf-8?B?dkkxWm00dWF5dlFCT2s1dHhmNk1XUXYzdmYza0xnemFyT1pGN3dvR2l1enBQ?= =?utf-8?B?SnVRa0xmR250UmRsNDRPL1gwbnBIL2N3VjR6WFpBTTJPWDhUMFZvck9NcGNh?= =?utf-8?B?WnR1VS9pWXRBM1JhZWpwWStkYW8wUXZ2RU1YU1BqSGdTVmI2L2QxOGJ2S3A1?= =?utf-8?B?cWpjS0ltQktLV3BDV1ltM01uSlZ2dmtsY2FiV2Q5bEpZUUlHbVR2UklEMmVz?= =?utf-8?B?MGtwM3pTc2dYS1JjbnZXUVNHN2ExT2w3UjdNbTVPT0I1blNNODg2NndDN0No?= =?utf-8?B?ODVJRVBxZlRaNFp5c1dSbVNMcXRlM2EvcXMyMmRHUXMvWCtHSkZpeGh0c3VW?= =?utf-8?B?U0JVcGhoSGJ3VGo5VWpMWjBpa2dKZDRXYWR0TkloY1hoVjU4RTI3bHQvTnlD?= =?utf-8?B?dStKTDdtcCtsa2NNVHc1VTloR1Q5dnpOcXp3aTRnRmFnKzA5K3FaWVBjMnZl?= =?utf-8?B?K3pob2lkeDdJbXpRYnRuUklMczNLUVZwd0p2ZUhqRVZORUpyS29PUGh4dFk3?= =?utf-8?B?dW9tZU1JRXdMc1MxSnk1TVVOMWp2SnRCVUNDRGZ2TkNrYlZYQm9lOTNRPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB5089.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005)(7416005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eUtLaEJSVXFNaUdRUkppZE5MS2RPT25icERTYVh2ajA4ZzFLdHprR2ZW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ZadXlmQUNhTDdjQVR6MDZVdGpKak01NUx2d3pheURJVGRraWJGdXZqUldR?= =?utf-8?B?eVJET29ZSmhtNFlDaGZpOCt0MWo5QkFTajd0TUtYaDFScTV5Z2FvajNqZVZL?= =?utf-8?B?NDljcytYeE5mc0U2V0R4WXZvZ1V6TFg1T3RrN0R3SHNUNjNJSTJzS3h4WlNm?= =?utf-8?B?OVZhY3NJVzJDbTF0VW9OaGhQS3dWekRMK0N0S0o2ZXh6bzVFYWtkTVlrVmFp?= =?utf-8?B?ZnFLa3ZQNzZtQWtNTkxXTDVnZ1l3eEMra251eGphdEZvYS8wYURwSzBqQ0xV?= =?utf-8?B?MTA5ZmlZYnc2cEFnQU5jclpxR3hxRHlzUlJnbVF2byt0bzFUS2ZzalNKbEFM?= =?utf-8?B?WXc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 41bfea1c-c5a7-4379-2af4-08dc84e17575 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5089.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 21:58:25.3731 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RBj4vpKIew8BVbbP4ZYF6dCL6zKyvPxPNdsry7wcocwt5WjtSnLsNFeUwpBAPRQmr9MHk9KErnjONWKYkOeCg3QvCQ2IPCPmu5l7ribs//I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6819 X-OriginatorOrg: intel.com On 6/4/2024 3:05 AM, Aleksandr Mishin wrote: > In case of flow rule creation fail in mlx5_lag_create_port_sel_table(), > instead of previously created rules, the tainted pointer is deleted > deveral times. > Fix this bug by using correct flow rules pointers. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 352899f384d4 ("net/mlx5: Lag, use buckets in hash mode") > Signed-off-by: Aleksandr Mishin > --- > drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c > index c16b462ddedf..ab2717012b79 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c > @@ -88,9 +88,13 @@ static int mlx5_lag_create_port_sel_table(struct mlx5_lag *ldev, > &dest, 1); > if (IS_ERR(lag_definer->rules[idx])) { > err = PTR_ERR(lag_definer->rules[idx]); > - while (i--) > - while (j--) > + do { > + while (j--) { > + idx = i * ldev->buckets + j; > mlx5_del_flow_rules(lag_definer->rules[idx]); > + } > + j = ldev->buckets; > + } while (i--); So, before the code was: while (i--) while (j--) mlx5_del_flow_rules(lag_definer->rules[idx]); That just calls mlx5_del_flow_rules a bunch of times but keeps using the wrong index, which is obviously wrong. The new fix is to calculate the index properly (hence the switch to a do { } while (0) loop, so that we properly delete all of the older rules rather than calling mlx5_del_flow_rules multiple times on the wrong index. Makes sense. Reviewed-by: Jacob Keller > goto destroy_fg; > } > }