Skip to main content
Network Thinking Solutions Logo

CVE-2024-36894

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete FFS based applications can utilize the aio_cancel() callback to dequeue pending USB requests submitted to the UDC.

All CVEs
CVE-2024-36894Published 5/30/2024

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete FFS based applications can utilize the aio_cancel() callback to dequeue pending USB requests submitted to the UDC.

Vendor advisory
CVSS7.8High

Overview

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete FFS based applications can utilize the aio_cancel() callback to dequeue pending USB requests submitted to the UDC. There is a scenario where the FFS application issues an AIO cancel call, while the UDC is handling a soft disconnect. For a DWC3 based implementation, the callstack looks like the following: DWC3 Gadget FFS Application dwc3_gadget_soft_disconnect() ... --> dwc3_stop_active_transfers() --> dwc3_gadget_giveback(-ESHUTDOWN) --> ffs_epfile_async_io_complete() ffs_aio_cancel() --> usb_ep_free_request() --> usb_ep_dequeue() There is currently no locking implemented between the AIO completion handler and AIO cancel, so the issue occurs if the completion routine is running in parallel to an AIO cancel call coming from the FFS application. As the completion call frees the USB request (io_data->req) the FFS application is also referencing it for the usb_ep_dequeue() call. This can lead to accessing a stale/hanging pointer. commit b566d38857fc ("usb: gadget: f_fs: use io_data->status consistently") relocated the usb_ep_free_request() into ffs_epfile_async_io_complete(). However, in order to properly implement locking to mitigate this issue, the spinlock can't be added to ffs_epfile_async_io_complete(), as usb_ep_dequeue() (if successfully dequeuing a USB request) will call the function driver's completion handler in the same context. Hence, leading into a deadlock. Fix this issue by moving the usb_ep_free_request() back to ffs_user_copy_worker(), and ensuring that it explicitly sets io_data->req to NULL after freeing it within the ffs->eps_lock. This resolves the race condition above, as the ffs_aio_cancel() routine will not continue attempting to dequeue a request that has already been freed, or the ffs_user_copy_work() not freeing the USB request until the AIO cancel is done referencing it. This fix depends on commit b566d38857fc ("usb: gadget: f_fs: use io_data->status consistently")

Published
5/30/2024
Last modified
10/15/2026
CVE assigner
Not available
NVD analysis
Not available

Exploitation

No CISA KEV flag in the saved record

An absent KEV flag does not establish that exploitation has never occurred. Verify current intelligence before prioritizing work.

EPSS predictions and CISA SSVC assessments are not imported here. Review additional intelligence on Cloudflare

Affected products

Affected-version rules published in the advisory. Conditions and uncertain comparisons require verification.

Vendor / productAffected versionsPlatform / conditionsEvidence
linux kernel
linux
≥ 3.15, < 4.19.317

Verify advisory

Source
linux kernel
linux
≥ 4.20, < 5.4.279

Verify advisory

Source
linux kernel
linux
≥ 5.5, < 5.10.221

Verify advisory

Source
linux kernel
linux
≥ 5.11, < 5.15.162

Verify advisory

Source
linux kernel
linux
≥ 5.16, < 6.1.95

Verify advisory

Source
linux kernel
linux
≥ 6.2, < 6.6.31

Verify advisory

Source
linux kernel
linux
≥ 6.7, < 6.8.10

Verify advisory

Source
linux kernel
linux
6.9

Verify advisory

The advisory has platform, edition, hardware, or configuration conditions not verified by software inventory.

Source
Linux
Linux
≥ 2e4c7553cd6f9c68bb741582dcb614edcbeca70f, < f71a53148ce34898fef099b75386a3a9f4449311

Verify advisory

Source
Linux
Linux
≥ 2e4c7553cd6f9c68bb741582dcb614edcbeca70f, < 9e72ef59cbe61cd1243857a6418ca92104275867

Verify advisory

Source
Linux
Linux
≥ 2e4c7553cd6f9c68bb741582dcb614edcbeca70f, < e500b1c4e29ad0bd1c1332a1eaea2913627a92dd

Verify advisory

Source
Linux
Linux
≥ 2e4c7553cd6f9c68bb741582dcb614edcbeca70f, < 3613e5023f09b3308545e9d1acda86017ebd418a

Verify advisory

Source
Linux
Linux
≥ 2e4c7553cd6f9c68bb741582dcb614edcbeca70f, < a0fdccb1c9e027e3195f947f61aa87d6d0d2ea14

Verify advisory

Source
Linux
Linux
≥ 2e4c7553cd6f9c68bb741582dcb614edcbeca70f, < 73c05ad46bb4fbbdb346004651576d1c8dbcffbb

Verify advisory

Source
Linux
Linux
≥ 2e4c7553cd6f9c68bb741582dcb614edcbeca70f, < d7461830823242702f5d84084bcccb25159003f4

Verify advisory

Source
Linux
Linux
≥ 2e4c7553cd6f9c68bb741582dcb614edcbeca70f, < 24729b307eefcd7c476065cd7351c1a018082c19

Verify advisory

Source
Linux
Linux
3.15

Verify advisory

Source
linux_kernel
linux
≥ 2e4c7553cd6f, < 73c05ad46bb4

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
linux_kernel
linux
≥ 2e4c7553cd6f, < d74618308232

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
linux_kernel
linux
≥ 2e4c7553cd6f, < 24729b307eef

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
linux_kernel
linux
≥ 2e4c7553cd6f, < f71a53148ce3

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
linux_kernel
linux
≥ 2e4c7553cd6f, < 9e72ef59cbe6

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
linux_kernel
linux
≥ 2e4c7553cd6f, < e500b1c4e29a

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
linux_kernel
linux
≥ 2e4c7553cd6f, < 3613e5023f09

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
linux_kernel
linux
≥ 2e4c7553cd6f, < a0fdccb1c9e0

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
linux_kernel
linux
3.15

Verify advisory

Verify the advisory platform, edition, update channel, and any version exceptions.

Source
SIMATIC S7-1500 TM MFP - GNU/Linux subsystem
Siemens
< V1.1.1

Verify advisory

Source

Recommended actions

Verify the product, installed version, platform, and advisory prerequisites on each system. Apply the vendor's applicable fixed release or mitigation. An affected-range boundary alone is not a universal update recommendation.

Vendor advisory links

Derived from non-aggregator references because the source record has no vendor tags. Verify the advisory before acting on it.

Severity

CVSS describes technical impact. It is separate from exploitation evidence.

Published headline score: 7.8. Score version, vector, and attribution are not available in this record. Additional score details appear when the source record is next refreshed.

Sources & references

Sources: Official CVE List, NVD and cve.now (summaries CC BY 4.0). Uses NVD data; not endorsed by NVD.