mac80211: ensure that mgmt tx skbs have tailroom for encryption
authorFelix Fietkau <nbd@nbd.name>
Tue, 29 Jan 2019 10:10:57 +0000 (11:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Feb 2019 07:10:12 +0000 (08:10 +0100)
commita4c77aac0d5c19a15c6673f3cd510ebbbea76a72
tree0fe065f6fec8765fc01c04d7a5fa050699bd0598
parent1ce0fcebff24f3f06ec0e42e472c0250384e6d41
mac80211: ensure that mgmt tx skbs have tailroom for encryption

commit 9d0f50b80222dc273e67e4e14410fcfa4130a90c upstream.

Some drivers use IEEE80211_KEY_FLAG_SW_MGMT_TX to indicate that management
frames need to be software encrypted. Since normal data packets are still
encrypted by the hardware, crypto_tx_tailroom_needed_cnt gets decremented
after key upload to hw. This can lead to passing skbs to ccmp_encrypt_skb,
which don't have the necessary tailroom for software encryption.

Change the code to add tailroom for encrypted management packets, even if
crypto_tx_tailroom_needed_cnt is 0.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/tx.c