{"api_version":"1","generated_at":"2026-12-01T13:37:11+00:00","cve":"CVE-2026-138850","urls":{"html":"https://cve.report/CVE-2026-138850","api":"https://cve.report/api/cve/CVE-2026-138850.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-138850","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-138850"},"summary":{"title":"misc: fastrpc: fix double-free in fastrpc_map_attach() error path","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmisc: fastrpc: fix double-free in fastrpc_map_attach() error path\n\nmap->table is assigned right after dma_buf_map_attachment_unlocked()\nsucceeds. The two failure checks that follow, the len > map->size test\nand, where subsystem VMIDs are configured, a failed qcom_scm_assign_mem(),\njump to map_err with map->table already set.\n\nmap_err manually calls dma_buf_detach() and dma_buf_put() and then falls\nthrough to fastrpc_map_put(). Since that change the error path tail is\nfastrpc_map_put() -> fastrpc_free_map(), and fastrpc_free_map() already\nunmaps, detaches and puts the dma-buf whenever map->table is set.\nThe two operations therefore run twice: the second dma_buf_put() drops an\nextra reference on map->buf, and dma_buf_unmap_attachment_unlocked()\ndereferences the map->attach already freed by the manual dma_buf_detach().\nkref_init() sets the refcount to 1 with no intervening get, so the final\nfastrpc_map_put() frees the map synchronously and the redundant cleanup is\ndeterministic.\n\nThe len > map->size branch is reachable by an unprivileged process via\nFASTRPC_IOCTL_MEM_MAP with an fd whose dma-buf is smaller than the\nrequested length, before any DSP invocation.\n\nRoute both map->table-is-set failure branches to get_err instead of\nmap_err, so fastrpc_free_map() is the single owner of the\nunmap/detach/put sequence. map_err is retained for the\ndma_buf_map_attachment_unlocked() failure, which is reached with\nmap->table still NULL and an attachment that fastrpc_free_map() will not\nclean up, so its dma_buf_detach()/dma_buf_put() must still run manually.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:17:40","updated_at":"2026-12-01 06:17:28"},"problem_types":[],"metrics":[{"version":"3.1","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","score":"7.8","severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","data":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"}},{"version":"3.1","source":"CNA","type":"DECLARED","score":"7.8","severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","data":{"baseScore":7.8,"baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"}}],"references":[{"url":"https://git.kernel.org/stable/c/0bde6e438035a3bb80ba4f735b8c61a68001f8aa","name":"https://git.kernel.org/stable/c/0bde6e438035a3bb80ba4f735b8c61a68001f8aa","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/3a05f8579fc0a3d04e1e9de766630a722d7ca6b6","name":"https://git.kernel.org/stable/c/3a05f8579fc0a3d04e1e9de766630a722d7ca6b6","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/5ba8a7ebd96d2e271905348e8aed19fe726e3648","name":"https://git.kernel.org/stable/c/5ba8a7ebd96d2e271905348e8aed19fe726e3648","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/51731e49fe9a7359d4dd17e77189a21b29115233","name":"https://git.kernel.org/stable/c/51731e49fe9a7359d4dd17e77189a21b29115233","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/09fa66ec1b4896ab841da085ca58b6433f28f07f","name":"https://git.kernel.org/stable/c/09fa66ec1b4896ab841da085ca58b6433f28f07f","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-138850","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138850","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 334f1a1cbe032d85fd58e771629e3a3b373b96d5 3a05f8579fc0a3d04e1e9de766630a722d7ca6b6 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 334f1a1cbe032d85fd58e771629e3a3b373b96d5 0bde6e438035a3bb80ba4f735b8c61a68001f8aa git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 334f1a1cbe032d85fd58e771629e3a3b373b96d5 5ba8a7ebd96d2e271905348e8aed19fe726e3648 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 334f1a1cbe032d85fd58e771629e3a3b373b96d5 51731e49fe9a7359d4dd17e77189a21b29115233 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 334f1a1cbe032d85fd58e771629e3a3b373b96d5 09fa66ec1b4896ab841da085ca58b6433f28f07f git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.2","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.2 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.118 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.64 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.4 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/misc/fastrpc.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"3a05f8579fc0a3d04e1e9de766630a722d7ca6b6","status":"affected","version":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","versionType":"git"},{"lessThan":"0bde6e438035a3bb80ba4f735b8c61a68001f8aa","status":"affected","version":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","versionType":"git"},{"lessThan":"5ba8a7ebd96d2e271905348e8aed19fe726e3648","status":"affected","version":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","versionType":"git"},{"lessThan":"51731e49fe9a7359d4dd17e77189a21b29115233","status":"affected","version":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","versionType":"git"},{"lessThan":"09fa66ec1b4896ab841da085ca58b6433f28f07f","status":"affected","version":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/misc/fastrpc.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"6.2"},{"lessThan":"6.2","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.118","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.64","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"6.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.118","versionStartIncluding":"6.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.64","versionStartIncluding":"6.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.4","versionStartIncluding":"6.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"6.2","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmisc: fastrpc: fix double-free in fastrpc_map_attach() error path\n\nmap->table is assigned right after dma_buf_map_attachment_unlocked()\nsucceeds. The two failure checks that follow, the len > map->size test\nand, where subsystem VMIDs are configured, a failed qcom_scm_assign_mem(),\njump to map_err with map->table already set.\n\nmap_err manually calls dma_buf_detach() and dma_buf_put() and then falls\nthrough to fastrpc_map_put(). Since that change the error path tail is\nfastrpc_map_put() -> fastrpc_free_map(), and fastrpc_free_map() already\nunmaps, detaches and puts the dma-buf whenever map->table is set.\nThe two operations therefore run twice: the second dma_buf_put() drops an\nextra reference on map->buf, and dma_buf_unmap_attachment_unlocked()\ndereferences the map->attach already freed by the manual dma_buf_detach().\nkref_init() sets the refcount to 1 with no intervening get, so the final\nfastrpc_map_put() frees the map synchronously and the redundant cleanup is\ndeterministic.\n\nThe len > map->size branch is reachable by an unprivileged process via\nFASTRPC_IOCTL_MEM_MAP with an fd whose dma-buf is smaller than the\nrequested length, before any DSP invocation.\n\nRoute both map->table-is-set failure branches to get_err instead of\nmap_err, so fastrpc_free_map() is the single owner of the\nunmap/detach/put sequence. map_err is retained for the\ndma_buf_map_attachment_unlocked() failure, which is reached with\nmap->table still NULL and an attachment that fastrpc_free_map() will not\nclean up, so its dma_buf_detach()/dma_buf_put() must still run manually."}],"metrics":[{"cvssV3_1":{"baseScore":7.8,"baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"scenarios":[{"lang":"en","value":"AV:L - The faulty map_err path in fastrpc_map_attach() is reached only through ioctl(FASTRPC_IOCTL_MEM_MAP) on the local /dev/fastrpc-* misc device, via fastrpc_req_mem_map() and fastrpc_map_create(). The bad length comes from the local caller's struct fastrpc_mem_map, not from the DSP or a network peer.\nAC:L - Deterministic: the attacker gets a small dma-buf from FASTRPC_IOCTL_ALLOC_DMA_BUFF, then passes MEM_MAP a req.length larger than it. That makes len > map->size true with map->table set, and kref_init leaves the refcount at 1, so fastrpc_map_put() frees the map synchronously and repeats the unmap/detach/put on every call. No race and no DSP response needed.\nPR:L - Opening the non-secure fastrpc node is the only gate. is_session_rejected() explicitly provides for 'untrusted applications' on that node, and fastrpc_req_mem_map() performs no capability or secure-device check before fastrpc_map_create(), so an ordinary unprivileged user with access to the node can trigger it.\nUI:N - The attacker drives the whole sequence (open, ALLOC_DMA_BUFF, MEM_MAP) with their own syscalls on a dma-buf they created themselves; no other user, mount or administrator action is involved.\nS:U - The corruption hits host-kernel objects (dma_buf_attachment, fastrpc_dma_buf_attachment, the dma-buf struct file), and the result is host kernel compromise in the same security authority. The secure-map/hypervisor branch is not reachable on this path.\nC:H - fastrpc_free_map() calls dma_buf_unmap_attachment_unlocked() on a map->attach and sg_table already freed by the manual dma_buf_detach(), then makes a second dma_buf_put(). The fput count underflows and frees the dma-buf struct file while the user's fd still refers to it: a reclaimable file UAF that gives kernel read primitives.\nI:H - The second dma_buf_detach() calls kfree() again on the attachment and on fastrpc_dma_buf_attachment (both in generic kmalloc caches), and the extra fput leaves a dangling dma-buf fd. Both are double-free/UAF write primitives that can be groomed into arbitrary kernel write and privilege escalation.\nA:H - Each MEM_MAP call with an oversized length repeats the use-after-free in dma_buf_unmap_attachment()/fastrpc_unmap_dma_buf() and the list_del() on the already-poisoned attach->node, which oopses or triggers SLUB double-free/list-corruption BUGs and can panic the kernel at will."}]}],"providerMetadata":{"dateUpdated":"2026-12-01T05:40:18.041Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/3a05f8579fc0a3d04e1e9de766630a722d7ca6b6"},{"url":"https://git.kernel.org/stable/c/0bde6e438035a3bb80ba4f735b8c61a68001f8aa"},{"url":"https://git.kernel.org/stable/c/5ba8a7ebd96d2e271905348e8aed19fe726e3648"},{"url":"https://git.kernel.org/stable/c/51731e49fe9a7359d4dd17e77189a21b29115233"},{"url":"https://git.kernel.org/stable/c/09fa66ec1b4896ab841da085ca58b6433f28f07f"}],"title":"misc: fastrpc: fix double-free in fastrpc_map_attach() error path","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-138850","datePublished":"2026-11-30T13:25:33.892Z","dateReserved":"2026-11-30T13:22:15.898Z","dateUpdated":"2026-12-01T05:40:18.041Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:17:40","lastModifiedDate":"2026-12-01 06:17:28","problem_types":[],"metrics":{"cvssMetricV31":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"},"exploitabilityScore":1.8,"impactScore":5.9}]},"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"138850","Ordinal":"1","Title":"misc: fastrpc: fix double-free in fastrpc_map_attach() error pat","CVE":"CVE-2026-138850","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"138850","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nmisc: fastrpc: fix double-free in fastrpc_map_attach() error path\n\nmap->table is assigned right after dma_buf_map_attachment_unlocked()\nsucceeds. The two failure checks that follow, the len > map->size test\nand, where subsystem VMIDs are configured, a failed qcom_scm_assign_mem(),\njump to map_err with map->table already set.\n\nmap_err manually calls dma_buf_detach() and dma_buf_put() and then falls\nthrough to fastrpc_map_put(). Since that change the error path tail is\nfastrpc_map_put() -> fastrpc_free_map(), and fastrpc_free_map() already\nunmaps, detaches and puts the dma-buf whenever map->table is set.\nThe two operations therefore run twice: the second dma_buf_put() drops an\nextra reference on map->buf, and dma_buf_unmap_attachment_unlocked()\ndereferences the map->attach already freed by the manual dma_buf_detach().\nkref_init() sets the refcount to 1 with no intervening get, so the final\nfastrpc_map_put() frees the map synchronously and the redundant cleanup is\ndeterministic.\n\nThe len > map->size branch is reachable by an unprivileged process via\nFASTRPC_IOCTL_MEM_MAP with an fd whose dma-buf is smaller than the\nrequested length, before any DSP invocation.\n\nRoute both map->table-is-set failure branches to get_err instead of\nmap_err, so fastrpc_free_map() is the single owner of the\nunmap/detach/put sequence. map_err is retained for the\ndma_buf_map_attachment_unlocked() failure, which is reached with\nmap->table still NULL and an attachment that fastrpc_free_map() will not\nclean up, so its dma_buf_detach()/dma_buf_put() must still run manually.","Type":"Description","Title":"misc: fastrpc: fix double-free in fastrpc_map_attach() error pat"}]}}}