cfg80211: don't put kek/kck/replay counter on the stack
There's no need to put the values on the stack, just pass a pointer to the data in the nl80211 message. This reduces stack usage and avoids potential issues with putting sensitive data on the stack. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -8959,13 +8959,9 @@ static int nl80211_set_rekey_data(struct sk_buff *skb, struct genl_info *info)
|
||||
if (nla_len(tb[NL80211_REKEY_DATA_KCK]) != NL80211_KCK_LEN)
|
||||
return -ERANGE;
|
||||
|
||||
memcpy(rekey_data.kek, nla_data(tb[NL80211_REKEY_DATA_KEK]),
|
||||
NL80211_KEK_LEN);
|
||||
memcpy(rekey_data.kck, nla_data(tb[NL80211_REKEY_DATA_KCK]),
|
||||
NL80211_KCK_LEN);
|
||||
memcpy(rekey_data.replay_ctr,
|
||||
nla_data(tb[NL80211_REKEY_DATA_REPLAY_CTR]),
|
||||
NL80211_REPLAY_CTR_LEN);
|
||||
rekey_data.kek = nla_data(tb[NL80211_REKEY_DATA_KEK]);
|
||||
rekey_data.kck = nla_data(tb[NL80211_REKEY_DATA_KCK]);
|
||||
rekey_data.replay_ctr = nla_data(tb[NL80211_REKEY_DATA_REPLAY_CTR]);
|
||||
|
||||
wdev_lock(wdev);
|
||||
if (!wdev->current_bss) {
|
||||
|
||||
Reference in New Issue
Block a user