From mboxrd@z Thu Jan 1 00:00:00 1970 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 728B0258EFB; Mon, 18 Aug 2025 13:13:15 +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=1755522795; cv=none; b=FFydx5LUfRYcnkNtpNniNxveAIDYHpKyQuylXujowSQAaRQ9KIIuz6dT4YY2vEFiJrBSrYJhgXxxG2mAOjykWmhhm38Vy6DxwYRwzkHqRLgvZeO7uZAOLmWcxYbzuHlzqq+dOlDBTz+xgsmTtUT6ATd3ugbj9dl3ASWBAcm0lBE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755522795; c=relaxed/simple; bh=Au/IuEnBF0NOzWXS76XTTToioWt7lF+E+nlfhdSs6KU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LXPq14704PlsDerfuK3SpMjiXdpgT0C1FJB/I+H+4X2ZlWz/5IUrYz4YhRJsCyBDlZVE4z/gwQnz2sk8WPKODtu7/udm+0ayeLaEOBSnTDeZoDE+5y/sQh3oBFyvWnQEGlHfJe3c1ERr7xJAQTvX2PjugD4XDxI/sFk9E9aJGa0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CuXBw20O; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CuXBw20O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB9A2C4CEEB; Mon, 18 Aug 2025 13:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755522795; bh=Au/IuEnBF0NOzWXS76XTTToioWt7lF+E+nlfhdSs6KU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CuXBw20ONJ3v3ocv7xa9hhNK0oxNaxaITWiD7idvwj6mzUFKaz6isrfE7a6TUiBWX t41GOUSOrsdyp4FIel7orkLmkV5KDw6DPxTQe1yHzdsglrrzN9YXSJQ5jAtfBCfKw/ GgUzzAW2uBBEEEqhZHaKYRXzaLmwh0an32r/6vqc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikhail Lobanov , Johannes Berg , =?UTF-8?q?Hanne-Lotta=20M=C3=A4enp=C3=A4=C3=A4?= Subject: [PATCH 6.12 423/444] wifi: mac80211: check basic rates validity in sta_link_apply_parameters Date: Mon, 18 Aug 2025 14:47:29 +0200 Message-ID: <20250818124504.803178253@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124448.879659024@linuxfoundation.org> References: <20250818124448.879659024@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikhail Lobanov commit 16ee3ea8faef8ff042acc15867a6c458c573de61 upstream. When userspace sets supported rates for a new station via NL80211_CMD_NEW_STATION, it might send a list that's empty or contains only invalid values. Currently, we process these values in sta_link_apply_parameters() without checking the result of ieee80211_parse_bitrates(), which can lead to an empty rates bitmap. A similar issue was addressed for NL80211_CMD_SET_BSS in commit ce04abc3fcc6 ("wifi: mac80211: check basic rates validity"). This patch applies the same approach in sta_link_apply_parameters() for NL80211_CMD_NEW_STATION, ensuring there is at least one valid rate by inspecting the result of ieee80211_parse_bitrates(). Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: b95eb7f0eee4 ("wifi: cfg80211/mac80211: separate link params from station params") Signed-off-by: Mikhail Lobanov Link: https://patch.msgid.link/20250317103139.17625-1-m.lobanov@rosa.ru Signed-off-by: Johannes Berg Signed-off-by: Hanne-Lotta Mäenpää Signed-off-by: Greg Kroah-Hartman --- net/mac80211/cfg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1879,12 +1879,12 @@ static int sta_link_apply_parameters(str } if (params->supported_rates && - params->supported_rates_len) { - ieee80211_parse_bitrates(link->conf->chanreq.oper.width, - sband, params->supported_rates, - params->supported_rates_len, - &link_sta->pub->supp_rates[sband->band]); - } + params->supported_rates_len && + !ieee80211_parse_bitrates(link->conf->chanreq.oper.width, + sband, params->supported_rates, + params->supported_rates_len, + &link_sta->pub->supp_rates[sband->band])) + return -EINVAL; if (params->ht_capa) ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,