From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3BBE9B641; Tue, 16 Jul 2024 15:40:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721144459; cv=none; b=ejUTwKrTdEok9DN4zKNGZTF/vm9C6wKps3D5G6bzRJRSMbvhAOEfaXwQTZN87x6G22iJ/lTBUL+6tP3vSOPuuHjO61xZTc+LbXNRGsP41jIVXiCDTV2GST3wPCj+f6OdgcfzLtlATuZ2d6ycC1p22EBe11ErGzEvCxSZ5VyvNG8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721144459; c=relaxed/simple; bh=PTlOzA4iuDXm8LE07gcHF7uxMF1xYE7SWnVyTioPJws=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fJIN9VUEPD+nIT8QaC3b77wKGyMBDZRkFE5vc6GkA9Ppt8WlinDLdBYEYzOi+8FZyIQ6FxG+aD0pMimkP0C19bW0jr10/Yiv5yT8+xq5i6UCLmWiFi7lccwuwkXvQp3aAJM1CNX6Yb81m/s6MEwlQGLDeN6WvEg5x2GWHIGQUkc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zffs64cp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zffs64cp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B382BC116B1; Tue, 16 Jul 2024 15:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721144459; bh=PTlOzA4iuDXm8LE07gcHF7uxMF1xYE7SWnVyTioPJws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zffs64cprwNoMwcn2PmfW++BIg2edUkXQ749bOBWMKhIUKjrNoZfsws7yP1oShexH iPrHe9bNvWDa6k3Kr/2vdxvSoCRNU1i3z7ocB/RETUmXdKStKePBp1jpLSs10tuJ45 JJIumYL6KOZZmE3xpwLe9ypSnrJmspcclGs7yOtA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Joe Perches , Aleksander Jan Bajkowski , Andrew Lunn , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 53/78] net: ethernet: lantiq_etop: fix double free in detach Date: Tue, 16 Jul 2024 17:31:25 +0200 Message-ID: <20240716152742.692147925@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240716152740.626160410@linuxfoundation.org> References: <20240716152740.626160410@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aleksander Jan Bajkowski [ Upstream commit e1533b6319ab9c3a97dad314dd88b3783bc41b69 ] 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/fc1bf93d92bb5b2f99c6c62745507cc22f3a7b2d.camel@perches.com/ Signed-off-by: Aleksander Jan Bajkowski Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/20240708205826.5176-1-olek2@wp.pl Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- 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/lantiq_etop.c index 98aa172da051f..932796080c7f7 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -213,9 +213,9 @@ ltq_etop_free_channel(struct net_device *dev, struct ltq_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 = &ch->dma; - for (desc = 0; desc < LTQ_DESC_NUM; desc++) + for (dma->desc = 0; dma->desc < LTQ_DESC_NUM; dma->desc++) dev_kfree_skb_any(ch->skb[ch->dma.desc]); } } -- 2.43.0