UBUNTU-CVE-2026-89996: Low severity ubuntu/linux-hwe-edge vulnerability
In the Linux kernel, the following vulnerability has been resolved: dma-buf: dma-heap: don't publish fd before copytouser() succeeds DMAHEAPIOCTLALLOC allocates a dma-buf and installs an fd into the caller's fd table via dmabuffd() -> fdinstall() before dmaheapioctl() copies the result back to userspace. If the trailing copytouser() fails, userspace never learns the fd number, but the fd (and the underlying dma-buf reference) are already visible to other threads in the same process and are leaked for the lifetime of the process. The obvious "close it on the failure path" fix is unsafe: once fdinstall() has run, another thread can already dup() the fd, send it via SCMRIGHTS, or close() it and let its number be reused, so a subsequent closefd() from the ioctl path can operate on an unrelated file. This was pointed out by Christian König on v1 [1]. Restructure the allocation path so that fdinstall() is the last, unfailable step of a successful ioctl: 1. heap->ops->allocate() creates the dmabuf. 2. getunusedfdflags() reserves an fd number in the caller's fd table without publishing it, so no other thread can observe it. 3. copytouser() delivers the fd number to userspace; on failure the fd is returned with putunusedfd() and the dmabuf reference is dropped with dmabufput(), leaving no user- visible state behind. 4. dmabuffdinstall() publishes the fd and emits the tracedmabuffd tracepoint -- from here on the ioctl cannot fail. A new dmabuffdinstall() helper is introduced in dma-buf.c to wrap fdinstall() together with the DMABUFTRACE() call, preserving the export tracing that dmabuffd() provides. dmaheapioctlallocate() is refactored to return the struct dmabuf directly (returning ERRPTR on failure) so the caller holds the dmabuf reference across steps 3 and 4. The failure at step 3 is easily reachable from userspace: pass a struct dmaheapallocationdata that lives in a page whose protection is flipped to PROTREAD between copyfromuser() and copytouser() (e.g. via mprotect()). Before this change each such ioctl leaks one dmabuf fd; after it, the fd table is unchanged on failure and only /dev/dmaheap/<name> remains open. No UAPI or heap-driver interface change. [1] https://lore.kernel.org/dri-devel/175e98de-f414-47d7-81c1-c0fe0a8f7f62@amd.com/
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1