]> git.baikalelectronics.ru Git - kernel.git/commit
mt76: mt7615: Use after free in mt7615_mcu_set_bcn()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 3 May 2019 13:09:13 +0000 (16:09 +0300)
committerFelix Fietkau <nbd@nbd.name>
Tue, 25 Jun 2019 10:55:25 +0000 (12:55 +0200)
commit82d0f97f5d84a2229292ad81149c363a235374e5
treee9029b71a2a93803743a0bfc6f9020709bfaf9d6
parent89947d239815e4e977e64d28864830e090b96313
mt76: mt7615: Use after free in mt7615_mcu_set_bcn()

We dereference "skb" when we assign:

req.pkt_len = cpu_to_le16(MT_TXD_SIZE + skb->len);
                                                ^^^^^^^^
So this patch just moves the dev_kfree_skb() down a bit to avoid the
use after free.

Fixes: 09301c7b1225 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c