]> git.baikalelectronics.ru Git - kernel.git/commit
mt76: dma: do not report truncated frames to mac80211
authorLorenzo Bianconi <lorenzo@kernel.org>
Sun, 7 Feb 2021 11:48:31 +0000 (12:48 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 26 Feb 2021 11:49:57 +0000 (13:49 +0200)
commit863a73c4cbcc18337117b105facff6ff2f7543e5
tree1fc109dc82f11a58c263b898896f3ced82c7c51e
parent6b63b5579a30b0f1b892079f269525e331dff00a
mt76: dma: do not report truncated frames to mac80211

Commit b28a74870a2cd ("mt76: fix array overflow on receiving too many
fragments for a packet") fixes a possible OOB access but it introduces a
memory leak since the pending frame is not released to page_frag_cache
if the frag array of skb_shared_info is full. Commit ca343bd485c6
("mt76: dma: fix a possible memory leak in mt76_add_fragment()") fixes
the issue but does not free the truncated skb that is forwarded to
mac80211 layer. Fix the leftover issue discarding even truncated skbs.

Fixes: ca343bd485c6 ("mt76: dma: fix a possible memory leak in mt76_add_fragment()")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/a03166fcc8214644333c68674a781836e0f57576.1612697217.git.lorenzo@kernel.org
drivers/net/wireless/mediatek/mt76/dma.c