Commit a4a59e5833fb66f7776c4224d41d753aa1ee9fb7

Authored by Johannes Berg
Committed by Greg Kroah-Hartman
1 parent 30e4fb85e8

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

commit 1e359a5de861a57aa04d92bb620f52a5c1d7f8b1 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

include/net/mac80211.h
... ... @@ -1227,8 +1227,7 @@
1227 1227 *
1228 1228 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the
1229 1229 * driver to indicate that it requires IV generation for this
1230   - * particular key. Setting this flag does not necessarily mean that SKBs
1231   - * will have sufficient tailroom for ICV or MIC.
  1230 + * particular key.
1232 1231 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
1233 1232 * the driver for a TKIP key if it requires Michael MIC
1234 1233 * generation in software.
... ... @@ -1240,9 +1239,7 @@
1240 1239 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver
1241 1240 * if space should be prepared for the IV, but the IV
1242 1241 * itself should not be generated. Do not set together with
1243   - * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. Setting this flag does
1244   - * not necessarily mean that SKBs will have sufficient tailroom for ICV or
1245   - * MIC.
  1242 + * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key.
1246 1243 * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received
1247 1244 * management frames. The flag can help drivers that have a hardware
1248 1245 * crypto implementation that doesn't deal with management frames
... ... @@ -131,7 +131,9 @@
131 131 if (!ret) {
132 132 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
133 133  
134   - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC))
  134 + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
  135 + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) ||
  136 + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)))
135 137 sdata->crypto_tx_tailroom_needed_cnt--;
136 138  
137 139 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) &&
... ... @@ -179,7 +181,9 @@
179 181 sta = key->sta;
180 182 sdata = key->sdata;
181 183  
182   - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC))
  184 + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
  185 + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) ||
  186 + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)))
183 187 increment_tailroom_need_count(sdata);
184 188  
185 189 ret = drv_set_key(key->local, DISABLE_KEY, sdata,
... ... @@ -875,7 +879,9 @@
875 879 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
876 880 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
877 881  
878   - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC))
  882 + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
  883 + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) ||
  884 + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)))
879 885 increment_tailroom_need_count(key->sdata);
880 886 }
881 887