Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2380257rdb; Wed, 21 Feb 2024 06:06:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU6EH12pM8yRByviJpEcteqTkLdCgAty3YCP5eCXOhTYfKPBnKruRakz4UIWqKbYY1WDUbP6dwsEthiNQ/w/KmrUOpV6F6iCgA+3OxrZA== X-Google-Smtp-Source: AGHT+IHJ228ARai5SLRazp1EMh5iqlVlAZDOL/ngmWLsAuKD1807pw2N+64Ax3QcDBCd4IyIA2TX X-Received: by 2002:a05:620a:15aa:b0:785:c9d1:547d with SMTP id f10-20020a05620a15aa00b00785c9d1547dmr20617265qkk.78.1708524419435; Wed, 21 Feb 2024 06:06:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708524419; cv=pass; d=google.com; s=arc-20160816; b=kB31Le7irYhDRZUpC17qZ5OtO/2VwUAjQ7ybYTrw6Q8QJGXnTXlJEOK9IPSHenQzWk m3iORM8Slkgwrb4bbol4nuBd6CRtiqOw4J7T36goT3RoTXK5jzUUVEfISve6dLh08Aus fYLRLfP0iyIQDj1D1fMWWY+syye+on6sQx5wPCD5E1SsVpYmHi1WTeRE+NODoJvLa4R4 OEYNQv9ZIcPOHz7J5EVM+2LInY+XhAnlTiJnNra3VPLwITjatofzZ4C48GHfCh9ZMnXQ fSUlNyHQre86iX1rY4Kh10Auu11ju9HRXgW0TwHjt0enecTDq1Ksl3BqXyiOFUfR3kbv 6YfQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=aDt6+kmcCWi6Bc2D5DLR7lWbRKR1li7CjmMesntOywI=; fh=KUmwsLzLkhXVl2jJ4u39Wpqo57xilkMpy8GHdaLYkMM=; b=n9yh8iF9AtWzGUNDtCQ93QkDGrw/uwqH9Nh9gVJBr7snYo1lk8FEwipDhjDZOOiPT1 x7P0E0kzHK2nIfKReVrMUHofsXWr1zEXz2zD1huzsuELIhpI8PdyDXf3LDmNyZ+y/Fsz obLMdFCTxjqB5mrATitSzUTL0kAclW0jDLdPJamxwYkJSWoUz8OrjfwtInHlM71QIfCh ruzCWnQezft4ukUOQx6qTJ/MQsHVqYUAjRC2/Q+6kL9abOv/EC6YxKQ2EE9KDPjhpbEf zAI6tQF/q8PatFyW68adJpgiHS5riGMdcqHXdn4oEEOTMYYhEWf3z3AzAAx1/jNBBLjo WSjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=JvPsis4s; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-3862-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3862-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a25-20020a05620a16d900b00787158bd882si10361772qkn.238.2024.02.21.06.06.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 06:06:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3862-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=JvPsis4s; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-3862-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3862-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name 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 0B1C31C234C8 for ; Wed, 21 Feb 2024 14:06:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA8BC7E787; Wed, 21 Feb 2024 14:05:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="JvPsis4s" X-Original-To: linux-wireless@vger.kernel.org Received: from nbd.name (nbd.name [46.4.11.11]) (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 91C9E7E77B for ; Wed, 21 Feb 2024 14:05:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708524346; cv=none; b=PCyQeVEbAZqKsJDLceXHjG9LfZ4V+L1dc2tI1fx09TEKsi2fVu2ebUPVFI5nc347pqar86HZreCla6qkUdTsTEzn3V+qHmubkytIK6uUGxHbcQ6Phw2sO73yirOy337U6AYsnSAOB+LnwM47nRZ2lIakLaLk0gZGnwc2r+fwuLM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708524346; c=relaxed/simple; bh=qsWuKm8evu5K4yUMggc74bA4Y8Lyn6nj2LUILda81uY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=crqEy+gRN3+vyE4wB6cxne/oX9PuQYLt76bKzEZVBFrg6prz3GiPSrCZTbcqCCUUHdPh7/OEyLPy2sd03ZYj98ox+mV4mWPBo6dHbeS2N/hjsjZcWaew6mB3gOGec1v0SasfL4tnFZnQOIyOPGOLuVngJ/pWJIF65awXWcX1pZQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=JvPsis4s; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=aDt6+kmcCWi6Bc2D5DLR7lWbRKR1li7CjmMesntOywI=; b=JvPsis4sRhO1nb72CP4Unhw9f1 /qiRjP2FuqJw4Cvcs5pQTtEmE0i2Ks7fZXDoUBfueC/yvJwJtOZGHjjuDrFc0ET+wuPIyYofsqXov slsaYaeBZjyqeiu6sv2HBVPTkseMFm72RPPrNpsMjoR1aWclkvowmunDCR/NzMXSu+Sk=; Received: from p54ae9e7b.dip0.t-ipconnect.de ([84.174.158.123] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1rcnE8-00FW7u-6O; Wed, 21 Feb 2024 15:05:36 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH wireless] wifi: mac80211: only call drv_sta_rc_update for uploaded stations Date: Wed, 21 Feb 2024 15:05:35 +0100 Message-ID: <20240221140535.16102-1-nbd@nbd.name> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When a station has not been uploaded yet, receiving SMPS or channel width notification action frames can lead to rate_control_rate_update calling drv_sta_rc_update with uninitialized driver private data. Fix this by adding a missing check for sta->uploaded. Signed-off-by: Felix Fietkau --- net/mac80211/rate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index d5ea5f5bcf3a..9d33fd2377c8 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -119,7 +119,8 @@ void rate_control_rate_update(struct ieee80211_local *local, rcu_read_unlock(); } - drv_sta_rc_update(local, sta->sdata, &sta->sta, changed); + if (sta->uploaded) + drv_sta_rc_update(local, sta->sdata, &sta->sta, changed); } int ieee80211_rate_control_register(const struct rate_control_ops *ops) -- 2.43.0