CVE-2025-40031

Source
https://cve.org/CVERecord?id=CVE-2025-40031
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40031.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-40031
Downstream
Related
Published
2025-10-28T11:48:13.644Z
Modified
2026-03-20T12:43:08.805051Z
Summary
tee: fix register_shm_helper()
Details

In the Linux kernel, the following vulnerability has been resolved:

tee: fix registershmhelper()

In registershmhelper(), fix incorrect error handling for a call to ioviterextractpages(). A case is missing for when ioviterextractpages() 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(TEEIOCSHM_REGISTER) where parts of the buffer isn't mapped.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40031.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7bdee41575919773818e525ea19e54eb817770af
Fixed
9338093db954918558677a468d32e77041c65167
Fixed
6a7874ab814ce12003c46a92f7afc9b035c8e8e9
Fixed
d5cf5b37064b1699d946e8b7ab4ac7d7d101814c

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40031.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.8.0
Fixed
6.12.53
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.17.3

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40031.json"