Commit 1e359a5de861a57aa04d92bb620f52a5c1d7f8b1

Authored by Johannes Berg
1 parent 28a9bc6812

Revert "mac80211: Fix accounting of the tailroom-needed counter"

This reverts commit ca34e3b5c808385b175650605faa29e71e91991b.

It turns out that the p54 and cw2100 drivers assume that there's
tailroom even when they don't say they really need it. However,
there's currently no way for them to explicitly say they do need
it, so for now revert this.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=90331.

Cc: stable@vger.kernel.org
Fixes: ca34e3b5c808 ("mac80211: Fix accounting of the tailroom-needed counter")
Reported-by: Christopher Chavez <chrischavez@gmx.us>
Bisected-by: Larry Finger <Larry.Finger@lwfinger.net>
Debugged-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Showing 2 changed files with 11 additions and 8 deletions Side-by-side Diff

include/net/mac80211.h
... ... @@ -1270,8 +1270,7 @@
1270 1270 *
1271 1271 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the
1272 1272 * driver to indicate that it requires IV generation for this
1273   - * particular key. Setting this flag does not necessarily mean that SKBs
1274   - * will have sufficient tailroom for ICV or MIC.
  1273 + * particular key.
1275 1274 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
1276 1275 * the driver for a TKIP key if it requires Michael MIC
1277 1276 * generation in software.
... ... @@ -1283,9 +1282,7 @@
1283 1282 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver
1284 1283 * if space should be prepared for the IV, but the IV
1285 1284 * itself should not be generated. Do not set together with
1286   - * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. Setting this flag does
1287   - * not necessarily mean that SKBs will have sufficient tailroom for ICV or
1288   - * MIC.
  1285 + * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key.
1289 1286 * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received
1290 1287 * management frames. The flag can help drivers that have a hardware
1291 1288 * crypto implementation that doesn't deal with management frames
... ... @@ -140,7 +140,9 @@
140 140 if (!ret) {
141 141 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
142 142  
143   - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC))
  143 + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
  144 + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) ||
  145 + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)))
144 146 sdata->crypto_tx_tailroom_needed_cnt--;
145 147  
146 148 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) &&
... ... @@ -188,7 +190,9 @@
188 190 sta = key->sta;
189 191 sdata = key->sdata;
190 192  
191   - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC))
  193 + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
  194 + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) ||
  195 + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)))
192 196 increment_tailroom_need_count(sdata);
193 197  
194 198 ret = drv_set_key(key->local, DISABLE_KEY, sdata,
... ... @@ -884,7 +888,9 @@
884 888 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
885 889 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
886 890  
887   - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC))
  891 + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
  892 + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) ||
  893 + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)))
888 894 increment_tailroom_need_count(key->sdata);
889 895 }
890 896