Commit 3b43a187 authored by Kalle Valo's avatar Kalle Valo Committed by John W. Linville

mac80211: fix tx select key null pointer crash with hostapd

Pavel Roskin reported a crash in ieee80211_tx_h_select_key():

http://marc.info/?l=linux-wireless&m=126419655108528&w=2

This is a regression from patch "mac80211: move control.hw_key assignment".
Fix it as suggested by Johannes, adding an else statement to make sure
that tx->key is not accessed when it's null.

Compile-tested only.
Reported-by: default avatarPavel Roskin <proski@gnu.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarKalle Valo <kalle.valo@iki.fi>
Tested-by: default avatarBob Copeland <me@bobcopeland.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f12553eb
...@@ -547,9 +547,10 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx) ...@@ -547,9 +547,10 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
!ieee80211_use_mfp(hdr->frame_control, tx->sta, !ieee80211_use_mfp(hdr->frame_control, tx->sta,
tx->skb)) tx->skb))
tx->key = NULL; tx->key = NULL;
skip_hw = (tx->key->conf.flags & else
IEEE80211_KEY_FLAG_SW_MGMT) && skip_hw = (tx->key->conf.flags &
ieee80211_is_mgmt(hdr->frame_control); IEEE80211_KEY_FLAG_SW_MGMT) &&
ieee80211_is_mgmt(hdr->frame_control);
break; break;
case ALG_AES_CMAC: case ALG_AES_CMAC:
if (!ieee80211_is_mgmt(hdr->frame_control)) if (!ieee80211_is_mgmt(hdr->frame_control))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment