From nobody Wed Oct 1 22:37:32 2025 Received: from mail-108-mta204.mxroute.com (mail-108-mta204.mxroute.com [136.175.108.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0A1C27E1C6 for ; Tue, 30 Sep 2025 06:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.204 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759213094; cv=none; b=eLIATdEFntTOgJY+FWkbMEmkPZUn5vLn+SawNrE+bMPyVbioahylVQ+5tBwxq8hHwzOtB31YrzZjcBlm0u7BvyeHLHzOPseB1VEXryMaFpgGVyLT1eUkHzhrhmFkuC5zVdJ3p+TATF1X4B63hK16AWU+NKBPmEtExSl9mvy4xMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759213094; c=relaxed/simple; bh=dpICyBHPRCxjWmSuVtCtTn1alIoifSzTBEBrRAcu3fs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BN/6DkQlNfoK4i/T38V2DUtUxjRauLb95qNzaU/dkOFSrtQIzTu3o8YSEIM7Ch4xBvNmc+EXY9kC02vq2Yi0W281dgoKkKinZGMCa6RuUeWXFZQx8EnkbNewP+ezQTVrjI5nBriG2psvvGZOU1hGPOkLl35k/rvDOzCZPuqCHmc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mboxify.com; spf=pass smtp.mailfrom=mboxify.com; dkim=pass (2048-bit key) header.d=mboxify.com header.i=@mboxify.com header.b=pXV1Q2o8; arc=none smtp.client-ip=136.175.108.204 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mboxify.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mboxify.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mboxify.com header.i=@mboxify.com header.b="pXV1Q2o8" Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta204.mxroute.com (ZoneMTA) with ESMTPSA id 1999940c127000c244.00d for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 30 Sep 2025 06:13:01 +0000 X-Zone-Loop: 9a0c91361cd6efa7cc5eccf9011ac296f79cb8e8fb72 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mboxify.com ; s=x; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=DnyW1ICbNiJMwuErPJysjSsC9vAQzV1lxyrmXFHhQ8I=; b=pXV1Q2o88gqzMHoNTP5l9CrNU6 vEMEywhZmTVBaccy86Adc3rmsDfQmURCy2z4NlCSonMp7JwtSf47SQbYeJej7r6xeyCOWm2zrW+hT +d7xo/DJPsvtnrG/BUfAtiCvcZy1ABnTpPLv1ANy17xAAA7GipH+TxcMq+updDxgQrnYN6ZmFiiCp GOJ9g8BSroInmdoScFl/6+X1Kv+vaoB8l9c3Q4Ic5LJeT10cVcHclK+PpzZuYkQbylPhSoikP3MvG 2kjQOfZAMUxIjCoil4rVJfsk7UfPJTrGo15fp2y6na+JKIa1PU50V6/Q0lyNLiQ/YPXiGph21yD1l XvmouwqQ==; From: Bo Sun To: sgoutham@marvell.com, gakula@marvell.com, kuba@kernel.org, pabeni@redhat.com Cc: sbhatta@marvell.com, hkelam@marvell.com, horms@kernel.org, bbhushan2@marvell.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, sumang@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bo Sun , stable@vger.kernel.org Subject: [PATCH net v2 1/2] octeontx2-vf: fix bitmap leak Date: Tue, 30 Sep 2025 14:12:35 +0800 Message-ID: <20250930061236.31359-2-bo@mboxify.com> In-Reply-To: <20250930061236.31359-1-bo@mboxify.com> References: <20250930061236.31359-1-bo@mboxify.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Id: bo@mboxify.com Content-Type: text/plain; charset="utf-8" The bitmap allocated with bitmap_zalloc() in otx2vf_probe() was not released in otx2vf_remove(). Unbinding and rebinding the driver therefore triggers a kmemleak warning: unreferenced object (size 8): backtrace: bitmap_zalloc otx2vf_probe Call bitmap_free() in the remove path to fix the leak. Fixes: efabce290151 ("octeontx2-pf: AF_XDP zero copy receive support") Cc: stable@vger.kernel.org Signed-off-by: Bo Sun --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers= /net/ethernet/marvell/octeontx2/nic/otx2_vf.c index 7ebb6e656884..25381f079b97 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c @@ -854,6 +854,7 @@ static void otx2vf_remove(struct pci_dev *pdev) qmem_free(vf->dev, vf->dync_lmt); otx2vf_vfaf_mbox_destroy(vf); pci_free_irq_vectors(vf->pdev); + bitmap_free(vf->af_xdp_zc_qidx); pci_set_drvdata(pdev, NULL); free_netdev(netdev); } --=20 2.50.1 (Apple Git-155) From nobody Wed Oct 1 22:37:32 2025 Received: from mail-108-mta206.mxroute.com (mail-108-mta206.mxroute.com [136.175.108.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2177A28EA72 for ; Tue, 30 Sep 2025 06:18:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.206 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759213105; cv=none; b=oEAMboifBq2nS2cYSTb2UNLPGEVnSuLW9KQnRcPV+QZo52s5cRfvdsFIl/RLh7jo60ylLhDXFauau2qOAkv/hBXkTwUz3H4ZuvAIB728/6VK6moEuctC0pMTXaYKjLTA17VI9L0LDazpDR24xwLHAAuDiRv0Y6ZWrBtKuN+MrXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759213105; c=relaxed/simple; bh=iTIyUmMwogLjx6J4uwkS7qq4zRHdgk+CzEH6UASouPQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=obant9PsBtHv0CoEGFqivyYY6/Aom/G+cnMKU9vmo0EUThk5bc4oJ0rzIUfY2WshmqzJadN0JSLPW6Q/aWu9kmSOsIQba10hjbURbeTkwtRRio1L9QjNUltAKdVXUqRqtMO/2GvuaoluztB+QC5xuwRGGThtyf2+h4XCAcufUS0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mboxify.com; spf=pass smtp.mailfrom=mboxify.com; dkim=pass (2048-bit key) header.d=mboxify.com header.i=@mboxify.com header.b=RiEAj8n1; arc=none smtp.client-ip=136.175.108.206 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mboxify.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mboxify.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mboxify.com header.i=@mboxify.com header.b="RiEAj8n1" Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta206.mxroute.com (ZoneMTA) with ESMTPSA id 1999940e3ea000c244.00d for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 30 Sep 2025 06:13:10 +0000 X-Zone-Loop: 09bf7451b73af5fb3dd26d0220f6fc9efdfe4ef6d751 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mboxify.com ; s=x; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XE4oTWPSDq1xZF1cjbUhrR4nwFe0BvbSHj5iVns/uvg=; b=RiEAj8n1yc5j7h6W3MR5smM7Ug jix76IubG7NWB+ocwsyH5SL3KoRAA0wlK0JVAYJ0zBVzRWchhbynVaYFhGErvQN53ybtAlqRtfnGV 84xT5OWYAyHSVw7qDSJbYkVkpbw6YkrCjXFkMMnS4h6r7YgG/WBc6Hca+0eViNnxTJW2gTlzGiXsC 6LMYIxJSPGsfMmyfElWesBqfttfob4Q8069RGe3ojNicbjZjScvEyPmKwbvAp9zClxSRr3pmGYwlS g8yNJn8IrUcAVthekmSJSs7JPnIJbB4mZ/PmWDJQT+G4T7hSsKP+HIY4Nussi45nnMqpnq/Ylt4dd qN933lSg==; From: Bo Sun To: sgoutham@marvell.com, gakula@marvell.com, kuba@kernel.org, pabeni@redhat.com Cc: sbhatta@marvell.com, hkelam@marvell.com, horms@kernel.org, bbhushan2@marvell.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, sumang@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bo Sun , stable@vger.kernel.org Subject: [PATCH net v2 2/2] octeontx2-pf: fix bitmap leak Date: Tue, 30 Sep 2025 14:12:36 +0800 Message-ID: <20250930061236.31359-3-bo@mboxify.com> In-Reply-To: <20250930061236.31359-1-bo@mboxify.com> References: <20250930061236.31359-1-bo@mboxify.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Id: bo@mboxify.com Content-Type: text/plain; charset="utf-8" The bitmap allocated with bitmap_zalloc() in otx2_probe() was not released in otx2_remove(). Unbinding and rebinding the driver therefore triggers a kmemleak warning: unreferenced object (size 8): backtrace: bitmap_zalloc otx2_probe Call bitmap_free() in the remove path to fix the leak. Fixes: efabce290151 ("octeontx2-pf: AF_XDP zero copy receive support") Cc: stable@vger.kernel.org Signed-off-by: Bo Sun --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers= /net/ethernet/marvell/octeontx2/nic/otx2_pf.c index 5027fae0aa77..e808995703cf 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -3542,6 +3542,7 @@ static void otx2_remove(struct pci_dev *pdev) otx2_disable_mbox_intr(pf); otx2_pfaf_mbox_destroy(pf); pci_free_irq_vectors(pf->pdev); + bitmap_free(pf->af_xdp_zc_qidx); pci_set_drvdata(pdev, NULL); free_netdev(netdev); } --=20 2.50.1 (Apple Git-155)