From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D1B4C4167B for ; Wed, 6 Dec 2023 21:53:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377419AbjLFVxF (ORCPT ); Wed, 6 Dec 2023 16:53:05 -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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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