Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp409752lqp; Wed, 12 Jun 2024 05:37:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7xYaKj06WbRvUcZae66d9olIg20/HbeAqt6/NFsVxY7ofsF8NYZa2BEu5Dezvt7j768XCsRv+XuAQOhroCf2WFhTlObsAT0wUNruVgw== X-Google-Smtp-Source: AGHT+IEsj8wfVhsVRDlXr3XLtgPzM2Q9co8hEeCqaIRqMtV39e4aRorm+5yaHZnbmt72CuB8LX3D X-Received: by 2002:a05:6102:198a:b0:48c:48c0:a684 with SMTP id ada2fe7eead31-48d91dd3672mr1974690137.3.1718195844060; Wed, 12 Jun 2024 05:37:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718195844; cv=pass; d=google.com; s=arc-20160816; b=TKeOSHGe92w2Ty0RkZF3vhVXH3M0kkDaiVFn99IdBBKb8ZdLFIE1GXu8HUcWdybFYj ddESftEMRbRWSwltsFZTIlNxW7QUgyvkd8xrbRxy04AS/lHvAEkDIeXQJ1bhYs3Q/1Du I3q9KaTRrcrg01GQpL0WCp/EbyPQ84DMalklGpZSTyhNSA/kvyOpul4+zgaDyk84iS6C /wTA2WHtMqsXOQQPxHcMJjiwc/BBLIPm63/4Z5ngNKYAaXc1Vrmp4+1ig4/nIl7wZ3aQ bH/2DYb1vZlh9BWVNf4xSTXhZgnDX5H/cH/h2nnPVMVkUInxzplVugNeEg40FAQbBkde gV2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2lUv2X3AmHo2Qws41cN+p9itpz0YFs14JwerG26zAA4=; fh=0ZKV22Mpi0Z+/zRlCC9GRUAKl0wLMxmYgR1nXO1NAEs=; b=B7KIRNxuCi4P96RpyYZ1PPLxScQ9uDE/iP+lVgzMAsJ5d24nNEgbVW6lsrMnOVUVY+ L5j1dfVOGGVGJcqBSJl4l7BquUQCdB2sD/8JHydjVY/TMgT166mfCe8nFKSO7Flkqu5A yfRqziF+T5Sy7ZFx1ULEXG+YtgkokKB4XQ9BcFKzCoT5PYXhtOxzfPgtfYsNBETO7ez+ Job/NRkzbbzsZDIizkr2Yg5+r0m1mxhQKy8QtIFuFJIftgg7A04Ktoc4VqxDFTbp546l yjFELk18fDi+0SVXnhiOrM5SsPMYz9jaU7iWMPjmvw3lisfQ6rYZPW58hzDVMoSdRIWK FunQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="n3/lG1Ya"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-8876-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8876-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-7958e634212si781954385a.577.2024.06.12.05.37.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 05:37:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8876-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="n3/lG1Ya"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-8876-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8876-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C3A8B1C213CA for ; Wed, 12 Jun 2024 12:37:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59D2817083F; Wed, 12 Jun 2024 12:37:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="n3/lG1Ya" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E763316FF3E for ; Wed, 12 Jun 2024 12:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718195835; cv=none; b=isx0xdvSAARs0R/wvWYyHVwE4l3G4RVC9+3c5zyoQHQ/5TDXZb85Jfr2Tr2gEHi+JXC2EgYPMBl8NU02uqzX8N3BVmSRix5WvwVv+gJHInCkx/3VelscBkA8nql2m0CU0i9ohVsiq+/HPsF5fr0NPxX3BGgHQ4SJm+la9eD3muY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718195835; c=relaxed/simple; bh=w2Br6UDueL4M26SFC+kjiJwIdAzUN2QIOP0pU+kfcW8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ohI/0JPQx0qg9RgPL44bLkkRNvlXbUmyzTtqKoQiMYY+PTXaOJLEovKUuxsxrBRKSNUbZtJSEQT9EUBXIxFUbYsHyZ/K/Nmpeksn6YY89p74P3MrPwbM8bkjZfqhreJD0CZT2JwFxdU1lzVL5mLBRLzPArFuPyXz0AhnbirXcKc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=n3/lG1Ya; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=2lUv2X3AmHo2Qws41cN+p9itpz0YFs14JwerG26zAA4=; t=1718195834; x=1719405434; b=n3/lG1Ya5PILCN2kLqvcbn3FjWxujfaytOexeSpkf1Mvule HwSbB/rk8+TJYpniR7M+OrTQHwO4L+cWcdf2FxoNNnEyG5tRtrw7OI1Q1Q/+SwaLvqNDNP6jL6GV4 gbGKX07yLrffAYpLpZMMfRASt3ntikmAQksxhWZLzVxDfvv45KXD+mAhYhR16/BcYhJvyFfOy3dd4 exMiq81ffd4FekM4QU6U2ka0NOA0VDX/usNcuhjU06DIdnRACJycnXyIiPFSqi2jlXoJfEbxYpHgd Cm8TCJ95dj1oSO8sJekrnGcaKobZclLNe83yThdckn2vbm8UDebF4NVBzVnvBhRA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sHNDz-0000000AH0b-1sK8; Wed, 12 Jun 2024 14:37:11 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Miriam Rachel Korenblit Subject: [PATCH 2/2] wifi: mac80211: correcty limit wider BW TDLS STAs Date: Wed, 12 Jun 2024 14:35:57 +0200 Message-ID: <20240612143707.1ad989acecde.I5c75c94d95c3f4ea84f8ff4253189f4b13bad5c3@changeid> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612123707.38067-4-johannes@sipsolutions.net> References: <20240612123707.38067-4-johannes@sipsolutions.net> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg When updating a channel context, the code can apply wider bandwidth TDLS STA channel definitions to each and every channel context used by the device, an approach that will surely lead to problems if there is ever more than one. Restrict the wider BW TDLS STA consideration to only TDLS STAs that are actually related to links using the channel context being updated. Fixes: 0fabfaafec3a ("mac80211: upgrade BW of TDLS peers when possible") Reviewed-by: Miriam Rachel Korenblit Signed-off-by: Johannes Berg --- net/mac80211/chan.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index ec16d7676088..2f7cbb998b96 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -775,13 +775,24 @@ void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local, /* TDLS peers can sometimes affect the chandef width */ list_for_each_entry(sta, &local->sta_list, list) { + struct ieee80211_sub_if_data *sdata = sta->sdata; struct ieee80211_chan_req tdls_chanreq = {}; + int tdls_link_id; + if (!sta->uploaded || !test_sta_flag(sta, WLAN_STA_TDLS_WIDER_BW) || !test_sta_flag(sta, WLAN_STA_AUTHORIZED) || !sta->tdls_chandef.chan) continue; + tdls_link_id = ieee80211_tdls_sta_link_id(sta); + link = sdata_dereference(sdata->link[tdls_link_id], sdata); + if (!link) + continue; + + if (rcu_access_pointer(link->conf->chanctx_conf) != conf) + continue; + tdls_chanreq.oper = sta->tdls_chandef; /* note this always fills and returns &tmp if compat */ -- 2.45.2