Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1BC4F79CD for ; Tue, 9 Dec 2025 00:03:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765238601; cv=none; b=faQQWBD7rOEW5C/loNd1qXSi2LPJr/+wzVln7+YuJ2eu0llXzufCR+iMlJXjN8HVFvLyGk/DPKIhqkz8NFFiPM14WhMR3Ppve10GqP5QHhgzCdl6YiRg5VFZCByzbuUKFPQewyqS3jWPn247eG7DRiaC/ueL2rjOmuYtJQf2DUg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765238601; c=relaxed/simple; bh=i7FnPjsqC+UINlajQBle8rZQI1Le3YCkfYRSKYgbEwU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jEALjl9YuMPoV64d6IKjcFN20KEnm9rhUZxZ5nfum93vByu0CsVD8zDaIULGwBM/zHEUAyuV2bClgFnwNbp2y0vttc+yf6OvpHBEQTs+D0/dry9yhuzJjk8rsBpar39Yn1ruE6GY2RyssklxCfeG+FaSiBsAVrurBrHfxdXaMDI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=T8RJVpy5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="T8RJVpy5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD3EDC113D0; Tue, 9 Dec 2025 00:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765238601; bh=i7FnPjsqC+UINlajQBle8rZQI1Le3YCkfYRSKYgbEwU=; h=From:To:Cc:Subject:Date:Reply-To:From; b=T8RJVpy5C4ND3qMB4BfUCW35DkNJNZQ9z6taKrTxm63rPjnUHkL2jsEf5lwB2o16L GKuN2lRhSD2ArQH2SS3A+s3I5hn2fI0gJu4mpWspWj+CneaySFT5ipPp+GYf1Hx+zD Uf1yFYVMpwiqSE5YmTnFuyAAQxJ1+7OR7G1H2iyY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53785: mt76: mt7921: don't assume adequate headroom for SDIO headers Date: Tue, 9 Dec 2025 09:02:06 +0900 Message-ID: <2025120940-CVE-2023-53785-2a61@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4126; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=8Te1Ra/pK1r2NMKGlXd/bzFvoOBJh94zj3mjbMbcYXI=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnmaU8sfv7OXrJvCst/fn3N2Fk9Hv5M9x8vzT4YmVKXa Ckqknm+I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACaidJthngJHS8Na//DMBXx/ X22QX7ro8D9ffYb5ofe8Wn/wZAUu+mchvvYby20v5YwfAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: mt76: mt7921: don't assume adequate headroom for SDIO headers mt7921_usb_sdio_tx_prepare_skb() calls mt7921_usb_sdio_write_txwi() and mt7921_skb_add_usb_sdio_hdr(), both of which blindly assume that adequate headroom will be available in the passed skb. This assumption typically is satisfied when the skb was allocated in the net core for transmission via the mt7921 netdev (although even that is only an optimization and is not strictly guaranteed), but the assumption is sometimes not satisfied when the skb originated in the receive path of another netdev and was passed through to the mt7921, such as by the bridge layer. Blindly prepending bytes to an skb is always wrong. This commit introduces a call to skb_cow_head() before the call to mt7921_usb_sdio_write_txwi() in mt7921_usb_sdio_tx_prepare_skb() to ensure that at least MT_SDIO_TXD_SIZE + MT_SDIO_HDR_SIZE bytes can be pushed onto the skb. Without this fix, I can trivially cause kernel panics by bridging an MT7921AU-based USB 802.11ax interface with an Ethernet interface on an Intel Atom-based x86 system using its onboard RTL8169 PCI Ethernet adapter and also on an ARM-based Raspberry Pi 1 using its onboard SMSC9512 USB Ethernet adapter. Note that the panics do not occur in every system configuration, as they occur only if the receiving netdev leaves less headroom in its received skbs than the mt7921 needs for its SDIO headers. Here is an example stack trace of this panic on Raspberry Pi OS Lite 2023-02-21 running kernel 6.1.24+ [1]: skb_panic from skb_push+0x44/0x48 skb_push from mt7921_usb_sdio_tx_prepare_skb+0xd4/0x190 [mt7921_common] mt7921_usb_sdio_tx_prepare_skb [mt7921_common] from mt76u_tx_queue_skb+0x94/0x1d0 [mt76_usb] mt76u_tx_queue_skb [mt76_usb] from __mt76_tx_queue_skb+0x4c/0xc8 [mt76] __mt76_tx_queue_skb [mt76] from mt76_txq_schedule.part.0+0x13c/0x398 [mt76] mt76_txq_schedule.part.0 [mt76] from mt76_txq_schedule_all+0x24/0x30 [mt76] mt76_txq_schedule_all [mt76] from mt7921_tx_worker+0x58/0xf4 [mt7921_common] mt7921_tx_worker [mt7921_common] from __mt76_worker_fn+0x9c/0xec [mt76] __mt76_worker_fn [mt76] from kthread+0xbc/0xe0 kthread from ret_from_fork+0x14/0x34 After this fix, bridging the mt7921 interface works fine on both of my previously problematic systems. [1] https://github.com/raspberrypi/firmware/tree/5c276f55a4b21345cd4d6200a504ee991851ff7a The Linux kernel CVE team has assigned CVE-2023-53785 to this issue. Affected and fixed versions =========================== Fixed in 6.1.55 with commit 5c8bbb79c7cbca65534badf360f3b1145759c7bc Fixed in 6.5.5 with commit 414c0c04703423b78bc9dea1aa6493334dc61f6e Fixed in 6.6 with commit 98c4d0abf5c478db1ad126ff0c187dbb84c0803c Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-53785 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/net/wireless/mediatek/mt76/mt7921/mac.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/5c8bbb79c7cbca65534badf360f3b1145759c7bc https://git.kernel.org/stable/c/414c0c04703423b78bc9dea1aa6493334dc61f6e https://git.kernel.org/stable/c/98c4d0abf5c478db1ad126ff0c187dbb84c0803c