{"id":"CVE-2025-40031","state":"PUBLISHED","title":"tee: fix register_shm_helper()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ntee: fix register_shm_helper()\n\nIn register_shm_helper(), fix incorrect error handling for a call to\niov_iter_extract_pages(). A case is missing for when\niov_iter_extract_pages() only got some pages and return a number larger\nthan 0, but not the requested amount.\n\nThis fixes a possible NULL pointer dereference following a bad input from\nioctl(TEE_IOC_SHM_REGISTER) where parts of the buffer isn't mapped.","publishedAt":"2025-10-28T11:48:13.644Z","updatedAt":"2026-05-11T21:41:08.887Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"7bdee41575919773818e525ea19e54eb817770af","status":"affected","lessThan":"9338093db954918558677a468d32e77041c65167","versionType":"git"},{"version":"7bdee41575919773818e525ea19e54eb817770af","status":"affected","lessThan":"6a7874ab814ce12003c46a92f7afc9b035c8e8e9","versionType":"git"},{"version":"7bdee41575919773818e525ea19e54eb817770af","status":"affected","lessThan":"d5cf5b37064b1699d946e8b7ab4ac7d7d101814c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/tee/tee_shm.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.53","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.3","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/tee/tee_shm.c"]}],"references":["https://git.kernel.org/stable/c/9338093db954918558677a468d32e77041c65167","https://git.kernel.org/stable/c/6a7874ab814ce12003c46a92f7afc9b035c8e8e9","https://git.kernel.org/stable/c/d5cf5b37064b1699d946e8b7ab4ac7d7d101814c"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/40xxx/CVE-2025-40031.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40031","state":"PUBLISHED","datePublished":"2025-10-28T11:48:13.644Z","dateUpdated":"2026-05-11T21:41:08.887Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.153Z"},"containers":{"cna":{"title":"tee: fix register_shm_helper()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ntee: fix register_shm_helper()\n\nIn register_shm_helper(), fix incorrect error handling for a call to\niov_iter_extract_pages(). A case is missing for when\niov_iter_extract_pages() only got some pages and return a number larger\nthan 0, but not the requested amount.\n\nThis fixes a possible NULL pointer dereference following a bad input from\nioctl(TEE_IOC_SHM_REGISTER) where parts of the buffer isn't mapped."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"7bdee41575919773818e525ea19e54eb817770af","status":"affected","lessThan":"9338093db954918558677a468d32e77041c65167","versionType":"git"},{"version":"7bdee41575919773818e525ea19e54eb817770af","status":"affected","lessThan":"6a7874ab814ce12003c46a92f7afc9b035c8e8e9","versionType":"git"},{"version":"7bdee41575919773818e525ea19e54eb817770af","status":"affected","lessThan":"d5cf5b37064b1699d946e8b7ab4ac7d7d101814c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/tee/tee_shm.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.53","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.3","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/tee/tee_shm.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/9338093db954918558677a468d32e77041c65167"},{"url":"https://git.kernel.org/stable/c/6a7874ab814ce12003c46a92f7afc9b035c8e8e9"},{"url":"https://git.kernel.org/stable/c/d5cf5b37064b1699d946e8b7ab4ac7d7d101814c"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T21:41:08.887Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.12.53"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.17.3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.18"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}