From nobody Wed Dec 17 17:29:09 2025 Received: from mx4.wp.pl (mx4.wp.pl [212.77.101.12]) (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 1CD3F14BFB4 for ; Mon, 8 Jul 2024 20:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.77.101.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720472321; cv=none; b=gkK5E++bhAjIUubeJCUT0reX/9/+yr86nAHac4laxJACz5bdju/9aHmwrKULbg1Ph+GpAVgyJPJBFN5GZMkeqq0I/wRIkDQBKTf5yf+vXcHJHD2BAYS1kCG7rS4b5sZYO3AlDKCURR4FzraxAsY1O2Svip7oqmnBc/fCoxn6LQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720472321; c=relaxed/simple; bh=2rlB6Ojmu/l2PeRGxUrHBKpnhbN+d/Ky2sKmjrKGSmc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=IvjM2/jRK7mTaLYHOOzTCE7uWBXLTTHA50MYai0s688hgUPkYn8K/ss49LZ8xE3u0TzzxVk6v/da09NG3hKvPwvvsAsdN81PELtTJZZSwVuCCkvpT+WPGRr+Rfuc7bV5xOFB/wB036YQi5680HyTKHTogP4qSiGT7fSFm41pTFI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl; spf=pass smtp.mailfrom=wp.pl; dkim=pass (1024-bit key) header.d=wp.pl header.i=@wp.pl header.b=WDLABT2r; arc=none smtp.client-ip=212.77.101.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wp.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wp.pl header.i=@wp.pl header.b="WDLABT2r" Received: (wp-smtpd smtp.wp.pl 12442 invoked from network); 8 Jul 2024 22:58:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1720472308; bh=8NPN9/UQ4HRsQkyCMpM5BM9NHCb9hWs4MwzCmNnUzXg=; h=From:To:Cc:Subject; b=WDLABT2r6r44jOMC8rcdJ/CZ0CtNva2y/qOZZm0PJXGsK+VEDrP6pbRvuB0xSLqFp jkoPcz26t5LwfBnyIAOGlhHwwwcEvS9F0SctnVcLGDM5o9/oio+0NnRXN3wzLvWuht yxlOY69+WObM0m0qnh9IxajosJMziFd0Fe86iRr0= Received: from 83.5.170.55.ipv4.supernova.orange.pl (HELO laptop-olek.lan) (olek2@wp.pl@[83.5.170.55]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 8 Jul 2024 22:58:28 +0200 From: Aleksander Jan Bajkowski To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, jacob.e.keller@intel.com, shannon.nelson@amd.com, horms@kernel.org, sd@queasysnail.net, olek2@wp.pl, u.kleine-koenig@pengutronix.de, ralf@linux-mips.org, ralph.hempel@lantiq.com, john@phrozen.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joe Perches , Andrew Lunn Subject: [PATCH net v3] net: ethernet: lantiq_etop: fix double free in detach Date: Mon, 8 Jul 2024 22:58:26 +0200 Message-Id: <20240708205826.5176-1-olek2@wp.pl> X-Mailer: git-send-email 2.39.2 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-WP-MailID: 88c14d6ea541429c80222df60077a39f X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 000000B [sUO0] Content-Type: text/plain; charset="utf-8" The number of the currently released descriptor is never incremented which results in the same skb being released multiple times. Fixes: 504d4721ee8e ("MIPS: Lantiq: Add ethernet driver") Reported-by: Joe Perches Closes: https://lore.kernel.org/all/fc1bf93d92bb5b2f99c6c62745507cc22f3a7b2= d.camel@perches.com/ Signed-off-by: Aleksander Jan Bajkowski Reviewed-by: Andrew Lunn --- drivers/net/ethernet/lantiq_etop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 5352fee62d2b..0b9982804370 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -217,9 +217,9 @@ ltq_etop_free_channel(struct net_device *dev, struct lt= q_etop_chan *ch) if (ch->dma.irq) free_irq(ch->dma.irq, priv); if (IS_RX(ch->idx)) { - int desc; + struct ltq_dma_channel *dma =3D &ch->dma; =20 - for (desc =3D 0; desc < LTQ_DESC_NUM; desc++) + for (dma->desc =3D 0; dma->desc < LTQ_DESC_NUM; dma->desc++) dev_kfree_skb_any(ch->skb[ch->dma.desc]); } } --=20 2.39.2