{"id":"CVE-2026-138850","aliases":["CVE-2026-138850"],"related":[],"kind":"vulnerability","state":"published","title":"misc: fastrpc: fix double-free in fastrpc_map_attach() error path","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"}],"published":"2026-11-30T13:25:33.892Z","modified":"2026-12-01T06:17:28.733Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","fixed":"3a05f8579fc0a3d04e1e9de766630a722d7ca6b6","status":"affected"},{"type":"git","introduced":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","fixed":"0bde6e438035a3bb80ba4f735b8c61a68001f8aa","status":"affected"},{"type":"git","introduced":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","fixed":"5ba8a7ebd96d2e271905348e8aed19fe726e3648","status":"affected"},{"type":"git","introduced":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","fixed":"51731e49fe9a7359d4dd17e77189a21b29115233","status":"affected"},{"type":"git","introduced":"334f1a1cbe032d85fd58e771629e3a3b373b96d5","fixed":"09fa66ec1b4896ab841da085ca58b6433f28f07f","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.2","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.2","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.118","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.64","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/3a05f8579fc0a3d04e1e9de766630a722d7ca6b6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0bde6e438035a3bb80ba4f735b8c61a68001f8aa","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5ba8a7ebd96d2e271905348e8aed19fe726e3648","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/51731e49fe9a7359d4dd17e77189a21b29115233","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/09fa66ec1b4896ab841da085ca58b6433f28f07f","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138850","url":"https://www.cve.org/CVERecord?id=CVE-2026-138850","licence":"CVE Terms of Use","modified":"2026-12-01T05:40:18.041Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138850","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138850","licence":"Public domain","modified":"2026-12-01T06:17:28.733Z"}],"updatedAt":"2026-12-01T06:32:14.564Z","epss":{"score":0.002,"percentile":0.10345,"date":"2026-12-01T12:00:22.000Z"}}