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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD5CFC5478C for ; Mon, 4 Mar 2024 15:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ceknZDVTW5FNJCC2HGIUjb8F0C4zISRjBNQV15ZxQss=; b=q4XB7gopjTC/dM VPfv0apZR9W+WJ6V1H4tQIv+dpranuivGhYkJ7B0m61M/aWd1AVqTHY8KCsj+XdBF5Yt7kAXHAERk RfumGZNyu0HWGbkbxvY8vKVfE2ssgbwPnPwOG8ApXsCUeNqDXI9Uxu6u+5yxToa2ujUgIvBTvAigi rZ3j2eMQNhBY8up1p+Pks9+mQ7SJfYFVJfAtW9G5WIXzgFgATUU2Dkh/Fw9ADZyumWo+RDZxIq0cP k88tg6amhs2F43xs236s3DYdstkwKXWpDZIRGdWefkPcid1+ziKOmc+TawCAPlPIrzb1iZpuP+vLN HzzN9GK4k8OmqNS+/nHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhAaG-00000009hCR-1ugH; Mon, 04 Mar 2024 15:50:32 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhAaD-00000009hAB-2WWU for linux-arm-kernel@lists.infradead.org; Mon, 04 Mar 2024 15:50:31 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 77893CE13B4; Mon, 4 Mar 2024 15:50:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 298F4C43399; Mon, 4 Mar 2024 15:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709567426; bh=wlqZ5WQ/dxPPrl/h6+AO78c+TduyB6DGNUpNUGSxus4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TRimCEW3/+jtrrcSRbPpUgzRs23Q/HCsO9K743eBCPPMqCY16lgirDsgWlLchG2Ja U0mTVIdEGAhgT0RuiuXuLMNVrYEXfNdOz2i7nNWdMHfMjCD1nHAydEPgnYmDa8fp0m p5nn20vVXKDousRjRGoWMuq9ef/3xOsWtp1MKQM+DId3wpCZlFWfUM27DUq/UZa+KZ Q5TQtpmo0paqGfwb0ToljnuKIMtxVUOcUiZYPc12pwn4h+/S+soN24u0O+U9k8/3Zr D8d3XNi01fWK9PaUnBFj2FyfNbGOp7pBxpW4rzf9e4+AOWGSlw17GQSQlqeJfr6Su4 dDSfzX9QsJuHA== Date: Mon, 4 Mar 2024 15:50:21 +0000 From: Simon Horman To: Horatiu Vultur Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, lars.povlsen@microchip.com, Steen.Hegelund@microchip.com, daniel.machon@microchip.com, UNGLinuxDriver@microchip.com, bjarni.jonasson@microchip.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: sparx5: Fix use after free inside sparx5_del_mact_entry Message-ID: <20240304155021.GH403078@kernel.org> References: <20240301080608.3053468-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240301080608.3053468-1-horatiu.vultur@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_075029_977775_C20ECABE X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 01, 2024 at 09:06:08AM +0100, Horatiu Vultur wrote: > Based on the static analyzis of the code it looks like when an entry > from the MAC table was removed, the entry was still used after being > freed. More precise the vid of the mac_entry was used after calling > devm_kfree on the mac_entry. > The fix consists in first using the vid of the mac_entry to delete the > entry from the HW and after that to free it. > > Fixes: b37a1bae742f ("net: sparx5: add mactable support") > Signed-off-by: Horatiu Vultur Reviewed-by: Simon Horman _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel