All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.12] mt76: fix potential DMA mapping leak
@ 2021-03-23 21:47 Felix Fietkau
  2021-04-11  8:47 ` Kalle Valo
       [not found] ` <20210411084750.380F5C43461@smtp.codeaurora.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Felix Fietkau @ 2021-03-23 21:47 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, greearb

With buf uninitialized in mt76_dma_tx_queue_skb_raw, its field skip_unmap
could potentially inherit a non-zero value from stack garbage.
If this happens, it will cause DMA mappings for MCU command frames to not be
unmapped after completion

Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
index 2f27c43ad76d..7196fa9047e6 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/dma.c
@@ -309,7 +309,7 @@ static int
 mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q,
 			  struct sk_buff *skb, u32 tx_info)
 {
-	struct mt76_queue_buf buf;
+	struct mt76_queue_buf buf = {};
 	dma_addr_t addr;
 
 	if (q->queued + 1 >= q->ndesc - 1)
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 5.12] mt76: fix potential DMA mapping leak
  2021-03-23 21:47 [PATCH 5.12] mt76: fix potential DMA mapping leak Felix Fietkau
@ 2021-04-11  8:47 ` Kalle Valo
       [not found] ` <20210411084750.380F5C43461@smtp.codeaurora.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-04-11  8:47 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, greearb

Felix Fietkau <nbd@nbd.name> wrote:

> With buf uninitialized in mt76_dma_tx_queue_skb_raw, its field skip_unmap
> could potentially inherit a non-zero value from stack garbage.
> If this happens, it will cause DMA mappings for MCU command frames to not be
> unmapped after completion
> 
> Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
> Cc: stable@vger.kernel.org
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

Sorry, I missed this and I suspect it's now too late for v5.12. Felix, can you
instead take this to your tree so that we can get this to v5.13? I assigned
this to you on patchwork.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210323214737.53254-1-nbd@nbd.name/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 5.12] mt76: fix potential DMA mapping leak
       [not found] ` <20210411084750.380F5C43461@smtp.codeaurora.org>
@ 2021-04-11 10:25   ` Felix Fietkau
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Fietkau @ 2021-04-11 10:25 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, greearb


On 2021-04-11 10:47, Kalle Valo wrote:
> Felix Fietkau <nbd@nbd.name> wrote:
> 
>> With buf uninitialized in mt76_dma_tx_queue_skb_raw, its field skip_unmap
>> could potentially inherit a non-zero value from stack garbage.
>> If this happens, it will cause DMA mappings for MCU command frames to not be
>> unmapped after completion
>> 
>> Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> 
> Sorry, I missed this and I suspect it's now too late for v5.12. Felix, can you
> instead take this to your tree so that we can get this to v5.13? I assigned
> this to you on patchwork.
Will do. I plan on sending an updated pull request today.

- Felix

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-11 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 21:47 [PATCH 5.12] mt76: fix potential DMA mapping leak Felix Fietkau
2021-04-11  8:47 ` Kalle Valo
     [not found] ` <20210411084750.380F5C43461@smtp.codeaurora.org>
2021-04-11 10:25   ` Felix Fietkau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.