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 2A2173B0586; Thu, 17 Sep 2026 18:05:35 +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=1789668337; cv=none; b=JYzDRUNp9XtTxRgIK0G1TYkzWWvfmGLNLKQ4nMqj3B5R3hD/aaZoEP04j+6ducEKVQhFMxe2wNM4YZOalUAOb96SARCZeUSFnDVUa63YqVVXFbNJUAjZMjPnQu2TzF/ZnuWkPhI+hK8O1qPtmxOiA8yUeut8sygYvCzYGiPaXzE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789668337; c=relaxed/simple; bh=sxTzOd5TmPhWSUWqrABKnrNXfSdIw5LUvgdoenku13c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pEAIQg1sNGIzxJP7nNyQChm+iRjZNPbB6vIsRi6c/NNV3vzK+aV+X1gm8g3X/uO0cSQUDe8GwhGx/Fp2R7u94VEsKMTmHcx/vFbxT4NqPdqnV14JvDpNOJiVLkOAphbnQ8o370KwSkmKtKqwQTOoQ4fjwc1UrfHF6qtT4xqv9eo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lze6V+5t; 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="lze6V+5t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32E571F000FF; Thu, 17 Sep 2026 18:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789668335; bh=rz/24nhyrqH8lznnxLtPIgcrBmIrKz9oStr/O3B+lg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lze6V+5tXcJE/JJzXbptxGLYFd8uU+syT148zh0lYL6RIiRa1KjiX6AapV2CvZT9/ 5dGikmr1LFEUyhWsnvaxo+vYkcveSkx0fI8ix7IG4czyr1FN1fsKAE8Oek9pLTZtk1 Z8m2RFZaJ684HNSA79G65aymcTPkJsJjG3ExVaXw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pengpeng Hou , Johannes Berg , Sasha Levin Subject: [PATCH 6.12 0391/1102] wifi: libertas: reject short monitor TX frames Date: Thu, 17 Sep 2026 16:05:34 +0100 Message-ID: <20260917151549.473350091@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pengpeng Hou [ Upstream commit 13ff543e0b2c713aedeaadadde686686e949dc78 ] In monitor mode, lbs_hard_start_xmit() casts skb->data to a radiotap TX header, skips that header, and then copies the 802.11 destination address from offset 4 in the remaining frame. The generic length check only rejects zero-length and oversized skbs, so a short monitor frame can be read past the end of the skb data. Require enough bytes for the radiotap TX header and the destination address field before using the monitor-mode header layout. Signed-off-by: Pengpeng Hou Link: https://patch.msgid.link/20260704011140.37639-1-pengpeng@iscas.ac.cn Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/marvell/libertas/tx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/marvell/libertas/tx.c b/drivers/net/wireless/marvell/libertas/tx.c index 27304a98787d6..13d08022e4141 100644 --- a/drivers/net/wireless/marvell/libertas/tx.c +++ b/drivers/net/wireless/marvell/libertas/tx.c @@ -117,6 +117,13 @@ netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR) { struct tx_radiotap_hdr *rtap_hdr = (void *)skb->data; + if (skb->len < sizeof(*rtap_hdr) + 4 + ETH_ALEN) { + lbs_deb_tx("tx err: short monitor frame %u\n", skb->len); + dev->stats.tx_dropped++; + dev->stats.tx_errors++; + goto free; + } + /* set txpd fields from the radiotap header */ txpd->tx_control = cpu_to_le32(convert_radiotap_rate_to_mv(rtap_hdr->rate)); -- 2.53.0