Skip to content

Commit

Permalink
mac80211: Honor SW_CRYPTO_CONTROL for unicast keys in AP VLAN mode
Browse files Browse the repository at this point in the history
Restore SW_CRYPTO_CONTROL operation on AP_VLAN interfaces for unicast
keys, the original override was intended to be done for group keys as
those are treated specially by mac80211 and would always have been
rejected.

Now the situation is that AP_VLAN support must be enabled by the driver
if it can support it (meaning it can support software crypto GTK TX).

Thus, also simplify the code - if we get here with AP_VLAN and non-
pairwise key, software crypto must be used (driver doesn't know about
the interface) and can be used (driver must've advertised AP_VLAN if
it also uses SW_CRYPTO_CONTROL).

Fixes: db3bdcb ("mac80211: allow AP_VLAN operation on crypto controlled devices")
Signed-off-by: Alexander Wetzel <[email protected]>
[rewrite commit message]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
alexw65500 authored and jmberg-intel committed Apr 9, 2019
1 parent 2b4a669 commit 78ad234
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions net/mac80211/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
* The driver doesn't know anything about VLAN interfaces.
* Hence, don't send GTKs for VLAN interfaces to the driver.
*/
if (!(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE))
if (!(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
ret = 1;
goto out_unsupported;
}
}

ret = drv_set_key(key->local, SET_KEY, sdata,
Expand Down Expand Up @@ -213,11 +215,8 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
/* all of these we can do in software - if driver can */
if (ret == 1)
return 0;
if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL)) {
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
return 0;
if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL))
return -EINVAL;
}
return 0;
default:
return -EINVAL;
Expand Down

0 comments on commit 78ad234

Please sign in to comment.