All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
	Fredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
Subject: [PATCH] mac80211: fix overwriting of qos_ctrl.tid field
Date: Tue, 19 Nov 2019 14:34:51 +0100	[thread overview]
Message-ID: <20191119133451.14711-1-fredrik.olofsson@anyfinetworks.com> (raw)

Fixes overwriting of qos_ctrl.tid field for encrypted frames injected on
monitor interface. qos_ctrl.tid is protected by the encryption, and
cannot be modified after encryption. For injected frames, the encryption
key may not be available.

Before passing the frame to the driver, the qos_ctrl.tid field is
updated from skb->priority. Prior to dbd50a851c50 skb->priority was
updated in ieee80211_select_queue_80211(), but this function is no longer
always called. This patch tries to mimmic the previous behaviour by
updating skb->priority in ieee80211_monitor_start_xmit().

Fixes: dbd50a851c50 ("mac80211: only allocate one queue when using iTXQs")
Signed-off-by: Fredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
---
 net/mac80211/tx.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 1fa422782905..cbd273c0b275 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2263,6 +2263,15 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
 						    payload[7]);
 	}
 
+	/*
+	 * Initialize skb->priority for QoS frames. This is put in the TID field
+	 * of the frame before passing it to the driver.
+	 */
+	if (ieee80211_is_data_qos(hdr->frame_control)) {
+		u8 *p = ieee80211_get_qos_ctl(hdr);
+		skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK;
+	}
+
 	memset(info, 0, sizeof(*info));
 
 	info->flags = IEEE80211_TX_CTL_REQ_TX_STATUS |
-- 
2.20.1


             reply	other threads:[~2019-11-19 13:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 13:34 Fredrik Olofsson [this message]
2019-11-22 12:00 ` [PATCH] mac80211: fix overwriting of qos_ctrl.tid field Johannes Berg
2019-11-22 15:06   ` Fredrik Olofsson
2019-11-22 17:50     ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191119133451.14711-1-fredrik.olofsson@anyfinetworks.com \
    --to=fredrik.olofsson@anyfinetworks.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.