AZL-116776: CVE-2026-138850 affecting package kernel 6.6.161.1-1
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
Event History
Frequently Asked Questions
What does an attacker need to trigger the vulnerable error path?
An unprivileged local process can reach one affected branch through FASTRPC_IOCTL_MEM_MAP by supplying an fd for a dma-buf that is smaller than the requested mapping range. A separate affected error path can occur when subsystem VMIDs are configured and qcom_scm_assign_mem() fails.
What is the consequence of reaching this path?
The error handling performs dma-buf cleanup twice. This can drop an extra buffer reference and attempt to unmap an attachment after it was detached and freed, with deterministic map cleanup after the final fastrpc_map_put().