Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1276292rdb; Wed, 6 Dec 2023 13:53:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFasgbJ27kyUe3w6+BEHCkvb6VK9dp8t4XHhEOju0ojQOeMDCU12jY/3Om+7DytxXzPmSk0 X-Received: by 2002:aa7:998e:0:b0:6ce:2731:5f68 with SMTP id k14-20020aa7998e000000b006ce27315f68mr1208015pfh.39.1701899600036; Wed, 06 Dec 2023 13:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701899600; cv=none; d=google.com; s=arc-20160816; b=hhGMY9ARDaOnE9XunMITxWJJyUP+oCqBTxsnMjVT5N9hxuO89He8Sr624Lxr1qYHx+ bVThjMUYV1gHvopfJQzZPigx+x+vVereTrhcwTcIiW8ebUHpLjYplcNU8xmKpnLdTomq HgA7oNNqCWumARXZTyh5xPpdq2a7Ku3t4+cWm3dVKuylKz0DUYUEzIfnP05IYY7rssKi gjNi9bXPazdHuNUncbBLGjvEnfzQDMK/A4o83dZraSKMUdP+p7vGOBINfdP+yMcGQR6C 4KiDLF8ephRQCiqN7sVT0B4GYDjS3hlR/4mzkl3a7qGYONCXPMiopz8nbeVbdtdEg6pz qpXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9wE7t5kK/YCsuLwHfAgKzLt+nO/2533i+EX2OMKT0XQ=; fh=kzdnsgiuR9GTlpPKTs/fthRcRsN5Uwtu6i9S0cuMPBo=; b=zZTs6JBeWhJdjbbeIvN9gJnlC5zRWuCB2v5OxfwIuWaKOXKcJJ5SMldLCOSScwen2x TYJAYuMaYUvYGRyXeqX+LrSMEyJ8zFLz3h0mg7XaO40v9QBrKbZ0esmc75Eddq2XmDAT d60uIbzhtym1kwPEUB8OSC41ZL6bweCC5tVKkFb5klyktGhwXvrcnW/ScaC/9Dz1cfzp netjeHVeZWyyraHMibCbIILYT35F6CzuSJ1M0ncqwFQkz5OizDGu6ZsA111r7v3perme JfLEeUK+sT8311j0BlUvIrIDixy86pJO9CuoX9/e61EijiM3OV5FIhqdaSWxBvGlQn/6 4O5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T1xKEUQ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id cf5-20020a056a02084500b005bd70a177a3si483925pgb.876.2023.12.06.13.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 13:53:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T1xKEUQ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7A18A81EE501; Wed, 6 Dec 2023 13:53:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377289AbjLFVxE (ORCPT + 99 others); Wed, 6 Dec 2023 16:53:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377371AbjLFVxB (ORCPT ); Wed, 6 Dec 2023 16:53:01 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7A1BD5C for ; Wed, 6 Dec 2023 13:53:07 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DB8DC433C8; Wed, 6 Dec 2023 21:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701899587; bh=9wE7t5kK/YCsuLwHfAgKzLt+nO/2533i+EX2OMKT0XQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T1xKEUQ75etOxiDE0K3MohK/zhxSqmqsUrV3Dwgc8LfrQeERy3Cm02LZfoG4g+ebY PeMhkdMKpA4FsfLJCz5AQUNPVg5ZNJJSrhrWm+k7ddCfKQzUXpUO61KwkIEi5TSfLQ tISTkTdSHSHrQOFBjLAAAfUQhK7zSThcgsLour0dyf3R5ze7ItyEMRC1XsTC17LvTH uHWpaWMWCbCmBg3bKlTOPvSLIwiQ7yDMDH2QQZSHrFY6JM2hsHJHJ5cU5hv0c7Ktop bxXpBNN/PAlDLBODscJApIJlWC6jJgP38azdgXp+nD1vi5JJZ5xNtCqSmkMr8otBVf qkp1X8G2hc+TQ== Date: Wed, 6 Dec 2023 13:53:06 -0800 From: Saeed Mahameed To: Dinghao Liu Cc: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Zhengchao Shao , Simon Horman , Rahul Rameshbabu , Aya Levin , Tariq Toukan , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v2] net/mlx5e: fix a potential double-free in fs_udp_create_groups Message-ID: References: <20231128094055.5561-1-dinghao.liu@zju.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20231128094055.5561-1-dinghao.liu@zju.edu.cn> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 06 Dec 2023 13:53:16 -0800 (PST) On 28 Nov 17:40, Dinghao Liu wrote: >When kcalloc() for ft->g succeeds but kvzalloc() for in fails, >fs_udp_create_groups() will free ft->g. However, its caller >fs_udp_create_table() will free ft->g again through calling >mlx5e_destroy_flow_table(), which will lead to a double-free. >Fix this by setting ft->g to NULL in fs_udp_create_groups(). > >Fixes: 1c80bd684388 ("net/mlx5e: Introduce Flow Steering UDP API") >Signed-off-by: Dinghao Liu >--- > >Changelog: > >v2: Setting ft->g to NULL instead of removing the kfree(). >--- Applied to net-mlx5. - Saeed