Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2573092lqp; Mon, 25 Mar 2024 03:07:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXSjLomurSni1k6Jh29JGieG3O19HYnkj0CQj3YIeay/TegLRH/DnWJY/3hS+ioiIwGbwfBgW5WsZJDVt35Ae/6bY74RRVTKq9DDH+7Qw== X-Google-Smtp-Source: AGHT+IEYFK2Zyl1JvYYoeBuYuFk8yvQRxXR8MInou5rOUVJk70Vz1u+Hh4FG/XwmgDZAg11r1/Mg X-Received: by 2002:a17:90a:dd92:b0:29c:4395:b931 with SMTP id l18-20020a17090add9200b0029c4395b931mr4340342pjv.10.1711361255315; Mon, 25 Mar 2024 03:07:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711361255; cv=pass; d=google.com; s=arc-20160816; b=b0/lvwqXveIMX9Dk9K7VSpGlFHlyP7hpdZvPeGX/JXKksyGiKMu36KFVWhx5eeiYGO s7Ir1zw5Emk/SU6nJ/eT6dhvocB5EFEVXa5c7NHAc7Ee0CR6vEe/osW9RtHfnsLcTtLT dbshZwHkZNRAE9fhuj6joYCx37+i47W8yxg7j/FHrnVsw7mWzZyFyV0f8UDYlSgkkoOq DZ2wEeGhjqSCRS2q4l3nZULoz4OycvZRIoVUSsBKLgENBzH3kZlFAGQBd9AxXhzvmSC1 sxCz0PIG2t65jcq9g+DBAaZDAKWn5DgMXufNZ6ALo9DghbkSI34X56bupuOam3d6U2br HxPg== 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=YghPwAObSLHan/gGtbCqZ/2HLz7zhQ63yBcy1+MrgMo=; fh=zTF3+X3LZUFTHmUF68u4UFV/bkLx1c1W1c+R7cYxPQg=; b=uJ/Kx1uPo1TjW6vib2EF1hs/IxruC6KWpk7ZBS8s10/so25BFBjGuMsHk9XDL3KsZr Twk9V5lVwrECplbRS/WmkzWLJ5xhHd+wHg5lp75aPqcUNJWJHbkcD+SAArYiRe6aA6TX D2xwVwDvkrpFGk5M76zDKjjsnOtuHdaa+hqZRpw/zR+RlsVZ3U9mEPknb4kGpIa8IYHQ 6ixfDQ++YFPtbpIvFQ4JOxmoAwkBEDOB4Y6srGebtc7Th5EC2XIN4jJkpU7rtkOvJKEZ sWrNaK8fW3YHwrXwOe+xgpRMxFB44fJfiuME6/aXYj+as59+J33IYl/knCUhHWWzmZqa hRwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VbVS5Y98; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115768-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i10-20020a17090a974a00b0029e061c54e2si7257037pjw.25.2024.03.25.03.07.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:07:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VbVS5Y98; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115768-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4F50BB24278 for ; Mon, 25 Mar 2024 09:17:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C38BC2618F4; Mon, 25 Mar 2024 03:00:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VbVS5Y98" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6FB3B145323; Sun, 24 Mar 2024 23:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321971; cv=none; b=emlWo5wl9mtlMKOkTTLXQhMRf/ttntMxIa+XDZCu58XnRbk/SspAXNxl+f3MMTgdVbQ3aIT2vPjjEsmmbE4Xy61SEpYLCEOLvxbJJ5xrXq4KRNAlSeBSxzjoCJhgPPU2gfIx2Z52bPi2mr8MOqaQubffT4aeRcRl6mSLBe4UBwM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321971; c=relaxed/simple; bh=S9i6rVDTLrc92ZdyKfg4Ixk7H6eGpB3PH6E05e+MPh0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tXY3jWZT02nggqLbQtAPMnbNXkelSaMYQBtYxFIjzTGTpekjLKuSZNINpADx5wDCopeqCf/BrV6DCXG728FB2FtjDfYPUV6mSyX9g+bzOPI7XF0HZ1T5T32uuI2C4kC3W0G/01bf26/kDwaaon0Is/JjCQwsAO51QlvJ/Ropv64= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VbVS5Y98; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA4CFC43390; Sun, 24 Mar 2024 23:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321971; bh=S9i6rVDTLrc92ZdyKfg4Ixk7H6eGpB3PH6E05e+MPh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VbVS5Y98jZPtumrEtneMHJXzI8B+VXCF2glZTaDkTLvoBgEFrd/r2lDWIRk8iDiIN p3DDzv71HwInwf5OVmcU7/hMcaap7DGNhlpMrIUKSezRdQBfGwO6vA2RVtQo01Id5j q3pOlrQ2xxT7ju6E19+aHsEQYlpZqSkAdkceoUaFnDHtMlWJIFxfiDf/dnyKXTWAqp CRDcC71XMIXodoy9vaFih8p8SkciI8AUeyu7XLmH8fUZOrE0w6K/Fv3Te2Ls3KQP0C ZncwH/hfBHfXO+OLrrlSf4ChuUwDp0vAu8A5geMXZPvp6TU8oMAXRZ4IY/C7b9be7P D68EdQnk4UQqA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Felix Fietkau , Johannes Berg , Sasha Levin Subject: [PATCH 6.1 043/451] wifi: mac80211: only call drv_sta_rc_update for uploaded stations Date: Sun, 24 Mar 2024 19:05:19 -0400 Message-ID: <20240324231207.1351418-44-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Felix Fietkau [ Upstream commit 413dafc8170fcb925fb17af8842f06af305f8e0b ] 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 Link: https://msgid.link/20240221140535.16102-1-nbd@nbd.name Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- 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 d5ea5f5bcf3a0..9d33fd2377c88 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