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=1796388257; b=WiYG3dR5BJdcNBjdTOiKGntoOxNPajW2u0EAqTa2KgveFmO4OkcmexFhmjBj01zOyJmC aIMQ1h5HGswHcMo8aMF52yVbVo9hzyv8fnQ+5BEklDQT3LUQ2SLjDNOnN48Dmz7ibi+/U XckF1hZmA7AUyezBZUp8gIBc54SSsdKbL+lvdyC0l1JmUuLk7pfp3SpiECIPCYcUoHybq 7ZjoWLtR6XBuNfE8fNyQ685moa+hIynpxcQEwlSsIPgBPA3y8xAmxGFEmwE/2qkglFT/v okBPCR+lrj60dwKoi8zEQ/3O+JqZwMKIjD440TMx1tmvpye4hKVs645B1nST7l/wkuw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388257; 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=5pGTCE7ttRycIM2vOmPm7W0W1rVNjVz3hwxSX5Vun/U=; b=UCcxv7PYP+gkt7tz5IBDGJF5QDGeqrWZvj7nWmUHdWn+NNq737fVX+i5tCNOoNuwSe2L YhrA/tLTQN0V0pAY9S32AQ5J8YJ9RiR5zoiQNhvf8BbR5jEu7gfw2uEYLu4YZPECa9L/e 5Fq38lb3zKlmtEZg0MPxf92QfzP8C6KJScT1Udvs0Xr7BDknUdJuLS6gQ7SJVzrGCG4Ic 0NFKmPm/HSXbKOakIPD4OuBHK9mLts/iwuoAuJ2wINTIOh8n2nU+T3p6EdrfYYUMyjwpa z388TQ5/B4sIBwLuwbIJh87JTwH8FNQAYbnqJSuCwyqTK0toocYbI+EZDAUQHbcb9Bg== 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=MZjPDcRg; 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 26AE0606A322; Fri, 4 Dec 2026 12:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=MZjPDcRg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 953AF1F00897; Fri, 4 Dec 2026 12:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388257; bh=5pGTCE7ttRycIM2vOmPm7W0W1rVNjVz3hwxSX5Vun/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MZjPDcRgorPNkF8S2Q+/pvqzgo0E/W4EX7Ic4ZoJsoyedMWKY/yOpGz4d7WdO1pWJ O0K0KWGeUbE9+AJKGXnXbQVICoCN35clNHmbGIO0j/ESAjwBgsiiAGp8h80upWtpno j9rJo9xdYSE9jaRHRuv48BxjAQ8N7zBmQqIvtdjs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhao Li , Johannes Berg Subject: [PATCH 6.1 0546/1059] wifi: mac80211: recheck injected headers after removing FCS Date: Fri, 4 Dec 2026 19:01:17 +0900 Message-ID: <20261204100658.341411541@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhao Li commit 339564c7ac50464695dfed847f89d118f4cc1dc5 upstream. Injecting a short frame with IEEE80211_RADIOTAP_F_FCS on a monitor interface can pass a truncated 802.11 header to transmit handlers. ieee80211_monitor_start_xmit() validates the linear 802.11 header before parsing radiotap. Radiotap parsing then removes the four-byte FCS without rechecking the remaining header length. Software encryption can subtract the larger header length and pass the resulting negative length as an unsigned size. Recheck the required linear header length after pulling the radiotap header and before handing the frame to the transmit path. Require at least addr1, which the transmit path reads even for extension frames whose header is shorter. LLM assistance was used to find the bug and review. Fixes: bddc0c411a45 ("mac80211: Fix NULL ptr deref for injected rate info") Cc: stable@vger.kernel.org Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261028142101.11994-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/tx.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2505,6 +2505,12 @@ netdev_tx_t ieee80211_monitor_start_xmit /* remove the injection radiotap header */ skb_pull(skb, len_rthdr); + /* FCS removal may have shortened the 802.11 header. */ + hdrlen = max_t(int, hdrlen, + offsetofend(struct ieee80211_hdr, addr1)); + if (skb_headlen(skb) < hdrlen) + goto fail_rcu; + ieee80211_xmit(sdata, NULL, skb); rcu_read_unlock();