mac80211: Correctly set noencrypt for PAE frames [Linux 4.19.70]

This Linux kernel change "mac80211: Correctly set noencrypt for PAE frames" is included in the Linux 4.19.70 release. This change is authored by Denis Kenzior <denkenz [at]> on Tue Aug 27 17:41:20 2019 -0500. The commit for this change in Linux stable tree is 938e383 (patch) which is from upstream commit f8b43c5. The same Linux upstream change may have been applied to various maintained Linux releases and you can find all Linux releases containing changes from upstream f8b43c5.

mac80211: Correctly set noencrypt for PAE frames

commit f8b43c5cf4b62a19f2210a0f5367b84e1eff1ab9 upstream.

The noencrypt flag was intended to be set if the "frame was received
unencrypted" according to include/uapi/linux/nl80211.h.  However, the
current behavior is opposite of this.

Fixes: 018f6fbf540d ("mac80211: Send control port frames over nl80211")
Signed-off-by: Denis Kenzior <>
Signed-off-by: Johannes Berg <>
Signed-off-by: Greg Kroah-Hartman <>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 net/mac80211/rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 348e9dd..b12f23c 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2372,7 +2372,7 @@ static void ieee80211_deliver_skb_to_local_stack(struct sk_buff *skb,
              skb->protocol == cpu_to_be16(ETH_P_PREAUTH)) &&
             sdata->control_port_over_nl80211)) {
        struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
-       bool noencrypt = status->flag & RX_FLAG_DECRYPTED;
+       bool noencrypt = !(status->flag & RX_FLAG_DECRYPTED);

        cfg80211_rx_control_port(dev, skb, noencrypt);

Leave a Reply

Your email address will not be published. Required fields are marked *