]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 2 May 2019 20:41:33 +0000 (21:41 +0100)
commitb6706ab0540c4fbb5424cbaf7c0ce7c87f7a0ba7
treed636a9128207bd3c9754192ed26f4d8f3c3b9322
parent4e938011d7529cc89a79e6077b8767b6c5ef0f48
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.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[bwh: Backported to 3.16: we always expand cloned skbs here; don't change that]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/mac80211/tx.c