Skip to content

Commit b28e50b

Browse files
committed
wifi: mt76: fix linked list corruption
jira VULN-161567 cve CVE-2025-39918 commit-author Felix Fietkau <[email protected]> commit 49fba87 Never leave scheduled wcid entries on the temporary on-stack list Fixes: 0b3be9d ("wifi: mt76: add separate tx scheduling queue for off-channel tx") Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]> (cherry picked from commit 49fba87) Signed-off-by: Brett Mastbergen <[email protected]>
1 parent b5b75cc commit b28e50b

File tree

1 file changed

+3
-5
lines changed
  • drivers/net/wireless/mediatek/mt76

1 file changed

+3
-5
lines changed

drivers/net/wireless/mediatek/mt76/tx.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid,
642642
static void mt76_txq_schedule_pending(struct mt76_phy *phy)
643643
{
644644
LIST_HEAD(tx_list);
645+
int ret = 0;
645646

646647
if (list_empty(&phy->tx_list))
647648
return;
@@ -653,13 +654,13 @@ static void mt76_txq_schedule_pending(struct mt76_phy *phy)
653654
list_splice_init(&phy->tx_list, &tx_list);
654655
while (!list_empty(&tx_list)) {
655656
struct mt76_wcid *wcid;
656-
int ret;
657657

658658
wcid = list_first_entry(&tx_list, struct mt76_wcid, tx_list);
659659
list_del_init(&wcid->tx_list);
660660

661661
spin_unlock(&phy->tx_lock);
662-
ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_offchannel);
662+
if (ret >= 0)
663+
ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_offchannel);
663664
if (ret >= 0 && !phy->offchannel)
664665
ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_pending);
665666
spin_lock(&phy->tx_lock);
@@ -668,9 +669,6 @@ static void mt76_txq_schedule_pending(struct mt76_phy *phy)
668669
!skb_queue_empty(&wcid->tx_offchannel) &&
669670
list_empty(&wcid->tx_list))
670671
list_add_tail(&wcid->tx_list, &phy->tx_list);
671-
672-
if (ret < 0)
673-
break;
674672
}
675673
spin_unlock(&phy->tx_lock);
676674

0 commit comments

Comments
 (0)