{"id":"CVE-2026-40290","summary":"OP-TEE has a Use-After-Free race in FF-A shared-memory teardown","details":"OP-TEE is a Trusted Execution Environment (TEE) designed as companion to a non-secure Linux kernel running on Arm; Cortex-A cores using the TrustZone technology. Starting in version 3.16.0 and prior to 4.11.0, a user-after-free (UAF) race condition exists in the shared memory teardown logic of FF-A  within OP-TEE SPMC/SP flows. This only applies when OP-TEE is configured as an SPMC for S-EL0 SPs, that is, with `CFG_SECURE_PARTITION=y`. The function `sp_mem_remove()`, responsible for freeing entries in `smem-\u003ereceivers` and `smem-\u003eregions`, fails to acquire the global `sp_mem_lock` before performing the `free()` operations. Concurrently, other code paths, such as `sp_mem_get_receiver()`, iterate over these same lists without holding a lock, or, like `sp_mem_is_shared()`, iterate while holding the lock but are not serialized against the unprotected `free()` in `sp_mem_remove()`. This creates a cross-thread race where a thread iterating the list can acquire a pointer to an entry (e.g., `struct sp_mem_map_region` or `struct sp_mem_receiver`), and then another thread calls `sp_mem_remove()`, freeing the object. When the first thread resumes and dereferences the pointer, it results in a Use-After-Free vulnerability. Version 4.11.0 fixes the issue.","aliases":["GHSA-332c-xr93-849m"],"modified":"2026-10-21T02:57:05.271355251Z","published":"2026-06-03T16:45:51.204Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40290.json","cna_assigner":"GitHub_M","cwe_ids":["CWE-416"]},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40290.json"},{"type":"ADVISORY","url":"https://github.com/OP-TEE/optee_os/security/advisories/GHSA-332c-xr93-849m"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40290"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/op-tee/optee_os","events":[{"introduced":"d0b742d1564834dac903f906168d7357063d5459"},{"fixed":"f54190f22611dd5ad5d22546fd4209aa100f56bd"}],"database_specific":{"extracted_events":[{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"3.16.0"},{"fixed":"4.11.0"}]}]}}],"versions":["4.11.0-rc1","4.10.0","4.10.0-rc1","4.9.0","4.9.0-rc1","4.8.0","4.8.0-rc1","4.7.0","4.7.0-rc1","4.6.0","4.6.0-rc1","4.5.0","4.5.0-rc1","4.4.0","4.4.0-rc1","4.3.0","4.3.0-rc1","4.2.0","4.2.0-rc1","4.1.0","4.1.0-rc1","4.0.0","4.0.0-rc1","3.22.0","3.22.0-rc1","3.21.0","3.21.0-rc1","3.20.0","3.20.0-rc1","3.19.0","3.19.0-rc1","3.18.0","3.18.0-rc1","3.17.0","3.17.0-rc1","3.16.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-40290.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}