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 BC348215F42 for ; Thu, 8 May 2025 06:40:04 +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=1746686404; cv=none; b=QiR/6j7WAN5WKoAKPue83MJLn9Gj59EkWcH6dZ6kZGUsiu9C6wEH0UtfzVHis7XtjaQlUoCvagssWVm3emA2F82SDaCwzEmmEwzknEca/lJizd+Z573uRVJ0FZWgg4Q9qY6IyCQSVHK4vH7MO2/0E7FX6Phf5a45ScG1NhAM1iw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746686404; c=relaxed/simple; bh=3EkfVpbt+U4T78WLM08D3T/eDmT26r2p/0VrasIdMgk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TFVle81GfQqU3cAW7j/3wAGu97ZHtX6erRn+kESlr/RrU34oUc4L3LS846gyHmZMgRfxI1XGJ+WBUOU+XgcHO4Nc+7Obm3SL6ZBhD0n2+nfp51bwmvAh8uckjKkn92IbWZj27ptQEXIKyOCAqAcKbXL5A456DmU63UDudCALV8A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fo3PXTT5; 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="fo3PXTT5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4BFAC4CEED; Thu, 8 May 2025 06:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746686404; bh=3EkfVpbt+U4T78WLM08D3T/eDmT26r2p/0VrasIdMgk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=fo3PXTT5OACmhsZrOP+C+GrRA4Uh9jLVjpxogtk6uvvPTj2601EYie03/NGM7Cv2v yyY2uWplbkdgU9spesEzHV9JttCxqHXpwTV0GrQ+RQq2kdWAi7ANCFdy9nJKeXOlv7 bfZf0cEjc9z7OCiVjnvQVd25Fe6qknVwRvAY0Stw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37816: mei: vsc: Fix fortify-panic caused by invalid counted_by() use Date: Thu, 8 May 2025 08:39:25 +0200 Message-ID: <2025050818-CVE-2025-37816-b611@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3376; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Q8zsmNj24A9b10KGQNtsHoYm8hPlluHNPwEHc6YNRdw=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkygdPNj8t4LfLx7UlYH7Z73Q/PX/kPLqTO47l05VWYR 3PFg4p1HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRZn6Geao3f6jt27LSJSdv PVdxyaG0FTxzbRnmu35xz9LM+Hr960ErdbVDLcscK6euAgA= 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: mei: vsc: Fix fortify-panic caused by invalid counted_by() use gcc 15 honors the __counted_by(len) attribute on vsc_tp_packet.buf[] and the vsc-tp.c code is using this in a wrong way. len does not contain the available size in the buffer, it contains the actual packet length *without* the crc. So as soon as vsc_tp_xfer() tries to add the crc to buf[] the fortify-panic handler gets triggered: [ 80.842193] memcpy: detected buffer overflow: 4 byte write of buffer size 0 [ 80.842243] WARNING: CPU: 4 PID: 272 at lib/string_helpers.c:1032 __fortify_report+0x45/0x50 ... [ 80.843175] __fortify_panic+0x9/0xb [ 80.843186] vsc_tp_xfer.cold+0x67/0x67 [mei_vsc_hw] [ 80.843210] ? seqcount_lockdep_reader_access.constprop.0+0x82/0x90 [ 80.843229] ? lockdep_hardirqs_on+0x7c/0x110 [ 80.843250] mei_vsc_hw_start+0x98/0x120 [mei_vsc] [ 80.843270] mei_reset+0x11d/0x420 [mei] The easiest fix would be to just drop the counted-by but with the exception of the ack buffer in vsc_tp_xfer_helper() which only contains enough room for the packet-header, all other uses of vsc_tp_packet always use a buffer of VSC_TP_MAX_XFER_SIZE bytes for the packet. Instead of just dropping the counted-by, split the vsc_tp_packet struct definition into a header and a full-packet definition and use a fixed size buf[] in the packet definition, this way fortify-source buffer overrun checking still works when enabled. The Linux kernel CVE team has assigned CVE-2025-37816 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit 566f5ca9768075e453b7b51a397733968df4287d and fixed in 6.12.26 with commit 3e243378f27cc7d11682a3ad720228b0723affa5 Issue introduced in 6.8 with commit 566f5ca9768075e453b7b51a397733968df4287d and fixed in 6.14.5 with commit ac04663c67f244810b3492e9ecd9f7cdbefeca2d Issue introduced in 6.8 with commit 566f5ca9768075e453b7b51a397733968df4287d and fixed in 6.15-rc4 with commit 00f1cc14da0f06d2897b8c528df7c7dcf1b8da50 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-2025-37816 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/misc/mei/vsc-tp.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/3e243378f27cc7d11682a3ad720228b0723affa5 https://git.kernel.org/stable/c/ac04663c67f244810b3492e9ecd9f7cdbefeca2d https://git.kernel.org/stable/c/00f1cc14da0f06d2897b8c528df7c7dcf1b8da50