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 306A83D9DB9; Wed, 8 Apr 2026 18:56: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=1775674608; cv=none; b=iy6Gqa7ffOxYjCkg1R+VsfhYMT64VMphbFR+SGcFfuYa8qfbDa7peM4K72kH+xB1ul3Oq5ND1JrbJxmccIG20lHjmfTmZ0iy/xU1PER8C/MQBTZAwR0aNHx7xddfranvOCznh73jpSfJi2IIi3WxKKRlq/bufMVVDreWaa2/Y1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775674608; c=relaxed/simple; bh=aG3SaGh4nSzhRRLKdVmBxsx14HX0YTGSmlC1SUb1ezA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SqSQq7VkgMIQgiI2wpS/exwLBmQ9u689NE/IGzu9gF7RtPuJXanHVFOK2e8lETMXX8/5Hs57OZXQ3T8qPsqCQa9DS4QlLbbsoltMS7qZP8OW6Qi/AghTfGvbPkyJjKzAuJVApUS7vX7t+zXEZWG0Ec56aET/iufOIgX9vFNCRiI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=t3QTkRs7; 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="t3QTkRs7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93BAAC2BC87; Wed, 8 Apr 2026 18:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775674607; bh=aG3SaGh4nSzhRRLKdVmBxsx14HX0YTGSmlC1SUb1ezA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t3QTkRs7gN2UMGWNfgz1DDQ8lBbmmsYQy4CQwXFeceKnPICYv6hP1nV35EzezKOU5 A8GMWU8HUdsvlGAlUDNMaBQkZrq71oAz9acTIPkS6tWIGG6UpQgHEk8S/eDuY68wk7 pRFHB3UA4BYe4QUyZBYGJJoqhByAj9WiPEX+Pwq4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yasuaki Torimaru , Johannes Berg Subject: [PATCH 6.19 163/311] wifi: wilc1000: fix u8 overflow in SSID scan buffer size calculation Date: Wed, 8 Apr 2026 20:02:43 +0200 Message-ID: <20260408175945.489636600@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175939.393281918@linuxfoundation.org> References: <20260408175939.393281918@linuxfoundation.org> User-Agent: quilt/0.69 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-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yasuaki Torimaru commit d049e56b1739101d1c4d81deedb269c52a8dbba0 upstream. The variable valuesize is declared as u8 but accumulates the total length of all SSIDs to scan. Each SSID contributes up to 33 bytes (IEEE80211_MAX_SSID_LEN + 1), and with WILC_MAX_NUM_PROBED_SSID (10) SSIDs the total can reach 330, which wraps around to 74 when stored in a u8. This causes kmalloc to allocate only 75 bytes while the subsequent memcpy writes up to 331 bytes into the buffer, resulting in a 256-byte heap buffer overflow. Widen valuesize from u8 to u32 to accommodate the full range. Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver") Cc: stable@vger.kernel.org Signed-off-by: Yasuaki Torimaru Link: https://patch.msgid.link/20260324100624.983458-1-yasuakitorimaru@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/microchip/wilc1000/hif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -163,7 +163,7 @@ int wilc_scan(struct wilc_vif *vif, u8 s u32 index = 0; u32 i, scan_timeout; u8 *buffer; - u8 valuesize = 0; + u32 valuesize = 0; u8 *search_ssid_vals = NULL; const u8 ch_list_len = request->n_channels; struct host_if_drv *hif_drv = vif->hif_drv;