All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
To: ath11k@lists.infradead.org
Cc: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Subject: [PATCH 4/4] ath11k: fix action frame rx processing
Date: Tue, 28 May 2019 14:52:56 -0700	[thread overview]
Message-ID: <1559080376-26817-5-git-send-email-pradeepc@codeaurora.org> (raw)
In-Reply-To: <1559080376-26817-1-git-send-email-pradeepc@codeaurora.org>

Firmware/HW delivers broadcast/multicast management frames as encrypted
and it should be decrypted by mac80211. Setting RX_FLAG_DECRYPTED status
for these frames is breaking mesh connection establishment. For unicast
protected action frames, HW decrypts the packet, however, IV and MIC are
not stripped in HW and same must be done by mac80211. so fix that.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/wmi.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 9ca44c4b24f8..07a6fd4d2f8c 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -4905,16 +4905,19 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
 	status->flag |= RX_FLAG_SKIP_MONITOR;
 
 	/* In case of PMF, FW delivers decrypted frames with Protected Bit set.
-	 * Don't clear that. FW also delivers broadcast management frames
+	 * Don't clear that. Also, FW delivers broadcast management frames
 	 * (ex: group privacy action frames in mesh) as encrypted payload.
 	 */
-	if (!ieee80211_is_robust_mgmt_frame(skb))  {
+	if (ieee80211_has_protected(hdr->frame_control) &&
+	    !is_multicast_ether_addr(ieee80211_get_DA(hdr))) {
 		status->flag |= RX_FLAG_DECRYPTED;
 
-		status->flag |= RX_FLAG_IV_STRIPPED |
-			RX_FLAG_MMIC_STRIPPED;
-		hdr->frame_control = __cpu_to_le16(fc &
-				~IEEE80211_FCTL_PROTECTED);
+		if (!ieee80211_is_robust_mgmt_frame(skb)) {
+			status->flag |= RX_FLAG_IV_STRIPPED |
+					RX_FLAG_MMIC_STRIPPED;
+			hdr->frame_control = __cpu_to_le16(fc &
+					     ~IEEE80211_FCTL_PROTECTED);
+		}
 	}
 
 	/* TODO: Pending handle beacon implementation
-- 
2.1.2


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

      parent reply	other threads:[~2019-05-28 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28 21:52 [PATCH 0/4] ath11k: enable 11s secured mesh support Pradeep Kumar Chitrapu
2019-05-28 21:52 ` [PATCH 1/4] ath11k: reset qos control bit after stripping qos field in iee80211_hdr Pradeep Kumar Chitrapu
2019-05-29 15:21   ` Kalle Valo
2019-05-28 21:52 ` [PATCH 2/4] ath11k: pad mic len for protected action frames Pradeep Kumar Chitrapu
2019-05-28 21:52 ` [PATCH 3/4] ath11k: fix multicast txrx for secure 11s mesh support Pradeep Kumar Chitrapu
2019-05-28 21:52 ` Pradeep Kumar Chitrapu [this message]

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=1559080376-26817-5-git-send-email-pradeepc@codeaurora.org \
    --to=pradeepc@codeaurora.org \
    --cc=ath11k@lists.infradead.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.