From d32a102819eef99d4d87019266bea208447be0a0 Mon Sep 17 00:00:00 2001 From: Yoni Divinsky Date: Mon, 16 Jan 2012 15:18:59 +0200 Subject: mac80211: fix tx->skb NULL pointer dereference In function ieee80211_tx_h_encrypt the var info was initialized from tx->skb, since the fucntion is called after the function ieee80211_tx_h_fragment tx->skb is not valid anymore. Signed-off-by: Yoni Divinsky Signed-off-by: John W. Linville --- net/mac80211/wpa.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'net/mac80211/wpa.c') diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 422b79851ec5..b758350919ff 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c @@ -643,3 +643,22 @@ ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx) return RX_CONTINUE; } + +ieee80211_tx_result +ieee80211_crypto_hw_encrypt(struct ieee80211_tx_data *tx) +{ + struct sk_buff *skb; + struct ieee80211_tx_info *info = NULL; + + skb_queue_walk(&tx->skbs, skb) { + info = IEEE80211_SKB_CB(skb); + + /* handle hw-only algorithm */ + if (!info->control.hw_key) + return TX_DROP; + } + + ieee80211_tx_set_protected(tx); + + return TX_CONTINUE; +} -- cgit v1.2.3