CVE-2026-138850 (GCVE-0-2026-138850)

Vulnerability from cvelistv5 – Published: 2026-11-30 13:25 – Updated: 2026-12-01 05:40
VLAI
Title
misc: fastrpc: fix double-free in fastrpc_map_attach() error path
Summary
In the Linux kernel, the following vulnerability has been resolved: misc: fastrpc: fix double-free in fastrpc_map_attach() error path map->table is assigned right after dma_buf_map_attachment_unlocked() succeeds. The two failure checks that follow, the len > map->size test and, where subsystem VMIDs are configured, a failed qcom_scm_assign_mem(), jump to map_err with map->table already set. map_err manually calls dma_buf_detach() and dma_buf_put() and then falls through to fastrpc_map_put(). Since that change the error path tail is fastrpc_map_put() -> fastrpc_free_map(), and fastrpc_free_map() already unmaps, detaches and puts the dma-buf whenever map->table is set. The two operations therefore run twice: the second dma_buf_put() drops an extra reference on map->buf, and dma_buf_unmap_attachment_unlocked() dereferences the map->attach already freed by the manual dma_buf_detach(). kref_init() sets the refcount to 1 with no intervening get, so the final fastrpc_map_put() frees the map synchronously and the redundant cleanup is deterministic. The len > map->size branch is reachable by an unprivileged process via FASTRPC_IOCTL_MEM_MAP with an fd whose dma-buf is smaller than the requested length, before any DSP invocation. Route both map->table-is-set failure branches to get_err instead of map_err, so fastrpc_free_map() is the single owner of the unmap/detach/put sequence. map_err is retained for the dma_buf_map_attachment_unlocked() failure, which is reached with map->table still NULL and an attachment that fastrpc_free_map() will not clean up, so its dma_buf_detach()/dma_buf_put() must still run manually.
Assigner
Linux CNA under the mitre root
CNA scorecard D 52/100 over 8585 records in the last 180 days details
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 334f1a1cbe032d85fd58e771629e3a3b373b96d5 , < 3a05f8579fc0a3d04e1e9de766630a722d7ca6b6 (git)
Affected: 334f1a1cbe032d85fd58e771629e3a3b373b96d5 , < 0bde6e438035a3bb80ba4f735b8c61a68001f8aa (git)
Affected: 334f1a1cbe032d85fd58e771629e3a3b373b96d5 , < 5ba8a7ebd96d2e271905348e8aed19fe726e3648 (git)
Affected: 334f1a1cbe032d85fd58e771629e3a3b373b96d5 , < 51731e49fe9a7359d4dd17e77189a21b29115233 (git)
Affected: 334f1a1cbe032d85fd58e771629e3a3b373b96d5 , < 09fa66ec1b4896ab841da085ca58b6433f28f07f (git)
guessed Create a notification for this product.
Linux Linux Affected: 6.2
Unaffected: 0 , < 6.2 (semver)
Unaffected: 6.6.163 , ≤ 6.6.* (semver)
Unaffected: 6.12.118 , ≤ 6.12.* (semver)
Unaffected: 6.18.64 , ≤ 6.18.* (semver)
Unaffected: 7.3.4 , ≤ 7.3.* (semver)
Unaffected: 7.4-rc1 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "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-\u003etable is assigned right after dma_buf_map_attachment_unlocked()\nsucceeds. The two failure checks that follow, the len \u003e map-\u003esize test\nand, where subsystem VMIDs are configured, a failed qcom_scm_assign_mem(),\njump to map_err with map-\u003etable 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() -\u003e fastrpc_free_map(), and fastrpc_free_map() already\nunmaps, detaches and puts the dma-buf whenever map-\u003etable is set.\nThe two operations therefore run twice: the second dma_buf_put() drops an\nextra reference on map-\u003ebuf, and dma_buf_unmap_attachment_unlocked()\ndereferences the map-\u003eattach 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 \u003e map-\u003esize 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-\u003etable-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-\u003etable 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\u0027s 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 \u003e map-\u003esize true with map-\u003etable 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 \u0027untrusted applications\u0027 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-\u003eattach 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\u0027s 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-\u003enode, 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",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2026-138850",
      "date": "2026-12-04",
      "epss": "0.002",
      "percentile": "0.10321"
    },
    "microsoft_vex": {
      "current_release_date": "2026-12-02T01:06:18.000Z",
      "cve": "CVE-2026-138850",
      "id": "msrc_CVE-2026-138850",
      "initial_release_date": "2026-12-02T01:06:18.000Z",
      "product_status:known_affected": "1",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "misc: fastrpc: fix double-free in fastrpc_map_attach() error path",
      "url": "https://msrc.microsoft.com/csaf/vex/2026/msrc_cve-2026-138850.json",
      "version": "1"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "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"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "cveTags": [],
        "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-\u003etable is assigned right after dma_buf_map_attachment_unlocked()\nsucceeds. The two failure checks that follow, the len \u003e map-\u003esize test\nand, where subsystem VMIDs are configured, a failed qcom_scm_assign_mem(),\njump to map_err with map-\u003etable 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() -\u003e fastrpc_free_map(), and fastrpc_free_map() already\nunmaps, detaches and puts the dma-buf whenever map-\u003etable is set.\nThe two operations therefore run twice: the second dma_buf_put() drops an\nextra reference on map-\u003ebuf, and dma_buf_unmap_attachment_unlocked()\ndereferences the map-\u003eattach 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 \u003e map-\u003esize 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-\u003etable-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-\u003etable 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."
          }
        ],
        "id": "CVE-2026-138850",
        "lastModified": "2026-12-01T06:17:28.733",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.9,
              "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
              "type": "Secondary"
            }
          ]
        },
        "published": "2026-11-30T14:17:40.823",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/09fa66ec1b4896ab841da085ca58b6433f28f07f"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/0bde6e438035a3bb80ba4f735b8c61a68001f8aa"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/3a05f8579fc0a3d04e1e9de766630a722d7ca6b6"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/51731e49fe9a7359d4dd17e77189a21b29115233"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/5ba8a7ebd96d2e271905348e8aed19fe726e3648"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Received"
      }
    },
    "redhat_vex": {
      "aggregate_severity": "Important",
      "current_release_date": "2026-12-01T06:05:48+00:00",
      "cve": "CVE-2026-138850",
      "id": "CVE-2026-138850",
      "initial_release_date": "2026-11-30T13:25:33.892000+00:00",
      "product_status:known_not_affected": "280",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: kernel: memory corruption via double-free in fastrpc_map_attach()",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-138850.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.