Skip to content

Commit e4fca00

Browse files
committed
mac80211: avoid NULL ptr deref when using WEP
"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>
1 parent 64147c7 commit e4fca00

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎net/mac80211/wep.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,8 @@ static int wep_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)
310310
tx->key->conf.keylen,
311311
tx->key->conf.keyidx))
312312
return -1;
313-
}
314-
315-
if (info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) {
313+
} else if (info->control.hw_key->flags &
314+
IEEE80211_KEY_FLAG_GENERATE_IV) {
316315
if (!ieee80211_wep_add_iv(tx->local, skb,
317316
tx->key->conf.keylen,
318317
tx->key->conf.keyidx))

0 commit comments

Comments
 (0)