CVE-2026-64327: usb: gadget: f_fs: Initialize epfile->in early to fix endpoint direction checks
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: ffs: Initialize epfile->in early to fix endpoint direction checks
When parsing endpoint descriptors, ffsdatagotdescs() generates the epsaddrmap which contains the endpoint direction. However, epfile->in was previously only populated in ffsfuncepsenable() which executes upon USB host connection. As a result, early userspace ioctls like FUNCTIONFSDMABUFATTACH that run before the host connects would see epfile->in as 0, leading to incorrect DMA directions.
By moving the initialization to ffsepfilescreate(), epfile->in is accurate before userspace opens the endpoint files.
Affected Software
Remediation
Event History
Frequently Asked Questions
What conditions are required for this issue to occur?
A local, low-privileged user must be able to use the Linux USB FunctionFS interface and issue early userspace ioctls, such as FUNCTIONFS_DMABUF_ATTACH, before a USB host connects. The affected endpoint file must represent an endpoint whose actual direction differs from the uninitialized value.
What is the practical impact?
Before host connection, FunctionFS can use an incorrect DMA direction because epfile->in is treated as 0. The CVSS vector rates the impact as availability-only, with no confidentiality or integrity impact.
Are systems using FunctionFS affected only after a USB host connects?
No. The issue specifically affects operations performed before the USB host connection, because endpoint direction was previously initialized only during endpoint enablement after that connection.
What remediation is available?
A patch is available. It initializes endpoint direction during epfile creation, before userspace can open endpoint files and issue related ioctls.