From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793210601; b=2CuT+1dvxgaN7SoD2rSQwQ7iiuM4co33dZx+V6zzuaHQTMNcRxuRTd4ScPeutoi/nQh9 aprFuywk3QVj+SY8WQHgoLfDcDZE6Q7TPdC041KVNlLWDtIL3YozGmM0V06pBPlwOW+cl M5qlTIQA9Dm/FYWcr73IHA4Uy6D80OMghSGOfpBR9fxHejcEc95KDRz2TDYV5m/DLoabC khmx5ddSgZPgBOsbX112Dgnw63Gi3RFWrbfkGmP2Qtb2i5b0VRac3mfc3Z961qqQau1ia GUx2P+YnrQsFMiU4aNLQFrePMRbkNrBvk1CAwXBCg1JFth2hIGIQ8PjOYZavy14JBhA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793210601; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=kdCn7nDVRl/Q2qSTljKi0kHpLL8PDaUR6y78HiMSyQc=; b=bl8pvrfswUB1CTfImgYA5hIV27ySuKQyzZWBLIaWj3ncMDhlz5eW2bXuLe6gQbp+sbwO rKyWWXI9ea6G3U4Xek1fblEe78FyZJRV5vREZOIksCq6NDTeSTT4yrhvss7dzrrxCZMBG TJsgOgarTfPfWY4MQuPL4hI8GLzHO1x93DM9roKKx/rQJJ0xPLc07R0EsdmxQ8gcQvvvk NjUt2dBUlVVzZ9IJ06mNDnrmVyHmlJVv3/n/PuC9z3+Zz2TbCbpnyzd1XhmR5siEuxJSs iLBVGh9a/D1HY07PtgneH67kRc0VAc4L1ZcerKioHU7KY1Thd7MpH62rhuK3gYewCOA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="LC/x7g89"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08BA3606A31C; Wed, 28 Oct 2026 18:03:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=LC/x7g89 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 586251F01825; Wed, 28 Oct 2026 18:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1793210600; bh=kdCn7nDVRl/Q2qSTljKi0kHpLL8PDaUR6y78HiMSyQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LC/x7g895zcDUoPFpbm7PGBAwYkIKvAda+0ye0N6DtOpHzqeyhsx9jpJ916MMRIDZ +zTDavrfh23k/uwtEY9otIWPE365rKEeETBVbwoRAVWAb6NA0YVLYXd2bi7IqzAALk 7fxyUNXp0gNrFdO/M/EQ++Cmkp7/yvYTdnhyOzKs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Daehyeon Ko <4ncienth@gmail.com>, Johannes Berg , Sasha Levin Subject: [PATCH 5.15 038/571] wifi: libipw: reject TKIP frames without a full MIC Date: Wed, 28 Oct 2026 17:53:05 +0100 Message-ID: <20261028170008.930385982@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261028170008.009143722@linuxfoundation.org> References: <20261028170008.009143722@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Daehyeon Ko <4ncienth@gmail.com> [ Upstream commit 06f42accaf3c6aecab1dcc57f68dde6c06c8b380 ] libipw_michael_mic_verify() assumes that an skb contains an eight-byte Michael MIC. A short TKIP frame makes the unsigned payload length wrap, causing michael_mic() to read past the skb. Check that the MIC is present before verifying it, and use the existing MICHAEL_MIC_LEN constant for all MIC lengths in the verifier. Fixes: b453872c35cf ("[NET] ieee80211 subsystem") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Daehyeon Ko <4ncienth@gmail.com> Link: https://patch.msgid.link/20260909061124.3802517-1-4ncienth@gmail.com Signed-off-by: Johannes Berg [ adapted libipw changes to the older lib80211 implementation and Michael MIC helper interface. ] Signed-off-by: Sasha Levin --- net/wireless/lib80211_crypt_tkip.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/wireless/lib80211_crypt_tkip.c b/net/wireless/lib80211_crypt_tkip.c index 1b4d6c87a5c5d..823274728711a 100644 --- a/net/wireless/lib80211_crypt_tkip.c +++ b/net/wireless/lib80211_crypt_tkip.c @@ -38,6 +38,7 @@ MODULE_DESCRIPTION("lib80211 crypt: TKIP"); MODULE_LICENSE("GPL"); #define TKIP_HDR_LEN 8 +#define MICHAEL_MIC_LEN 8 struct lib80211_tkip_data { #define TKIP_KEY_LEN 32 @@ -585,16 +586,18 @@ static int lib80211_michael_mic_verify(struct sk_buff *skb, int keyidx, int hdr_len, void *priv) { struct lib80211_tkip_data *tkey = priv; - u8 mic[8]; + u8 mic[MICHAEL_MIC_LEN]; - if (!tkey->key_set) + if (!tkey->key_set || skb->len < hdr_len + MICHAEL_MIC_LEN) return -1; michael_mic_hdr(skb, tkey->rx_hdr); if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr, - skb->data + hdr_len, skb->len - 8 - hdr_len, mic)) + skb->data + hdr_len, + skb->len - MICHAEL_MIC_LEN - hdr_len, mic)) return -1; - if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) { + if (memcmp(mic, skb->data + skb->len - MICHAEL_MIC_LEN, + MICHAEL_MIC_LEN) != 0) { struct ieee80211_hdr *hdr; hdr = (struct ieee80211_hdr *)skb->data; printk(KERN_DEBUG "%s: Michael MIC verification failed for " @@ -612,7 +615,7 @@ static int lib80211_michael_mic_verify(struct sk_buff *skb, int keyidx, tkey->rx_iv32 = tkey->rx_iv32_new; tkey->rx_iv16 = tkey->rx_iv16_new; - skb_trim(skb, skb->len - 8); + skb_trim(skb, skb->len - MICHAEL_MIC_LEN); return 0; } -- 2.53.0