CVE-2024-57913: usb: gadget: f_fs: Remove WARN_ON in functionfs_bind
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_fs: Remove WARN_ON in functionfs_bind
This commit addresses an issue related to below kernel panic where
panic_on_warn is enabled. It is caused by the unnecessary use of WARN_ON
in functionsfs_bind, which easily leads to the following scenarios.
1.adb_write in adbd 2. UDC write via configfs
================= =====================
->usb_ffs_open_thread() ->UDC write
->open_functionfs() ->configfs_write_iter()
->adb_open() ->gadget_dev_desc_UDC_store()
->adb_write() ->usb_gadget_register_driver_owner
->driver_register()
->StartMonitor() ->bus_add_driver()
->adb_read() ->gadget_bind_driver()
<times-out without BIND event> ->configfs_composite_bind()
->usb_add_function()
->open_functionfs() ->ffs_func_bind()
->adb_open() ->functionfs_bind()
<ffs->state !=FFS_ACTIVE>
The adb_open, adb_read, and adb_write operations are invoked from the
daemon, but trying to bind the function is a process that is invoked by
UDC write through configfs, which opens up the possibility of a race
condition between the two paths. In this race scenario, the kernel panic
occurs due to the WARN_ON from functionfs_bind when panic_on_warn is
enabled. This commit fixes the kernel panic by removing the unnecessary
WARN_ON.
Kernel panic - not syncing: kernel: panic_on_warn set ...
[ 14.542395] Call trace:
[ 14.542464] ffs_func_bind+0x1c8/0x14a8
[ 14.542468] usb_add_function+0xcc/0x1f0
[ 14.542473] configfs_composite_bind+0x468/0x588
[ 14.542478] gadget_bind_driver+0x108/0x27c
[ 14.542483] really_probe+0x190/0x374
[ 14.542488] __driver_probe_device+0xa0/0x12c
[ 14.542492] driver_probe_device+0x3c/0x220
[ 14.542498] __driver_attach+0x11c/0x1fc
[ 14.542502] bus_for_each_dev+0x104/0x160
[ 14.542506] driver_attach+0x24/0x34
[ 14.542510] bus_add_driver+0x154/0x270
[ 14.542514] driver_register+0x68/0x104
[ 14.542518] usb_gadget_register_driver_owner+0x48/0xf4
[ 14.542523] gadget_dev_desc_UDC_store+0xf8/0x144
[ 14.542526] configfs_write_iter+0xf0/0x138
Security readout for executives and security teams
Plain-English summary
CVE-2024-57913 is a Linux kernel denial-of-service issue. A race in USB gadget FunctionFS can trigger a kernel warning; on systems configured to panic on warnings, this can crash the device. This is most relevant to embedded, mobile, or appliance-like Linux systems using USB gadget features such as FunctionFS/ADB.
Executive priority
Treat as a targeted availability risk for embedded or USB-gadget Linux devices. Prioritize patching where device crashes affect operations, field reliability, or product uptime. Lower priority for systems without USB gadget exposure.
Technical view
The issue is a CWE-362 race condition in usb gadget f_fs functionfs_bind. Concurrent FunctionFS open activity and UDC binding through configfs can reach an unexpected state. The upstream fix removes an unnecessary WARN_ON that can cause panic when panic_on_warn is enabled. CVSS is 4.7: local, high complexity, low privileges, availability impact only.
Likely exposure
Exposure is likely limited to Linux systems using USB gadget FunctionFS/configfs paths, especially where panic_on_warn is enabled. General-purpose servers not using USB gadget functionality are less likely to be exposed, but kernel inventory is still required.
Exploitation context
The provided sources do not report active exploitation, and the CVE is not marked KEV. Exploitation requires local conditions and a race between FunctionFS activity and configfs UDC binding. Impact is availability loss through kernel panic, not data theft or privilege escalation.
Researcher notes
The root cause is a race-prone WARN_ON rather than memory corruption. The security relevance depends heavily on panic_on_warn and reachable FunctionFS/configfs paths. Sources provide fixes, but not public weaponization or broad exploitation evidence.
Mitigation direction
Update to a vendor kernel release containing the stable fixes for CVE-2024-57913.
For Debian LTS, apply the relevant Debian kernel advisories referenced for this CVE.
For Siemens products, follow SSA-265688 product-specific guidance.
If patching is delayed, assess exposure to panic_on_warn and USB gadget FunctionFS usage.
Validation and detection
Inventory Linux kernel versions and map them to vendor advisories or stable commit coverage.
Check whether affected systems use USB gadget FunctionFS, configfs UDC binding, or ADB-like workflows.
Confirm the running kernel includes the vendor fix removing the functionfs_bind WARN_ON.
Review crash logs for panic_on_warn traces involving ffs_func_bind or configfs_composite_bind.
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-362: 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.
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-362 · source CWE mapping
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.