CVE-2022-49755: usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait
While performing fast composition switch, there is a possibility that the
process of ffs_ep0_write/ffs_ep0_read get into a race condition
due to ep0req being freed up from functionfs_unbind.
Consider the scenario that the ffs_ep0_write calls the ffs_ep0_queue_wait
by taking a lock &ffs->ev.waitq.lock. However, the functionfs_unbind isn't
bounded so it can go ahead and mark the ep0req to NULL, and since there
is no NULL check in ffs_ep0_queue_wait we will end up in use-after-free.
Fix this by making a serialized execution between the two functions using
a mutex_lock(ffs->mutex).
Security readout for executives and security teams
Plain-English summary
CVE-2022-49755 is a Linux kernel use-after-free in USB gadget FunctionFS handling. A local user who can reach this kernel path could potentially crash the system or gain broader control. The issue matters most for embedded, mobile, appliance, and developer systems using USB gadget features, rather than ordinary remote-only servers.
Executive priority
Treat as high priority for Linux fleets that use USB gadget features or run untrusted local workloads. For standard servers without USB gadget exposure, handle through normal kernel patching cycles after confirming configuration.
Technical view
The bug is a race between ffs_ep0_write/ffs_ep0_read through ffs_ep0_queue_wait and functionfs_unbind during fast composition switching. functionfs_unbind can clear ep0req while queue-wait logic lacks a NULL check, causing use-after-free. The fix serializes execution with ffs->mutex. CVSS 3.1 is 7.8, local, low complexity, low privilege, no user interaction.
Likely exposure
Exposure is most likely where Linux USB gadget FunctionFS is enabled and accessible to local users or service contexts. Systems that do not use USB gadget functionality have lower practical exposure. The provided affected-version data is not fully normalized, so confirm exposure against distribution kernel advisories and the listed upstream stable fixes.
Exploitation context
The source bundle does not show CISA KEV listing or any cited active exploitation. The vulnerability is local, not network-reachable by itself. Exploitation would require access to the relevant USB gadget FunctionFS code path and race timing during composition switching.
Researcher notes
Evidence supports a kernel race leading to CWE-416 use-after-free. The source bundle names upstream stable commits but does not provide exploit evidence, distribution-specific fixed versions, or complete normalized affected ranges. Validate against actual kernel trees, configs, and vendor backports.
Mitigation direction
Apply vendor kernel updates containing the listed upstream stable fixes.
If patching is delayed, disable unused USB gadget FunctionFS functionality where feasible.
Restrict untrusted local access on systems exposing USB gadget workflows.
Check distribution advisories before assuming a custom kernel is fixed.
Validation and detection
Inventory Linux kernel versions and compare them with vendor-fixed releases.
Confirm whether USB gadget FunctionFS is enabled in kernel configuration.
Check whether downstream kernel packages include the referenced stable commits.
Prioritize embedded, mobile, appliance, and USB OTG systems for review.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-416: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
1ADP providers
8Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-416 · source CWE mapping
Use After Free
Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.