]> git.baikalelectronics.ru Git - kernel.git/commit
mt76: fix tx status related use-after-free race on station removal
authorFelix Fietkau <nbd@nbd.name>
Sat, 23 Apr 2022 05:01:18 +0000 (07:01 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 13 May 2022 07:39:35 +0000 (09:39 +0200)
commita0d8fe0f3af5c7eb6c174dc0389ea07b9e63231b
tree46ea12fc53c24ea4b7ae07eeca9436df99edaa77
parent13e2c8cec71d2372fbdfe1c43859212eaf44e99a
mt76: fix tx status related use-after-free race on station removal

There is a small race window where ongoing tx activity can lead to a skb
getting added to the status tracking idr after that idr has already been
cleaned up, which will keep the wcid linked in the status poll list.
Fix this by only adding status skbs if the wcid pointer is still assigned
in dev->wcid, which gets cleared early by mt76_sta_pre_rcu_remove

Fixes: b60d9d1109f1 ("mt76: introduce packet_id idr")
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mac80211.c
drivers/net/wireless/mediatek/mt76/tx.c