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 9624B3DA5A0; Wed, 8 Apr 2026 18:56:50 +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=1775674610; cv=none; b=q2VA0B3BhTX/XXuv6UDes3ZXIkdSoXekwZFOEzn0venAm1e+36z3duN0/eJRwL66rynrXbsomVyjn0Qzq4LqJB3NRU+C/4Z/MYTE4LgeYDokDaFSIU5Xi2T0CQRl5/AYLvIAdGwhC8amXIhRYiGlG4ONnKtZcR2uz29B1txlQ/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775674610; c=relaxed/simple; bh=7GnW0qinQcn5ffJeRYx8l+aiwp2X0RrQ5YlX2VWnGZI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nZ3KPv4DeY0W+Qh7mmLwz9xR9xL/YtGw7EhdcecAIwXtfy4rKkQI3CPAdFtqwJIHHFAXOj4CbG3Qt1xztrCpKuLTXk1zZn0tVRiGO1nsJMYJdaUucFrZm3oWIprFXg5u4esdwKJd8Av8EsMM4mXP8izmqU/dKP5iFgB5NUxxwmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=scG1v9fy; 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="scG1v9fy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C91FC19421; Wed, 8 Apr 2026 18:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775674610; bh=7GnW0qinQcn5ffJeRYx8l+aiwp2X0RrQ5YlX2VWnGZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=scG1v9fypET2ScOgrTt0iHuGzcL9+kF8NHYctseuRo+mhviHtqFhKsae9xfqGfE8v wfwkVGCAfc4kEj/g8MpIxHN0W5ctGmUa0KXlIWpO5A+rH+twzdPpihz1JWfQFsI/Qv jRIJYs626xV5JnkcoXdxouiHkudMfsEdjGSsB8ao= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alexey Velichayshiy , Johannes Berg Subject: [PATCH 6.19 164/311] wifi: iwlwifi: mvm: fix potential out-of-bounds read in iwl_mvm_nd_match_info_handler() Date: Wed, 8 Apr 2026 20:02:44 +0200 Message-ID: <20260408175945.526531733@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: Alexey Velichayshiy commit 744fabc338e87b95c4d1ff7c95bc8c0f834c6d99 upstream. The memcpy function assumes the dynamic array notif->matches is at least as large as the number of bytes to copy. Otherwise, results->matches may contain unwanted data. To guarantee safety, extend the validation in one of the checks to ensure sufficient packet length. Found by Linux Verification Center (linuxtesting.org) with SVACE. Cc: stable@vger.kernel.org Fixes: 5ac54afd4d97 ("wifi: iwlwifi: mvm: Add handling for scan offload match info notification") Signed-off-by: Alexey Velichayshiy Link: https://patch.msgid.link/20260207150335.1013646-1-a.velichayshiy@ispras.ru Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -2834,7 +2834,7 @@ static void iwl_mvm_nd_match_info_handle if (IS_ERR_OR_NULL(vif)) return; - if (len < sizeof(struct iwl_scan_offload_match_info)) { + if (len < sizeof(struct iwl_scan_offload_match_info) + matches_len) { IWL_ERR(mvm, "Invalid scan match info notification\n"); return; }