From patchwork Wed Feb 21 14:05:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 775524 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="JvPsis4s" 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 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)