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 1FB533C1D6D; Thu, 30 Jul 2026 14:28:03 +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=1785421684; cv=none; b=MjOmfFZ6j3aQPSSA6qx2ti/TxNINzHU8pJrcAhhPujnbeDEuv23XpkQ2QjXZ8XjEPxm7CLCI69sRi7ibHCm+I+wJr2m5c6cxx24UENSvwXc4IKmP2LTPF6t4RlUgwK1/2uDnRzfJUigo1KY6udU7UwVoQ77syrwEyhA2P3icFJ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785421684; c=relaxed/simple; bh=YneAF2vY6mpTU/1liqTHPjx/fKg3rutrJB/EBInQeJE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bzqyUphWCadL1+rnoG5+/FYj47jukt5KZlH+zrtXFI1Ovvue8Hw5QbjB0ENILG2rkSBgptJWzF5+9n2XQtbk6K5Q0KkkHpGDCt33ZSXXm/yYExjLxJFzABYWkNmtqEp/pNgKqclfluXad4ud3BRhJ0kxTYzPgUhQkf4RIQz1Fi4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=h3PzgIH/; 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="h3PzgIH/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A2861F000E9; Thu, 30 Jul 2026 14:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785421683; bh=e/p6I8kLNQGcVzQkuG0wKmEC+qf0+XI/bdGBYrmg6XY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=h3PzgIH/ULcZrMilQZA1GhyZGw7dzCXgbzp7gWE+AfhWq0VPO+28jE3GeRvg1ZLF6 IFxfpKl6Q+Jgg2IGlRO3cuT7kIvvX/XjsaHBiP/qQB9xzje9x5W0LUf/xWQGmNRUxk lCLvMkKVb01yMwRHeRTq721nkSi7VbXwZRZwrkHw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tristan Madani , Jeff Johnson , Sasha Levin Subject: [PATCH 7.1 187/744] wifi: ath6kl: fix OOB read from firmware num_msg in TX complete handler Date: Thu, 30 Jul 2026 16:07:40 +0200 Message-ID: <20260730141448.260704163@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141444.267951807@linuxfoundation.org> References: <20260730141444.267951807@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 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tristan Madani [ Upstream commit 3a21c89215cc18f1a97c5e5bfd1da6d4f3d44495 ] The firmware-controlled num_msg field (u8, 0-255) drives the loop in ath6kl_wmi_tx_complete_event_rx() without validation against the buffer length. This allows out-of-bounds reads of up to 1020 bytes past the WMI event buffer when the firmware sends an inflated num_msg. Add a check that the buffer is large enough to hold the fixed struct and the num_msg variable-length entries. Fixes: bdcd81707973 ("Add ath6kl cleaned up driver") Signed-off-by: Tristan Madani Link: https://patch.msgid.link/20260625232907.3620746-1-tristmd@gmail.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath6kl/wmi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 72611a2ceb9d8e..7e65a03be0b7bb 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c @@ -484,6 +484,18 @@ static int ath6kl_wmi_tx_complete_event_rx(u8 *datap, int len) evt = (struct wmi_tx_complete_event *) datap; + if (len < sizeof(*evt)) { + ath6kl_dbg(ATH6KL_DBG_WMI, "tx complete: invalid len %d\n", + len); + return -EINVAL; + } + + if (len < sizeof(*evt) + evt->num_msg * sizeof(struct tx_complete_msg_v1)) { + ath6kl_dbg(ATH6KL_DBG_WMI, "tx complete: invalid len %d for %u msgs\n", + len, evt->num_msg); + return -EINVAL; + } + ath6kl_dbg(ATH6KL_DBG_WMI, "comp: %d %d %d\n", evt->num_msg, evt->msg_len, evt->msg_type); -- 2.53.0