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 60FCF30F53A for ; Tue, 28 Oct 2025 11:51:22 +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=1761652282; cv=none; b=Qw+s+w0hGgmiwR90H7h2JhvjtNBdM1gi+n+T45Jpni4bL5NF6B/3pYVDMej0Y8YOsJxXUE2iar1SGh92ny+6vElaFI8bsdiL5FX1GJe0KYM/Ob+hCQBt2dXsKAr/jDsbdkRxHswORLTvH7CBDJoGkCK6BWJtK9zL3Ly5ZirCq7g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761652282; c=relaxed/simple; bh=Nt5BHGutP93g7sVd88836i4xv1mdAGtSMiQy1EKPAwo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RRPb7r1i0n6Ehc8Zv67dDghmU0LDtjN6dygymkY5/NIQAB9cWRAEU5vdShplnlGbumMLGcGNAojx4eRIYRWkxbm6btPnrMqXLXkXJBGuSEbr/15+4kTbZFvoPrZfNTZYXf8ifKGJjQKdNgS5Cc48jrKnnXeVTgnoI/oXI+AtP24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NyxtoBpJ; 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="NyxtoBpJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38B0FC4CEF7; Tue, 28 Oct 2025 11:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1761652282; bh=Nt5BHGutP93g7sVd88836i4xv1mdAGtSMiQy1EKPAwo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=NyxtoBpJNV7z7LFDPh4rn1USnGv0c3Z/HHrfHKtYh0xQ8Jbyp4Fj+RasdNFttEcpp 2T1IzxgwdCjl01CAsLvMeUI4DM9AecpxLIDH+kcZ5FFX+Xk2fUTYK2S7gLrm1GARqA smI0Opq0ZY2s1XzvHtxLD21JVbqB+Qk5qgm93Tz8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40031: tee: fix register_shm_helper() Date: Tue, 28 Oct 2025 12:48:08 +0100 Message-ID: <2025102810-CVE-2025-40031-3ff1@gregkh> X-Mailer: git-send-email 2.51.1 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=2345; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=pusQZfEsJm2HN9lSoaDTA2k/YR7DOwnkdOttzyxPNuA=; b=owGbwMvMwCRo6H6F97bub03G02pJDJkMa6tE+n7tX1K79teFe/YbJivEnz35bmPd/oWigt/WS hf4vX55qiOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmImPMMIc7zbzmh3iJi9oC f68ddgp2mjdP7mRY0Jbdf/OZ0bOoabv8u2Yan20z/XvNGwA= 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: tee: fix register_shm_helper() In register_shm_helper(), fix incorrect error handling for a call to iov_iter_extract_pages(). A case is missing for when iov_iter_extract_pages() only got some pages and return a number larger than 0, but not the requested amount. This fixes a possible NULL pointer dereference following a bad input from ioctl(TEE_IOC_SHM_REGISTER) where parts of the buffer isn't mapped. The Linux kernel CVE team has assigned CVE-2025-40031 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit 7bdee41575919773818e525ea19e54eb817770af and fixed in 6.12.53 with commit 9338093db954918558677a468d32e77041c65167 Issue introduced in 6.8 with commit 7bdee41575919773818e525ea19e54eb817770af and fixed in 6.17.3 with commit 6a7874ab814ce12003c46a92f7afc9b035c8e8e9 Issue introduced in 6.8 with commit 7bdee41575919773818e525ea19e54eb817770af and fixed in 6.18-rc1 with commit d5cf5b37064b1699d946e8b7ab4ac7d7d101814c 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-40031 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/tee/tee_shm.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/9338093db954918558677a468d32e77041c65167 https://git.kernel.org/stable/c/6a7874ab814ce12003c46a92f7afc9b035c8e8e9 https://git.kernel.org/stable/c/d5cf5b37064b1699d946e8b7ab4ac7d7d101814c