CVE-2026-138850: misc: fastrpc: fix double-free in fastrpc_map_attach() error path

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

misc: fastrpc: fix double-free in fastrpcmapattach() error path

map->table is assigned right after dmabufmapattachmentunlocked() succeeds. The two failure checks that follow, the len > map->size test and, where subsystem VMIDs are configured, a failed qcomscmassignmem(), jump to maperr with map->table already set.

maperr manually calls dmabufdetach() and dmabufput() and then falls through to fastrpcmapput(). Since that change the error path tail is fastrpcmapput() -> fastrpcfreemap(), and fastrpcfreemap() already unmaps, detaches and puts the dma-buf whenever map->table is set. The two operations therefore run twice: the second dmabufput() drops an extra reference on map->buf, and dmabufunmapattachmentunlocked() dereferences the map->attach already freed by the manual dmabufdetach(). krefinit() sets the refcount to 1 with no intervening get, so the final fastrpcmapput() frees the map synchronously and the redundant cleanup is deterministic.

The len > map->size branch is reachable by an unprivileged process via FASTRPCIOCTLMEMMAP 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 geterr instead of maperr, so fastrpcfreemap() is the single owner of the unmap/detach/put sequence. maperr is retained for the dmabufmapattachmentunlocked() failure, which is reached with map->table still NULL and an attachment that fastrpcfreemap() will not clean up, so its dmabufdetach()/dmabufput() must still run manually.

Affected Software

8 affected componentsFixes available
Linux Linux kernel
linux/kernel>=6.2.0<6.6.163
6.6.163
linux/kernel>=6.7.0<6.12.118
6.12.118
linux/kernel>=6.13.0<6.18.64
6.18.64
linux/kernel>=6.19.0<7.3.4
7.3.4
debian/linux<6.12.118-1
6.12.118-1
debian/linux<7.3.4-1
7.3.4-1
debian/linux<=6.12.117-1
6.12.118-17.3.4-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.6.163
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.118
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.64
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.4
  5. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.118-1
  6. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 7.3.4-1
  7. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.118-1Fixed in 7.3.4-1
  8. Compensating control

    In fastrpc_map_attach(), route both map->table-is-set failure branches to get_err instead of map_err, so fastrpc_free_map() remains the sole owner of the dma-buf unmap/detach/put cleanup.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:25 PM
Data Sourced
via MITRE·01:25 PM
Description
Data Sourced
via OSV·01:25 PM
DescriptionAffected Software
Data Sourced
via NVD·02:17 PM
Description

Frequently Asked Questions

1

Can an unprivileged local process trigger this issue?

Yes. An unprivileged process can reach the affected length-check error path through FASTRPC_IOCTL_MEM_MAP by supplying an fd whose dma-buf is smaller than the requested mapping length.

2

Does exploitation depend on subsystem VMID configuration?

No for the dma-buf length-check path. The length-greater-than-map-size failure path is independent of subsystem VMID configuration; configured VMIDs add another affected path if qcom_scm_assign_mem() fails.

3

What happens when the affected error path is reached?

Cleanup runs twice after the mapping table has been set. This drops an extra dma-buf reference and can dereference an attachment that was already freed; the map object is then freed synchronously because its reference count was initialized to one without an intervening reference acquisition.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203