Skip to contentSkip to conversation

CVE-2026-93121: usb: gadget: f_fs: Fix fence cleanup in ffs_dmabuf_transfer() error paths

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 17

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

usb: gadget: f_fs: Fix fence cleanup in ffs_dmabuf_transfer() error paths

The error paths for endpoint-disabled (ESHUTDOWN) and request-allocation failure (ENOMEM) in ffs_dmabuf_transfer() jump to err_fence_put which calls dma_fence_put() on the fence. However, at that point the fence has only been kmalloc'd — dma_fence_init() has not been called yet, so the refcount and the fence ops are uninitialized. Calling dma_fence_put() on such an object leads to undefined behavior.

Use kfree() instead, since the fence is just a plain allocation at this stage, and rename the label to err_fence_free to reflect the actual cleanup action.

The Linux kernel CVE team has assigned CVE-2026-93121 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.9 with commit 7b07a2a7ca02a20124b552be96c5a56910795488 and fixed in 6.12.110 with commit be539138d9a187af3b884525a395db10797c64f1
	Issue introduced in 6.9 with commit 7b07a2a7ca02a20124b552be96c5a56910795488 and fixed in 6.18.52 with commit 5fd8baacc7dc477df9cac61b45491840247a9b1e
	Issue introduced in 6.9 with commit 7b07a2a7ca02a20124b552be96c5a56910795488 and fixed in 7.2.6 with commit 58952c83dfe6ea3294a74734d2d1018c1120779a
	Issue introduced in 6.9 with commit 7b07a2a7ca02a20124b552be96c5a56910795488 and fixed in 7.3-rc1 with commit 621707dc67c9846fd876d7579ec951d92aa033f1

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-93121

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/usb/gadget/function/f_fs.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/be539138d9a187af3b884525a395db10797c64f1
	https://git.kernel.org/stable/c/5fd8baacc7dc477df9cac61b45491840247a9b1e
	https://git.kernel.org/stable/c/58952c83dfe6ea3294a74734d2d1018c1120779a
	https://git.kernel.org/stable/c/621707dc67c9846fd876d7579ec951d92aa033f1