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 BF39413A25F; Tue, 9 Jul 2024 11:23:48 +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=1720524228; cv=none; b=JGtva7Wbe3cTC0jrAbQBJDM2+EfkyzHNlJU0WSvTEcirabfumpuYGii2fMrOoNYEBNDuQldSvmfk83gvrBhTzDnRGEfIjLMHRAPNwwMIinElyFQm1pqi1KHwx3YKoaBrcYMIzHgh/lvJwaJB33vEdpV5lyXwAXDu9qw7ObCGWKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720524228; c=relaxed/simple; bh=Hr1+WMGVNMT9wJRRTsHHU9NRUJXuoti6pZ74ty2jG7k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cReMrTjcODvsJi1E/ycMhG1KGeJ5JmrNYuq2i8HFd2gMsDKFnj2jqxml64Iwhm+Pf6cbpfdrbJ4FCsmv/aX79BnNj5nqPvUvbb5GcIrcQ19kFmZ92mYwqk8HTaxLCMko4kvSmojArpdHI/Yj/62mbCn+VkBFRBya4GcJEMLu7Dg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PcAz7OBr; 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="PcAz7OBr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A3FDC3277B; Tue, 9 Jul 2024 11:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720524228; bh=Hr1+WMGVNMT9wJRRTsHHU9NRUJXuoti6pZ74ty2jG7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PcAz7OBrOqlr536lqbd2yk4z+iN7HNvypzL+pca8vFgIhT0Rqs+E3sW4brf8HzenT cKRNphYYQqpi5t4tcD641HPX229g47OXafZ3em1whoxiGB63pfqKwA5Jh+3OyaiAQD GhqZXO1nMhchGrHg07MEpl0NY+BqPVoFzLu4+7E8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jozef Hopko , =?UTF-8?q?Alexis=20Lothor=C3=A9?= , Ajay Singh , Kalle Valo , Sasha Levin Subject: [PATCH 6.9 114/197] wifi: wilc1000: fix ies_len type in connect path Date: Tue, 9 Jul 2024 13:09:28 +0200 Message-ID: <20240709110713.365341540@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240709110708.903245467@linuxfoundation.org> References: <20240709110708.903245467@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jozef Hopko [ Upstream commit 39ab8fff623053a50951b659e5f6b72343d7d78c ] Commit 205c50306acf ("wifi: wilc1000: fix RCU usage in connect path") made sure that the IEs data was manipulated under the relevant RCU section. Unfortunately, while doing so, the commit brought a faulty implicit cast from int to u8 on the ies_len variable, making the parsing fail to be performed correctly if the IEs block is larger than 255 bytes. This failure can be observed with Access Points appending a lot of IEs TLVs in their beacon frames (reproduced with a Pixel phone acting as an Access Point, which brough 273 bytes of IE data in my testing environment). Fix IEs parsing by removing this undesired implicit cast. Fixes: 205c50306acf ("wifi: wilc1000: fix RCU usage in connect path") Signed-off-by: Jozef Hopko Signed-off-by: Alexis Lothoré Acked-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://patch.msgid.link/20240701-wilc_fix_ies_data-v1-1-7486cbacf98a@bootlin.com Signed-off-by: Sasha Levin --- drivers/net/wireless/microchip/wilc1000/hif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index f1085ccb7eedc..7719e4f3e2a23 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -382,7 +382,8 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss, struct ieee80211_p2p_noa_attr noa_attr; const struct cfg80211_bss_ies *ies; struct wilc_join_bss_param *param; - u8 rates_len = 0, ies_len; + u8 rates_len = 0; + int ies_len; int ret; param = kzalloc(sizeof(*param), GFP_KERNEL); -- 2.43.0