{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2026-138850",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2026-11-30T13:22:15.898Z",
        "datePublished": "2026-11-30T13:25:33.892Z",
        "dateUpdated": "2026-12-01T05:40:18.041Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-12-01T05:40:18.041Z"
            },
            "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": {
                        "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"
                    },
                    "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."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/misc/fastrpc.c"
                    ],
                    "versions": [
                        {
                            "version": "334f1a1cbe032d85fd58e771629e3a3b373b96d5",
                            "lessThan": "3a05f8579fc0a3d04e1e9de766630a722d7ca6b6",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "334f1a1cbe032d85fd58e771629e3a3b373b96d5",
                            "lessThan": "0bde6e438035a3bb80ba4f735b8c61a68001f8aa",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "334f1a1cbe032d85fd58e771629e3a3b373b96d5",
                            "lessThan": "5ba8a7ebd96d2e271905348e8aed19fe726e3648",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "334f1a1cbe032d85fd58e771629e3a3b373b96d5",
                            "lessThan": "51731e49fe9a7359d4dd17e77189a21b29115233",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "334f1a1cbe032d85fd58e771629e3a3b373b96d5",
                            "lessThan": "09fa66ec1b4896ab841da085ca58b6433f28f07f",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/misc/fastrpc.c"
                    ],
                    "versions": [
                        {
                            "version": "6.2",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.2",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.163",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.118",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.18.64",
                            "lessThanOrEqual": "6.18.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "7.3.4",
                            "lessThanOrEqual": "7.3.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "7.4-rc1",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.2",
                                    "versionEndExcluding": "6.6.163"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.2",
                                    "versionEndExcluding": "6.12.118"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.2",
                                    "versionEndExcluding": "6.18.64"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.2",
                                    "versionEndExcluding": "7.3.4"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.2",
                                    "versionEndExcluding": "7.4-rc1"
                                }
                            ]
                        }
                    ]
                }
            ],
            "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"
            }
        }
    }
}