]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
ath9k: fix double-free bug on beacon generate failure
authorFelix Fietkau <nbd@openwrt.org>
Wed, 9 Jan 2013 15:16:53 +0000 (16:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Feb 2013 00:24:41 +0000 (18:24 -0600)
commit 1adb2e2b5f85023d17eb4f95386a57029df27c88 upstream.

When the next beacon is sent, the ath_buf from the previous run is reused.
If getting a new beacon from mac80211 fails, bf->bf_mpdu is not reset, yet
the skb is freed, leading to a double-free on the next beacon tx attempt,
resulting in a system crash.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ath/ath9k/beacon.c

index 5eb53c98d75e58936648c96ca5267fb3c172b9ea..2e4243fcadc9ad07f15e30be6ce956a7458864eb 100644 (file)
@@ -154,6 +154,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
                                 skb->len, DMA_TO_DEVICE);
                dev_kfree_skb_any(skb);
                bf->bf_buf_addr = 0;
+               bf->bf_mpdu = NULL;
        }
 
        /* Get a new beacon from mac80211 */