From patchwork Fri Aug 26 10:03:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinayak Yadawad X-Patchwork-Id: 12955821 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB8EBECAAD2 for ; Fri, 26 Aug 2022 10:04:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229971AbiHZKE4 (ORCPT ); Fri, 26 Aug 2022 06:04:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245228AbiHZKE1 (ORCPT ); Fri, 26 Aug 2022 06:04:27 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162D4D9EAD for ; Fri, 26 Aug 2022 03:03:24 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id m2so1191388pls.4 for ; Fri, 26 Aug 2022 03:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc; bh=Ax9fdXLbFaofSbdg3qzf6gGxGymPvt5sbkqxLmZ24LQ=; b=Ud5inWYRRNzmVJq1Bt5MJtxzpJFxni/5YLRH1pszidsjcbu4FgLK8Lciswrda5KXwh d4y0frrac8jhhgG+JQjJK4Q1UNLAZ0iF7/GfKFlA3E+wViCmKtrIbQhXq39DzINuULWL vLbzM2ue3CAWhYCHUWbEaX+J5E5Mo2gw5YOx4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc; bh=Ax9fdXLbFaofSbdg3qzf6gGxGymPvt5sbkqxLmZ24LQ=; b=AG9PxFjPw80ALQtk7duweEyjm3W0XzUTpzlWIy7jZ59uZ5Un0U+o36KjeaqBZEMVm7 yi/A5nvb3kOK9d1MDM2kdLglnhvPSEamwOp71dz5LHLXnzFa7zVgqUy2d1M+4eSZ3/1n Xsy7N6D45inLidCD2MlRMi4Em1xT1awg0TcqwA3ZTQ7YfoloNb2dDyDL0hRMpsMgnqtc hd9W3MF6xGQHsZ//KubYK96HZXXIWFqWTRNcUHDkfZpMvZCn+mixwcvD1tFDj8VBmaYs PyF4MfimjL6IBIexTHh9I6l7+OOpkOBARrk2Idve/dpo/fO5HC6Q3vFgDSKPt5ptIWCp j5uQ== X-Gm-Message-State: ACgBeo0WAWq/HAk+ukC2Vu5JzOzhLsNmrNDMgoagVt5+BR59f1XTmgZ8 d6JMxARZ/KKtQ/tVX/5wJuudnvnimxfVdw== X-Google-Smtp-Source: AA6agR4LGrRd1ioEo50TDln+s5kiQA9hQKz+antnvMhG0X0lmNoTQAqY8q5MyBslwXIvN09F3Ub4Ew== X-Received: by 2002:a17:903:18a:b0:16f:e43:efdf with SMTP id z10-20020a170903018a00b0016f0e43efdfmr3025098plg.157.1661508193709; Fri, 26 Aug 2022 03:03:13 -0700 (PDT) Received: from ibnvda0196.ibn.broadcom.net ([192.19.252.250]) by smtp.gmail.com with ESMTPSA id p15-20020a170902e74f00b0016d5b7fb02esm1180137plf.60.2022.08.26.03.03.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Aug 2022 03:03:13 -0700 (PDT) From: Vinayak Yadawad To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, jithu.jance@broadcom.com, Vinayak Yadawad Subject: [PATCH 1/1] cfg80211: Update Transition Disable policy during port authorization Date: Fri, 26 Aug 2022 15:33:03 +0530 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In case of 4way handshake offload, transition disable policy updated by the AP during EAPOL 3/4 is not updated to the cfg80211 layer. This results in mismatch between transition disable policy between the upper layer and the driver. This patch addresses this issue by updating transition disable policy as part of port authorization indiation. Signed-off-by: Vinayak Yadawad --- include/net/cfg80211.h | 2 +- include/uapi/linux/nl80211.h | 1 + net/wireless/core.h | 4 +++- net/wireless/nl80211.c | 6 ++++-- net/wireless/nl80211.h | 3 ++- net/wireless/sme.c | 8 +++++--- net/wireless/util.c | 2 +- 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 908d58393484..9c89102c85cd 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -7669,7 +7669,7 @@ void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info, * indicate the 802.11 association. */ void cfg80211_port_authorized(struct net_device *dev, const u8 *bssid, - gfp_t gfp); + const u8 td_bitmap, gfp_t gfp); /** * cfg80211_disconnected - notify cfg80211 that connection was dropped diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index ffb7c573e299..ef0c882d214b 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -3268,6 +3268,7 @@ enum nl80211_attrs { NL80211_ATTR_TX_HW_TIMESTAMP, NL80211_ATTR_RX_HW_TIMESTAMP, + NL80211_ATTR_TD_BITMAP, /* add attributes here, update the policy in nl80211.c */ diff --git a/net/wireless/core.h b/net/wireless/core.h index 775e16cb99ed..8baa3487f67f 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h @@ -271,6 +271,7 @@ struct cfg80211_event { } ij; struct { u8 bssid[ETH_ALEN]; + u8 td_bitmap; } pa; }; }; @@ -409,7 +410,8 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev, bool wextev); void __cfg80211_roamed(struct wireless_dev *wdev, struct cfg80211_roam_info *info); -void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid); +void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid, + const u8 td_bitmap); int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev, struct wireless_dev *wdev); void cfg80211_autodisconnect_wk(struct work_struct *work); diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 2705e3ee8fc4..eee3a2d6e6f7 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -17841,7 +17841,8 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev, } void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev, - struct net_device *netdev, const u8 *bssid) + struct net_device *netdev, const u8 *bssid, + const u8 td_bitmap) { struct sk_buff *msg; void *hdr; @@ -17858,7 +17859,8 @@ void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev, if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || - nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid)) + nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid) || + nla_put_u8(msg, NL80211_ATTR_TD_BITMAP, td_bitmap)) goto nla_put_failure; genlmsg_end(msg, hdr); diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h index 855d540ddfb9..5001d9d8c635 100644 --- a/net/wireless/nl80211.h +++ b/net/wireless/nl80211.h @@ -83,7 +83,8 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev, struct net_device *netdev, struct cfg80211_roam_info *info, gfp_t gfp); void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev, - struct net_device *netdev, const u8 *bssid); + struct net_device *netdev, const u8 *bssid, + const u8 td_bitmap); void nl80211_send_disconnected(struct cfg80211_registered_device *rdev, struct net_device *netdev, u16 reason, const u8 *ie, size_t ie_len, bool from_ap); diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 27fb2a0c4052..5e9db942cbbb 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -1234,7 +1234,8 @@ void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info, } EXPORT_SYMBOL(cfg80211_roamed); -void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid) +void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid, + const u8 td_bitmap) { ASSERT_WDEV_LOCK(wdev); @@ -1247,11 +1248,11 @@ void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid) return; nl80211_send_port_authorized(wiphy_to_rdev(wdev->wiphy), wdev->netdev, - bssid); + bssid, td_bitmap); } void cfg80211_port_authorized(struct net_device *dev, const u8 *bssid, - gfp_t gfp) + const u8 td_bitmap, gfp_t gfp) { struct wireless_dev *wdev = dev->ieee80211_ptr; struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); @@ -1267,6 +1268,7 @@ void cfg80211_port_authorized(struct net_device *dev, const u8 *bssid, ev->type = EVENT_PORT_AUTHORIZED; memcpy(ev->pa.bssid, bssid, ETH_ALEN); + ev->pa.td_bitmap = td_bitmap; /* * Use the wdev event list so that if there are pending diff --git a/net/wireless/util.c b/net/wireless/util.c index 2c127951764a..6a1d82c43766 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -988,7 +988,7 @@ void cfg80211_process_wdev_events(struct wireless_dev *wdev) __cfg80211_leave(wiphy_to_rdev(wdev->wiphy), wdev); break; case EVENT_PORT_AUTHORIZED: - __cfg80211_port_authorized(wdev, ev->pa.bssid); + __cfg80211_port_authorized(wdev, ev->pa.bssid, ev->pa.td_bitmap); break; } wdev_unlock(wdev);