Linux wireless drivers development
 help / color / mirror / Atom feed
From: Thomas Fourier <fourier.thomas@gmail.com>
Cc: Thomas Fourier <fourier.thomas@gmail.com>,
	Igor Mitsyanko <imitsyanko@quantenna.com>,
	Sergey Matyukevich <geomatsi@gmail.com>,
	Runyu Xiao <runyu.xiao@seu.edu.cn>, Kalle Valo <kvalo@kernel.org>,
	Andrey Shevchenko <ashevchenko@quantenna.com>,
	linux-wireless@vger.kernel.org (open list:QUANTENNA QTNFMAC
	WIRELESS DRIVER), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net-next] wifi: qtnfmac: topaz: Fix dma_unmap_single() size
Date: Fri, 16 Oct 2026 15:45:32 +0200	[thread overview]
Message-ID: <20261016134538.42940-2-fourier.thomas@gmail.com> (raw)

In qtnf_pcie_data_tx(), the SKB is mapped with size skb->len, but it is
unmapped in qtnf_topaz_free_xfer_buffers() with size SKB_BUF_SIZE. This
could leave parts of the buffer mapped, and thus leave memory exposed
to the device.

Change the size of the unmap to skb->len.

This bug was statically found and compile-tested only.

Fixes: e401fa25cfa2 ("qtnfmac: add support for Topaz chipsets")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
 drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
index a3a285f17dca..2e00bf68d001 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
@@ -322,7 +322,7 @@ static void qtnf_topaz_free_xfer_buffers(struct qtnf_pcie_topaz_state *ts)
 			skb = priv->tx_skb[i];
 			paddr = QTN_HOST_ADDR(0x0, le32_to_cpu(txbd->addr));
 			dma_unmap_single(&priv->pdev->dev, paddr,
-					 SKB_BUF_SIZE, DMA_TO_DEVICE);
+					 skb->len, DMA_TO_DEVICE);
 			dev_kfree_skb_any(skb);
 			priv->tx_skb[i] = NULL;
 			txbd->addr = 0;
-- 
2.53.0


                 reply	other threads:[~2026-10-16 13:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261016134538.42940-2-fourier.thomas@gmail.com \
    --to=fourier.thomas@gmail.com \
    --cc=ashevchenko@quantenna.com \
    --cc=geomatsi@gmail.com \
    --cc=imitsyanko@quantenna.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=runyu.xiao@seu.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox