]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: fix TID field in monitor mode transmit
authorFredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
Tue, 19 Nov 2019 13:34:51 +0000 (14:34 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 13 Dec 2019 09:06:39 +0000 (10:06 +0100)
commit4f31e96bcaba21a93c2499490f357cc9796a9414
treee9c070c82a9ddebb1cb937339c2534bfaacd7c3d
parent0f7206cc3e17758ca5d4ccaa3b3b608731b66f98
mac80211: fix TID field in monitor mode transmit

Fix overwriting of the qos_ctrl.tid field for encrypted frames injected on
a monitor interface. While qos_ctrl.tid is not encrypted, it's used as an
input into the encryption algorithm so it's protected, and thus cannot be
modified after encryption. For injected frames, the encryption may already
have been done in userspace, so we cannot change any fields.

Before passing the frame to the driver, the qos_ctrl.tid field is updated
from skb->priority. Prior to 57fda194cd30 skb->priority was updated in
ieee80211_select_queue_80211(), but this function is no longer always
called.

Update skb->priority in ieee80211_monitor_start_xmit() so that the value
is stored, and when later code 'modifies' the TID it really sets it to
the same value as before, preserving the encryption.

Fixes: 57fda194cd30 ("mac80211: only allocate one queue when using iTXQs")
Signed-off-by: Fredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
Link: https://lore.kernel.org/r/20191119133451.14711-1-fredrik.olofsson@anyfinetworks.com
[rewrite commit message based on our discussion]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/tx.c