mac80211: check if key has TKIP type before updating IV
commit 4045f72bcf upstream.
This patch fix corruption which can manifest itself by following crash
when switching on rfkill switch with rt2x00 driver:
https://bugzilla.redhat.com/attachment.cgi?id=615362
Pointer key->u.ccmp.tfm of group key get corrupted in:
ieee80211_rx_h_michael_mic_verify():
/* update IV in key information to be able to detect replays */
rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip_iv32;
rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip_iv16;
because rt2x00 always set RX_FLAG_MMIC_STRIPPED, even if key is not TKIP.
We already check type of the key in different path in
ieee80211_rx_h_michael_mic_verify() function, so adding additional
check here is reasonable.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2689cd6b16
commit
0dab9d11a7
1 changed files with 2 additions and 1 deletions
|
|
@ -109,7 +109,8 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx)
|
|||
if (status->flag & RX_FLAG_MMIC_ERROR)
|
||||
goto mic_fail;
|
||||
|
||||
if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key)
|
||||
if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key &&
|
||||
rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP)
|
||||
goto update_iv;
|
||||
|
||||
return RX_CONTINUE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue