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 C22E13A1E92; Sat, 17 Oct 2026 17:52:48 +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=1792259570; cv=none; b=pi96mXrW25FWLjGjXEroocPjcJZkXRASt9gLa5nmt2ytv4k7TArP3o1kg/7ezqpRldPLchg6HdJ/MBwBpkPrEjMsRmYyVJBfzTi2k/oT1QDEpJcmMaD3VH+oGxTjTkTcE7hF0C3Q0PfnyPBUcbdemM9eeFA6efshPtaXjRw7gVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792259570; c=relaxed/simple; bh=XLPIWB0uPIgXHFvVYiIVrOwOABy/dMn3a9rfXF6YLxs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DbD0ROwb5dxcoMqXLL0QehEUWr+gA8RHNnOFDvZnj4PWpNxi1g5c+wNqQx0HFXUqR/AG8SsbTFzdQJPpirfAoFBfa7rOYoBoIB4lJQ03Qe0/ho9IWFsJT4t7yQWjDk2dukbPnLdS5UHSJw7j5D5Qw9YF8Iv17Wm7UzyYwDFGGds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rzi6GIxC; 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="rzi6GIxC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EA231F000C4; Sat, 17 Oct 2026 17:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792259568; bh=kfM3pdZYv/etZbUXOLeRwXEeaG0ByXDe423x00Fc4I4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rzi6GIxCQuovWRk5sU2qkZiZKic2Bye4/uJSFZoiKgHk2Bmhb69KiBEc3WSHTlDq3 udwUHsTmCA9quxYSWzdajGCOcQJ2LFiKEkEIImJaHLj30YZWYDHs9yJi21h1Rg+nPp myFhlPfF6whBg5P4xbXEvH/OIovL7+nJ4IKg8Dvg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bryam Vargas , Felix Fietkau , Sasha Levin Subject: [PATCH 6.6 1257/1674] wifi: mt76: mt7915: bound the device EEPROM address before the EFUSE copy Date: Sat, 17 Oct 2026 17:58:49 +0200 Message-ID: <20261017160503.407132277@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bryam Vargas [ Upstream commit 44b5adfe49499f53002737f5fe81d608c08122fc ] mt7915_mcu_get_eeprom() copies a fixed EFUSE block into the driver's dev->mt76.eeprom.data buffer at the offset reported by the MCU response (res->addr, a device-controlled __le32) without checking it against the buffer size. A malicious or malfunctioning device can report an arbitrary address and drive a 16-byte out-of-bounds write past eeprom.data. Reject a response whose address would place the copy outside eeprom.data before deriving the destination pointer. Devices that echo the requested in-bounds offset are unaffected. Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Cc: stable@vger.kernel.org Signed-off-by: Bryam Vargas Link: https://patch.msgid.link/20260625-b4-disp-16f99062-v1-1-aee52ecf61b9@proton.me Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index ce51bb27f7a4f..8e2ee4ef0c81a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -2858,8 +2858,15 @@ int mt7915_mcu_get_eeprom(struct mt7915_dev *dev, u32 offset, u8 *read_buf) return ret; res = (struct mt7915_mcu_eeprom_info *)skb->data; - if (!buf) - buf = dev->mt76.eeprom.data + le32_to_cpu(res->addr); + if (!buf) { + u32 addr = le32_to_cpu(res->addr); + + if (addr > dev->mt76.eeprom.size - MT7915_EEPROM_BLOCK_SIZE) { + dev_kfree_skb(skb); + return -EINVAL; + } + buf = dev->mt76.eeprom.data + addr; + } memcpy(buf, res->data, MT7915_EEPROM_BLOCK_SIZE); dev_kfree_skb(skb); -- 2.53.0