Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp766385ybc; Sat, 16 Nov 2019 08:19:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwaRvJtw/X7W4YKnIaOqXMSHI2VBUNqvu8h7c5QFQv5TLIYZQLDdAZDFuWqub3w6LYiwK87 X-Received: by 2002:a17:906:b289:: with SMTP id q9mr10745907ejz.183.1573921150735; Sat, 16 Nov 2019 08:19:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921150; cv=none; d=google.com; s=arc-20160816; b=vpPhzlD+MBG5R0gw5O/AoNCEG789fr/FuzohUhea0DbzMGqlPCRn8NbvhUVbAV0I7r xmxR5BXRHRpHDWSeop2WjB6qjgT85ePpkRFQpS0P8SpmkLcOZ9aUW7COOyFeyak+Iwsi Bu2LF7xblF3jYAPvZXfeO8iS8gaLcGiO4mqqfmq8uu33foYFeHg5lXhIGEtodMs4e4a5 WfRu2TikF4h33bpniATavDnDlKCeZ2ivF9eBbkXBNX6oLVKHuiC8Mv024/SK9K+sL3Hn jrcqXrgLBnTNVT3cETOSbj+AFCYT8KzmZfPzThBqdYP+m3ssh5K6mhTg1w4v3mmPWvhV eutQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=400qwR7FVIj9s/YYr2696Rtl3ulDPvhk0N1Dzk4F1Ms=; b=YLVWaN76NPVCXx+G9s+cmbjmqD0TbDT+6N6EasPSopMD3F99EGwZpQihZDIf8yAgX9 R9VFoWPPMFYSOmyPhASfK4Isrxco81sAxj6IvB+7Tsr0LxJ7hGXxfQppMhHHUa15PNhW TsnZi3flsyWHov12POYevGOhPN+ZwCoQykkJn4+xKDBQzTJjgb3zQ7sa77e5iVlD7tq7 1QtEggRu/HYAuE3SxAfp712AhQVSzDRDVnJjdzcWgAxgOJeNkQzUvpNUcaYnIjhfzT8p 7qcXbKpExpzSoKFdWqXznqpbzX4lbccriJwIyxQy01j/B7yHLeoMrFFpsvzjhhjLnizx B0xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b4ggr0lH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si7754778eju.83.2019.11.16.08.18.45; Sat, 16 Nov 2019 08:19:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b4ggr0lH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731960AbfKPQQ0 (ORCPT + 99 others); Sat, 16 Nov 2019 11:16:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:53676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729597AbfKPPrD (ORCPT ); Sat, 16 Nov 2019 10:47:03 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62F8D2133F; Sat, 16 Nov 2019 15:47:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919222; bh=kZ8zWA2dW+43AmUKUBWUQPRKVQv73HqDZw+2W139/QY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b4ggr0lHaemtpOzYvpM3QVjjjyV1n/ND5yHRmN/6bcVbn4sen8rcAKOEebXCc+ju7 Yd47gmL43zIPUfUYaLjlsP1w32tWFXDYbIx3pENgVodIhVoDQDYjoNJNR1rcx6WJv1 xwPlw1r4b3pMnbLru0uRHfASeZGvmHDSZhx8wGCI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sriram R , Johannes Berg , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 226/237] cfg80211: Prevent regulatory restore during STA disconnect in concurrent interfaces Date: Sat, 16 Nov 2019 10:41:01 -0500 Message-Id: <20191116154113.7417-226-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sriram R [ Upstream commit 113f3aaa81bd56aba02659786ed65cbd9cb9a6fc ] Currently when an AP and STA interfaces are active in the same or different radios, regulatory settings are restored whenever the STA disconnects. This restores all channel information including dfs states in all radios. For example, if an AP interface is active in one radio and STA in another, when radar is detected on the AP interface, the dfs state of the channel will be changed to UNAVAILABLE. But when the STA interface disconnects, this issues a regulatory disconnect hint which restores all regulatory settings in all the radios attached and thereby losing the stored dfs state on the other radio where the channel was marked as unavailable earlier. Hence prevent such regulatory restore whenever another active beaconing interface is present in the same or other radios. Signed-off-by: Sriram R Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/sme.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/wireless/sme.c b/net/wireless/sme.c index d536b07582f8c..c7047c7b4e80f 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -642,11 +642,15 @@ static bool cfg80211_is_all_idle(void) * All devices must be idle as otherwise if you are actively * scanning some new beacon hints could be learned and would * count as new regulatory hints. + * Also if there is any other active beaconing interface we + * need not issue a disconnect hint and reset any info such + * as chan dfs state, etc. */ list_for_each_entry(rdev, &cfg80211_rdev_list, list) { list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { wdev_lock(wdev); - if (wdev->conn || wdev->current_bss) + if (wdev->conn || wdev->current_bss || + cfg80211_beaconing_iface_active(wdev)) is_all_idle = false; wdev_unlock(wdev); } -- 2.20.1