Skip to content

Commit

Permalink
mac80211: avoid NULL ptr deref when using WEP
Browse files Browse the repository at this point in the history
"mac80211: move control.hw_key assignment" changed an if-else into two
separate if statments, but the if-else is needed to prevent
dereferencing a null info->control.hw_key.  This fixes avoids a lock-up
during association on my machine when using WEP.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
John W. Linville committed Jan 22, 2010
1 parent 64147c7 commit e4fca00
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/mac80211/wep.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,8 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)
tx->key->conf.keylen,
tx->key->conf.keyidx))
return -1;
}

if (info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) {
} else if (info->control.hw_key->flags &
IEEE80211_KEY_FLAG_GENERATE_IV) {
if (!ieee80211_wep_add_iv(tx->local, skb,
tx->key->conf.keylen,
tx->key->conf.keyidx))
Expand Down

0 comments on commit e4fca00

Please sign in to comment.