{"api_version":"1","generated_at":"2026-07-23T13:29:48+00:00","cve":"CVE-2024-36894","urls":{"html":"https://cve.report/CVE-2024-36894","api":"https://cve.report/api/cve/CVE-2024-36894.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2024-36894","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2024-36894"},"summary":{"title":"usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete\n\nFFS based applications can utilize the aio_cancel() callback to dequeue\npending USB requests submitted to the UDC.  There is a scenario where the\nFFS application issues an AIO cancel call, while the UDC is handling a\nsoft disconnect.  For a DWC3 based implementation, the callstack looks\nlike the following:\n\n    DWC3 Gadget                               FFS Application\ndwc3_gadget_soft_disconnect()              ...\n  --> dwc3_stop_active_transfers()\n    --> dwc3_gadget_giveback(-ESHUTDOWN)\n      --> ffs_epfile_async_io_complete()   ffs_aio_cancel()\n        --> usb_ep_free_request()            --> usb_ep_dequeue()\n\nThere is currently no locking implemented between the AIO completion\nhandler and AIO cancel, so the issue occurs if the completion routine is\nrunning in parallel to an AIO cancel call coming from the FFS application.\nAs the completion call frees the USB request (io_data->req) the FFS\napplication is also referencing it for the usb_ep_dequeue() call.  This can\nlead to accessing a stale/hanging pointer.\n\ncommit b566d38857fc (\"usb: gadget: f_fs: use io_data->status consistently\")\nrelocated the usb_ep_free_request() into ffs_epfile_async_io_complete().\nHowever, in order to properly implement locking to mitigate this issue, the\nspinlock can't be added to ffs_epfile_async_io_complete(), as\nusb_ep_dequeue() (if successfully dequeuing a USB request) will call the\nfunction driver's completion handler in the same context.  Hence, leading\ninto a deadlock.\n\nFix this issue by moving the usb_ep_free_request() back to\nffs_user_copy_worker(), and ensuring that it explicitly sets io_data->req\nto NULL after freeing it within the ffs->eps_lock.  This resolves the race\ncondition above, as the ffs_aio_cancel() routine will not continue\nattempting to dequeue a request that has already been freed, or the\nffs_user_copy_work() not freeing the USB request until the AIO cancel is\ndone referencing it.\n\nThis fix depends on\n  commit b566d38857fc (\"usb: gadget: f_fs: use io_data->status\n  consistently\")","state":"PUBLISHED","assigner":"Linux","published_at":"2024-05-30 16:15:12","updated_at":"2026-05-12 12:16:48"},"problem_types":["CWE-362","CWE-362 CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')"],"metrics":[{"version":"3.1","source":"ADP","type":"DECLARED","score":"5.6","severity":"MEDIUM","vector":"CVSS:3.1/AV:P/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:H","data":{"attackComplexity":"HIGH","attackVector":"PHYSICAL","availabilityImpact":"HIGH","baseScore":5.6,"baseSeverity":"MEDIUM","confidentialityImpact":"HIGH","integrityImpact":"NONE","privilegesRequired":"LOW","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:P/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:H","version":"3.1"}},{"version":"3.1","source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary","score":"5.6","severity":"MEDIUM","vector":"CVSS:3.1/AV:P/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:H","data":{"version":"3.1","vectorString":"CVSS:3.1/AV:P/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:H","baseScore":5.6,"baseSeverity":"MEDIUM","attackVector":"PHYSICAL","attackComplexity":"HIGH","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"NONE","availabilityImpact":"HIGH"}}],"references":[{"url":"https://git.kernel.org/stable/c/a0fdccb1c9e027e3195f947f61aa87d6d0d2ea14","name":"https://git.kernel.org/stable/c/a0fdccb1c9e027e3195f947f61aa87d6d0d2ea14","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/73c05ad46bb4fbbdb346004651576d1c8dbcffbb","name":"https://git.kernel.org/stable/c/73c05ad46bb4fbbdb346004651576d1c8dbcffbb","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/d7461830823242702f5d84084bcccb25159003f4","name":"https://git.kernel.org/stable/c/d7461830823242702f5d84084bcccb25159003f4","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/3613e5023f09b3308545e9d1acda86017ebd418a","name":"https://git.kernel.org/stable/c/3613e5023f09b3308545e9d1acda86017ebd418a","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html","name":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html","refsource":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/f71a53148ce34898fef099b75386a3a9f4449311","name":"https://git.kernel.org/stable/c/f71a53148ce34898fef099b75386a3a9f4449311","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/9e72ef59cbe61cd1243857a6418ca92104275867","name":"https://git.kernel.org/stable/c/9e72ef59cbe61cd1243857a6418ca92104275867","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/24729b307eefcd7c476065cd7351c1a018082c19","name":"https://git.kernel.org/stable/c/24729b307eefcd7c476065cd7351c1a018082c19","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-355557.html","name":"https://cert-portal.siemens.com/productcert/html/ssa-355557.html","refsource":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html","name":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/e500b1c4e29ad0bd1c1332a1eaea2913627a92dd","name":"https://git.kernel.org/stable/c/e500b1c4e29ad0bd1c1332a1eaea2913627a92dd","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2024-36894","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-36894","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2e4c7553cd6f9c68bb741582dcb614edcbeca70f f71a53148ce34898fef099b75386a3a9f4449311 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2e4c7553cd6f9c68bb741582dcb614edcbeca70f 9e72ef59cbe61cd1243857a6418ca92104275867 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2e4c7553cd6f9c68bb741582dcb614edcbeca70f e500b1c4e29ad0bd1c1332a1eaea2913627a92dd git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2e4c7553cd6f9c68bb741582dcb614edcbeca70f 3613e5023f09b3308545e9d1acda86017ebd418a git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2e4c7553cd6f9c68bb741582dcb614edcbeca70f a0fdccb1c9e027e3195f947f61aa87d6d0d2ea14 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2e4c7553cd6f9c68bb741582dcb614edcbeca70f 73c05ad46bb4fbbdb346004651576d1c8dbcffbb git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2e4c7553cd6f9c68bb741582dcb614edcbeca70f d7461830823242702f5d84084bcccb25159003f4 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2e4c7553cd6f9c68bb741582dcb614edcbeca70f 24729b307eefcd7c476065cd7351c1a018082c19 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 3.15","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 3.15 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 4.19.317 4.19.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.4.279 5.4.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.10.221 5.10.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.162 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.95 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.31 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.8.10 6.8.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.9 * original_commit_for_fix","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"affected 2e4c7553cd6f 73c05ad46bb4 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"affected 2e4c7553cd6f d74618308232 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"affected 2e4c7553cd6f 24729b307eef custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"affected 2e4c7553cd6f f71a53148ce3 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"affected 2e4c7553cd6f 9e72ef59cbe6 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"affected 2e4c7553cd6f e500b1c4e29a custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"affected 2e4c7553cd6f 3613e5023f09 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"affected 2e4c7553cd6f a0fdccb1c9e0 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"affected 3.15","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"unaffected 3.15 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"unaffected 4.19.317 4.20 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"unaffected 5.4.279 5.5 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"unaffected 5.10.221 5.11 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"unaffected 5.15.162 5.16 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"unaffected 6.1.95 6.2 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"unaffected 6.6.31 6.7 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"unaffected 6.8.10 6.9 custom","platforms":[]},{"source":"ADP","vendor":"linux","product":"linux_kernel","version":"unaffected 6.9 * custom","platforms":[]},{"source":"ADP","vendor":"Siemens","product":"RUGGEDCOM RST2428P","version":"unaffected * custom","platforms":[]},{"source":"ADP","vendor":"Siemens","product":"SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family","version":"unaffected * custom","platforms":[]},{"source":"ADP","vendor":"Siemens","product":"SCALANCE XCM-/XRM-/XCH-/XRH-300 family","version":"unaffected * custom","platforms":[]},{"source":"ADP","vendor":"Siemens","product":"SIMATIC S7-1500 TM MFP - GNU/Linux subsystem","version":"affected * custom","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[{"cve_year":"2024","cve_id":"36894","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"o","cpe4":"linux","cpe5":"linux_kernel","cpe6":"*","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"*","cpe11":"*","cpe12":"*","cpe13":"*"}],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"adp":[{"affected":[{"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"],"defaultStatus":"unknown","product":"linux_kernel","vendor":"linux","versions":[{"lessThan":"73c05ad46bb4","status":"affected","version":"2e4c7553cd6f","versionType":"custom"}]},{"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"],"defaultStatus":"unknown","product":"linux_kernel","vendor":"linux","versions":[{"lessThan":"d74618308232","status":"affected","version":"2e4c7553cd6f","versionType":"custom"}]},{"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"],"defaultStatus":"unknown","product":"linux_kernel","vendor":"linux","versions":[{"lessThan":"24729b307eef","status":"affected","version":"2e4c7553cd6f","versionType":"custom"},{"lessThan":"f71a53148ce3","status":"affected","version":"2e4c7553cd6f","versionType":"custom"},{"lessThan":"9e72ef59cbe6","status":"affected","version":"2e4c7553cd6f","versionType":"custom"},{"lessThan":"e500b1c4e29a","status":"affected","version":"2e4c7553cd6f","versionType":"custom"},{"lessThan":"3613e5023f09","status":"affected","version":"2e4c7553cd6f","versionType":"custom"},{"lessThan":"a0fdccb1c9e0","status":"affected","version":"2e4c7553cd6f","versionType":"custom"},{"status":"affected","version":"3.15"},{"lessThan":"3.15","status":"unaffected","version":"0","versionType":"custom"},{"lessThanOrEqual":"4.20","status":"unaffected","version":"4.19.317","versionType":"custom"},{"lessThanOrEqual":"5.5","status":"unaffected","version":"5.4.279","versionType":"custom"},{"lessThanOrEqual":"5.11","status":"unaffected","version":"5.10.221","versionType":"custom"},{"lessThanOrEqual":"5.16","status":"unaffected","version":"5.15.162","versionType":"custom"},{"lessThanOrEqual":"6.2","status":"unaffected","version":"6.1.95","versionType":"custom"},{"lessThanOrEqual":"6.7","status":"unaffected","version":"6.6.31","versionType":"custom"},{"lessThanOrEqual":"6.9","status":"unaffected","version":"6.8.10","versionType":"custom"},{"lessThanOrEqual":"*","status":"unaffected","version":"6.9","versionType":"custom"}]}],"metrics":[{"cvssV3_1":{"attackComplexity":"HIGH","attackVector":"PHYSICAL","availabilityImpact":"HIGH","baseScore":5.6,"baseSeverity":"MEDIUM","confidentialityImpact":"HIGH","integrityImpact":"NONE","privilegesRequired":"LOW","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:P/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:H","version":"3.1"}},{"other":{"content":{"id":"CVE-2024-36894","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","timestamp":"2024-06-03T15:53:00.949597Z","version":"2.0.3"},"type":"ssvc"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-362","description":"CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2024-08-21T16:17:27.715Z","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP"},"title":"CISA ADP Vulnrichment"},{"providerMetadata":{"dateUpdated":"2025-11-03T21:55:22.274Z","orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE"},"references":[{"tags":["x_transferred"],"url":"https://git.kernel.org/stable/c/f71a53148ce34898fef099b75386a3a9f4449311"},{"tags":["x_transferred"],"url":"https://git.kernel.org/stable/c/9e72ef59cbe61cd1243857a6418ca92104275867"},{"tags":["x_transferred"],"url":"https://git.kernel.org/stable/c/e500b1c4e29ad0bd1c1332a1eaea2913627a92dd"},{"tags":["x_transferred"],"url":"https://git.kernel.org/stable/c/3613e5023f09b3308545e9d1acda86017ebd418a"},{"tags":["x_transferred"],"url":"https://git.kernel.org/stable/c/a0fdccb1c9e027e3195f947f61aa87d6d0d2ea14"},{"tags":["x_transferred"],"url":"https://git.kernel.org/stable/c/73c05ad46bb4fbbdb346004651576d1c8dbcffbb"},{"tags":["x_transferred"],"url":"https://git.kernel.org/stable/c/d7461830823242702f5d84084bcccb25159003f4"},{"tags":["x_transferred"],"url":"https://git.kernel.org/stable/c/24729b307eefcd7c476065cd7351c1a018082c19"},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"}],"title":"CVE Program Container"},{"affected":[{"defaultStatus":"unknown","product":"RUGGEDCOM RST2428P","vendor":"Siemens","versions":[{"lessThan":"*","status":"unaffected","version":"0","versionType":"custom"}]},{"defaultStatus":"unknown","product":"SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family","vendor":"Siemens","versions":[{"lessThan":"*","status":"unaffected","version":"0","versionType":"custom"}]},{"defaultStatus":"unknown","product":"SCALANCE XCM-/XRM-/XCH-/XRH-300 family","vendor":"Siemens","versions":[{"lessThan":"*","status":"unaffected","version":"0","versionType":"custom"}]},{"defaultStatus":"unknown","product":"SIMATIC S7-1500 TM MFP - GNU/Linux subsystem","vendor":"Siemens","versions":[{"lessThan":"*","status":"affected","version":"0","versionType":"custom"}]}],"providerMetadata":{"dateUpdated":"2026-05-12T11:53:58.433Z","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","shortName":"siemens-SADP"},"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-355557.html"}],"x_adpType":"supplier"}],"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/usb/gadget/function/f_fs.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"f71a53148ce34898fef099b75386a3a9f4449311","status":"affected","version":"2e4c7553cd6f9c68bb741582dcb614edcbeca70f","versionType":"git"},{"lessThan":"9e72ef59cbe61cd1243857a6418ca92104275867","status":"affected","version":"2e4c7553cd6f9c68bb741582dcb614edcbeca70f","versionType":"git"},{"lessThan":"e500b1c4e29ad0bd1c1332a1eaea2913627a92dd","status":"affected","version":"2e4c7553cd6f9c68bb741582dcb614edcbeca70f","versionType":"git"},{"lessThan":"3613e5023f09b3308545e9d1acda86017ebd418a","status":"affected","version":"2e4c7553cd6f9c68bb741582dcb614edcbeca70f","versionType":"git"},{"lessThan":"a0fdccb1c9e027e3195f947f61aa87d6d0d2ea14","status":"affected","version":"2e4c7553cd6f9c68bb741582dcb614edcbeca70f","versionType":"git"},{"lessThan":"73c05ad46bb4fbbdb346004651576d1c8dbcffbb","status":"affected","version":"2e4c7553cd6f9c68bb741582dcb614edcbeca70f","versionType":"git"},{"lessThan":"d7461830823242702f5d84084bcccb25159003f4","status":"affected","version":"2e4c7553cd6f9c68bb741582dcb614edcbeca70f","versionType":"git"},{"lessThan":"24729b307eefcd7c476065cd7351c1a018082c19","status":"affected","version":"2e4c7553cd6f9c68bb741582dcb614edcbeca70f","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/usb/gadget/function/f_fs.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"3.15"},{"lessThan":"3.15","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"4.19.*","status":"unaffected","version":"4.19.317","versionType":"semver"},{"lessThanOrEqual":"5.4.*","status":"unaffected","version":"5.4.279","versionType":"semver"},{"lessThanOrEqual":"5.10.*","status":"unaffected","version":"5.10.221","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.162","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.95","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.31","versionType":"semver"},{"lessThanOrEqual":"6.8.*","status":"unaffected","version":"6.8.10","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"6.9","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"4.19.317","versionStartIncluding":"3.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.4.279","versionStartIncluding":"3.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.10.221","versionStartIncluding":"3.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.162","versionStartIncluding":"3.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.95","versionStartIncluding":"3.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.31","versionStartIncluding":"3.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.8.10","versionStartIncluding":"3.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.9","versionStartIncluding":"3.15","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete\n\nFFS based applications can utilize the aio_cancel() callback to dequeue\npending USB requests submitted to the UDC.  There is a scenario where the\nFFS application issues an AIO cancel call, while the UDC is handling a\nsoft disconnect.  For a DWC3 based implementation, the callstack looks\nlike the following:\n\n    DWC3 Gadget                               FFS Application\ndwc3_gadget_soft_disconnect()              ...\n  --> dwc3_stop_active_transfers()\n    --> dwc3_gadget_giveback(-ESHUTDOWN)\n      --> ffs_epfile_async_io_complete()   ffs_aio_cancel()\n        --> usb_ep_free_request()            --> usb_ep_dequeue()\n\nThere is currently no locking implemented between the AIO completion\nhandler and AIO cancel, so the issue occurs if the completion routine is\nrunning in parallel to an AIO cancel call coming from the FFS application.\nAs the completion call frees the USB request (io_data->req) the FFS\napplication is also referencing it for the usb_ep_dequeue() call.  This can\nlead to accessing a stale/hanging pointer.\n\ncommit b566d38857fc (\"usb: gadget: f_fs: use io_data->status consistently\")\nrelocated the usb_ep_free_request() into ffs_epfile_async_io_complete().\nHowever, in order to properly implement locking to mitigate this issue, the\nspinlock can't be added to ffs_epfile_async_io_complete(), as\nusb_ep_dequeue() (if successfully dequeuing a USB request) will call the\nfunction driver's completion handler in the same context.  Hence, leading\ninto a deadlock.\n\nFix this issue by moving the usb_ep_free_request() back to\nffs_user_copy_worker(), and ensuring that it explicitly sets io_data->req\nto NULL after freeing it within the ffs->eps_lock.  This resolves the race\ncondition above, as the ffs_aio_cancel() routine will not continue\nattempting to dequeue a request that has already been freed, or the\nffs_user_copy_work() not freeing the USB request until the AIO cancel is\ndone referencing it.\n\nThis fix depends on\n  commit b566d38857fc (\"usb: gadget: f_fs: use io_data->status\n  consistently\")"}],"providerMetadata":{"dateUpdated":"2026-05-11T20:16:32.967Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/f71a53148ce34898fef099b75386a3a9f4449311"},{"url":"https://git.kernel.org/stable/c/9e72ef59cbe61cd1243857a6418ca92104275867"},{"url":"https://git.kernel.org/stable/c/e500b1c4e29ad0bd1c1332a1eaea2913627a92dd"},{"url":"https://git.kernel.org/stable/c/3613e5023f09b3308545e9d1acda86017ebd418a"},{"url":"https://git.kernel.org/stable/c/a0fdccb1c9e027e3195f947f61aa87d6d0d2ea14"},{"url":"https://git.kernel.org/stable/c/73c05ad46bb4fbbdb346004651576d1c8dbcffbb"},{"url":"https://git.kernel.org/stable/c/d7461830823242702f5d84084bcccb25159003f4"},{"url":"https://git.kernel.org/stable/c/24729b307eefcd7c476065cd7351c1a018082c19"}],"title":"usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2024-36894","datePublished":"2024-05-30T15:28:59.689Z","dateReserved":"2024-05-30T15:25:07.066Z","dateUpdated":"2026-05-12T11:53:58.433Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2024-05-30 16:15:12","lastModifiedDate":"2026-05-12 12:16:48","problem_types":["CWE-362","CWE-362 CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')"],"metrics":{"cvssMetricV31":[{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:P/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:H","baseScore":5.6,"baseSeverity":"MEDIUM","attackVector":"PHYSICAL","attackComplexity":"HIGH","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"NONE","availabilityImpact":"HIGH"},"exploitabilityScore":0.4,"impactScore":5.2}]},"configurations":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.15","versionEndExcluding":"4.19.317","matchCriteriaId":"60021762-BA95-4C90-A0C7-9570F479FFCA"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"5.4.279","matchCriteriaId":"F4E38E58-1B9F-4DF2-AD3D-A8BEAA2959D8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.5","versionEndExcluding":"5.10.221","matchCriteriaId":"659E1520-6345-41AF-B893-A7C0647585A0"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"5.15.162","matchCriteriaId":"10A39ACC-3005-40E8-875C-98A372D1FFD5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.1.95","matchCriteriaId":"D435765D-2766-44F5-B319-F713A13E35CE"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.2","versionEndExcluding":"6.6.31","matchCriteriaId":"CDDB1F69-36AC-41C1-9192-E7CCEF5FFC00"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.7","versionEndExcluding":"6.8.10","matchCriteriaId":"6A6B920C-8D8F-4130-86B4-AD334F4CF2E3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:6.9:rc1:*:*:*:*:*:*","matchCriteriaId":"22BEDD49-2C6D-402D-9DBF-6646F6ECD10B"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:6.9:rc2:*:*:*:*:*:*","matchCriteriaId":"DF73CB2A-DFFD-46FB-9BFE-AA394F27EA37"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:6.9:rc3:*:*:*:*:*:*","matchCriteriaId":"52048DDA-FC5A-4363-95A0-A6357B4D7F8C"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:6.9:rc4:*:*:*:*:*:*","matchCriteriaId":"A06B2CCF-3F43-4FA9-8773-C83C3F5764B2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:6.9:rc5:*:*:*:*:*:*","matchCriteriaId":"F850DCEC-E08B-4317-A33B-D2DCF39F601B"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:6.9:rc6:*:*:*:*:*:*","matchCriteriaId":"91326417-E981-482E-A5A3-28BC1327521B"}]}]}]},"legacy_mitre":{"record":{"CveYear":"2024","CveId":"36894","Ordinal":"1","Title":"usb: gadget: f_fs: Fix race between aio_cancel() and AIO request","CVE":"CVE-2024-36894","Year":"2024"},"notes":[{"CveYear":"2024","CveId":"36894","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete\n\nFFS based applications can utilize the aio_cancel() callback to dequeue\npending USB requests submitted to the UDC.  There is a scenario where the\nFFS application issues an AIO cancel call, while the UDC is handling a\nsoft disconnect.  For a DWC3 based implementation, the callstack looks\nlike the following:\n\n    DWC3 Gadget                               FFS Application\ndwc3_gadget_soft_disconnect()              ...\n  --> dwc3_stop_active_transfers()\n    --> dwc3_gadget_giveback(-ESHUTDOWN)\n      --> ffs_epfile_async_io_complete()   ffs_aio_cancel()\n        --> usb_ep_free_request()            --> usb_ep_dequeue()\n\nThere is currently no locking implemented between the AIO completion\nhandler and AIO cancel, so the issue occurs if the completion routine is\nrunning in parallel to an AIO cancel call coming from the FFS application.\nAs the completion call frees the USB request (io_data->req) the FFS\napplication is also referencing it for the usb_ep_dequeue() call.  This can\nlead to accessing a stale/hanging pointer.\n\ncommit b566d38857fc (\"usb: gadget: f_fs: use io_data->status consistently\")\nrelocated the usb_ep_free_request() into ffs_epfile_async_io_complete().\nHowever, in order to properly implement locking to mitigate this issue, the\nspinlock can't be added to ffs_epfile_async_io_complete(), as\nusb_ep_dequeue() (if successfully dequeuing a USB request) will call the\nfunction driver's completion handler in the same context.  Hence, leading\ninto a deadlock.\n\nFix this issue by moving the usb_ep_free_request() back to\nffs_user_copy_worker(), and ensuring that it explicitly sets io_data->req\nto NULL after freeing it within the ffs->eps_lock.  This resolves the race\ncondition above, as the ffs_aio_cancel() routine will not continue\nattempting to dequeue a request that has already been freed, or the\nffs_user_copy_work() not freeing the USB request until the AIO cancel is\ndone referencing it.\n\nThis fix depends on\n  commit b566d38857fc (\"usb: gadget: f_fs: use io_data->status\n  consistently\")","Type":"Description","Title":"usb: gadget: f_fs: Fix race between aio_cancel() and AIO request"}]}}}