From patchwork Tue Oct 17 19:42:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 10012789 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 977C5600CC for ; Tue, 17 Oct 2017 19:42:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86A81289EB for ; Tue, 17 Oct 2017 19:42:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7982B289FB; Tue, 17 Oct 2017 19:42:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFC9F289EB for ; Tue, 17 Oct 2017 19:42:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760017AbdJQTm4 (ORCPT ); Tue, 17 Oct 2017 15:42:56 -0400 Received: from s3.sipsolutions.net ([144.76.63.242]:44416 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759964AbdJQTmz (ORCPT ); Tue, 17 Oct 2017 15:42:55 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1e4XlO-0003j2-L0; Tue, 17 Oct 2017 21:42:54 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Maya Erez , Johannes Berg Subject: [PATCH] wil6210: disallow changing RSN in beacon change Date: Tue, 17 Oct 2017 21:42:53 +0200 Message-Id: <20171017194253.10212-1-johannes@sipsolutions.net> X-Mailer: git-send-email 2.14.2 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Berg This is a code path that will never really get hit anyway, since it's nonsense to change the beacon of an existing BSS to suddenly include or no longer include the RSN IE. Reject this instead of having the dead code, and get rid of accessing wdev->ssid/_len by way of that. Signed-off-by: Johannes Berg --- drivers/net/wireless/ath/wil6210/cfg80211.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 85d5c04618eb..a81711451691 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c @@ -1389,7 +1389,6 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy, struct cfg80211_beacon_data *bcon) { struct wil6210_priv *wil = wiphy_to_wil(wiphy); - int rc; u32 privacy = 0; wil_dbg_misc(wil, "change_beacon\n"); @@ -1400,24 +1399,11 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy, bcon->tail_len)) privacy = 1; - /* in case privacy has changed, need to restart the AP */ - if (wil->privacy != privacy) { - struct wireless_dev *wdev = ndev->ieee80211_ptr; - - wil_dbg_misc(wil, "privacy changed %d=>%d. Restarting AP\n", - wil->privacy, privacy); - - rc = _wil_cfg80211_start_ap(wiphy, ndev, wdev->ssid, - wdev->ssid_len, privacy, - wdev->beacon_interval, - wil->channel, bcon, - wil->hidden_ssid, - wil->pbss); - } else { - rc = _wil_cfg80211_set_ies(wiphy, bcon); - } + /* privacy (really RSN) shouldn't be changing */ + if (wil->privacy != privacy) + return -EINVAL; - return rc; + return _wil_cfg80211_set_ies(wiphy, bcon); } static int wil_cfg80211_start_ap(struct wiphy *wiphy,