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 6DFB912D771 for ; Fri, 21 Jun 2024 11:19:03 +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=1718968743; cv=none; b=DCuCBGSL+iYoLi08mkqb4LtKV6hlpZ0wBuVHBiNMU9saFnX/vUkbs7JTsuxo846VyDu3c/K3rnBHscNDMJmEV3L1ROSFfL9h7MDPBnRlFkqn3p9UBAbUwBIy4N6TDg5UAJ0gg64igeI1bURvPlDlgK7gCdHUGbfyzGMtZMCUXak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718968743; c=relaxed/simple; bh=s+9N0FkQXbPJKrOZSpmKKHFVRwk7jBCJHK9YG9KkQ94=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gQlg89X8q2fEtyDoQZUTdJiq3uSrM0FsECDiy20Kw6KVje8/ba4/8jwDiKZfCXC0mykwPLHRavC509msRoM01rYKfqWqCVb7aPvI3oPAcMsjXNlZHhSvC1xR5KwuGg8Gg9CcP0HVuWgqN3Q+4ilVom5ispSNyVoQkwZpMOt2Rks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PQU2TJvB; 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="PQU2TJvB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E56FDC2BBFC; Fri, 21 Jun 2024 11:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718968743; bh=s+9N0FkQXbPJKrOZSpmKKHFVRwk7jBCJHK9YG9KkQ94=; h=From:To:Cc:Subject:Date:Reply-to:From; b=PQU2TJvBFCdCzALYy9l5Ze+zlsQdTgQGYR+iirzKnsr/4ceYE/XkNLhdUVTQ1XGk2 1db44XVL9aBkif2K+5OWPHdy7/dSKYElFkZNwAswLsoyBjj+aPGUIJ16ofTtQOOg8g a6HmcJIKP+2wkc9FiHLZWUVqNWZsxFlgEvwYqjq0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-36477: tpm_tis_spi: Account for SPI header when allocating TPM SPI xfer buffer Date: Fri, 21 Jun 2024 13:18:53 +0200 Message-ID: <2024062150-CVE-2024-36477-7063@gregkh> X-Mailer: git-send-email 2.45.2 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=2240; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=s+9N0FkQXbPJKrOZSpmKKHFVRwk7jBCJHK9YG9KkQ94=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmlibMj/1hWnDh8Zq9N3i3LssOaF6TfP0ra5lb4dLm7+ 68XUe+tO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiiv8Z5hlLfT3LWXQyyLt0 f6ZC+gSFF1WvbjDM92t2vPykT2xePuf5zZkhk3gL+iKYAQ== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: tpm_tis_spi: Account for SPI header when allocating TPM SPI xfer buffer The TPM SPI transfer mechanism uses MAX_SPI_FRAMESIZE for computing the maximum transfer length and the size of the transfer buffer. As such, it does not account for the 4 bytes of header that prepends the SPI data frame. This can result in out-of-bounds accesses and was confirmed with KASAN. Introduce SPI_HDRSIZE to account for the header and use to allocate the transfer buffer. The Linux kernel CVE team has assigned CVE-2024-36477 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit a86a42ac2bd6 and fixed in 6.6.33 with commit 1547183852dc Issue introduced in 6.6 with commit a86a42ac2bd6 and fixed in 6.9.4 with commit de13c56f9947 Issue introduced in 6.6 with commit a86a42ac2bd6 and fixed in 6.10-rc2 with commit 195aba96b854 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-2024-36477 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/char/tpm/tpm_tis_spi_main.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/1547183852dcdfcc25878db7dd3620509217b0cd https://git.kernel.org/stable/c/de13c56f99477b56980c7e00b09c776d16b7563d https://git.kernel.org/stable/c/195aba96b854dd664768f382cd1db375d8181f88