mac80211: check pairwise key_idx on get_key call
PATCH v2 1/1 mac80211: check pairwise key_idx on get_key call
From: Max Stepanov <[email protected]>
Verify that a pairwise key index value on ieee80211_get_key call doesn't exceed the boundaries of the pairwise key array.
Signed-off-by Max Stepanov <[email protected]>
--- net/mac80211/cfg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/mac80211/cfg.c +2 -2
@@ -301,9 +301,9 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,if (!sta) goto out; -if (pairwise) +if (pairwise && key_idx <NUM_DEFAULT_KEYS ) key =rcu_dereference (sta->ptk[key_idx]); -else if (key_idx <NUM_DEFAULT_KEYS ) +else if (!pairwise && key_idx <NUM_DEFAULT_KEYS ) key =rcu_dereference (sta->gtk[key_idx]); }else key =rcu_dereference (sdata->keys[key_idx]);
Signature · 1 line
1.8.5.rc2
Quoted 4 lines · On Sun, 2013-12-08 at 13:30 +0200, [email protected] wrote:
From: Max Stepanov <[email protected]>
Verify that a pairwise key index value on
ieee80211_get_keycall doesn't exceed the boundaries of the pairwise key array.
Applied.
johannes