From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 ED680385D7B; Thu, 30 Jul 2026 16:04:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785427475; cv=none; b=qYZ45JL0w9QArqPpJhUsY4b8sXrUgE9zF6x9rU5xiZw8tuEZpz/SKGcDngmavHODT+hpnWDXtQ7MmmnlEhciJmO2o56zi7aFO3zqDP4/D8m/WmSPTtKUcrUBpunk5gZWUv5C3gfcWT3b3iSIbaLiiMLklZDH09HV2xoX6JH585w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785427475; c=relaxed/simple; bh=SQgK9n3B1lV8nsNWfNINqbtM6EwkzTFGUK/veWfa76o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ruicVBa6uUEFkIttQrNoTRla0716nzyu8cVtZBfbIzOwXpSheml3ILxFhsVU61x4AKkdmZB82pxfXlV0+TL5famwEnBRbInOX0jGxBt8LXfIseL4NySPcu01a5OaPT2kh1iE5eSoS9x2Ec2QUNDf+7v6pb69WW8ns4bXsCaIoS8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q8MTaWp7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Q8MTaWp7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46CEB1F000E9; Thu, 30 Jul 2026 16:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785427473; bh=kDihNTMi1doSW0j+S6acWTrYijA8IzJ1YwqCqK3rCm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Q8MTaWp7LXMfhg/jDXFkITat1n0ZLnaPaDkdITKBZP4EQWxjblii4pmGnFaQ8HQ4F 2YcUqt0S9v4/10BXa6il3lTsbpyUAX6gpGVXcCxALCYBdxxD04YtJD4e8lT+LVr0S1 dRdwBfzpYGQQ9Hpiw1U20rb7KJab4Jj4pzBz5aos= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shahar Tzarfati , Miri Korenblit , Sasha Levin Subject: [PATCH 6.6 138/484] wifi: iwlwifi: mvm: fix read in wake packet notification handler Date: Thu, 30 Jul 2026 16:10:35 +0200 Message-ID: <20260730141426.457794575@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141423.392222816@linuxfoundation.org> References: <20260730141423.392222816@linuxfoundation.org> User-Agent: quilt/0.69 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-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shahar Tzarfati [ Upstream commit 9d7657aae8c1579584c67b0b66114a6a98db8b2f ] In iwl_mvm_wowlan_store_wake_pkt(), packet_len was initialized from notif->wake_packet_length before the explicit check that len >= sizeof(*notif). Move the assignment of packet_len to after the size check so that notif->wake_packet_length is only accessed once the payload length has been validated. Fixes: 219ed58feda9 ("wifi: iwlwifi: mvm: Add support for wowlan wake packet notification") Signed-off-by: Shahar Tzarfati Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20260715215523.99d5cf85a528.Ic4aa736011d4fe88e0cd19723d1d48bb24642198@changeid Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index ac304e21a36727..51abcd20ffbd60 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -2812,7 +2812,7 @@ static int iwl_mvm_wowlan_store_wake_pkt(struct iwl_mvm *mvm, struct iwl_wowlan_status_data *status, u32 len) { - u32 data_size, packet_len = le32_to_cpu(notif->wake_packet_length); + u32 data_size, packet_len; if (len < sizeof(*notif)) { IWL_ERR(mvm, "Invalid WoWLAN wake packet notification!\n"); @@ -2831,6 +2831,7 @@ static int iwl_mvm_wowlan_store_wake_pkt(struct iwl_mvm *mvm, return -EIO; } + packet_len = le32_to_cpu(notif->wake_packet_length); data_size = len - offsetof(struct iwl_wowlan_wake_pkt_notif, wake_packet); /* data_size got the padding from the notification, remove it. */ -- 2.53.0