CVE-2024-36894 (GCVE-0-2024-36894)
Vulnerability from cvelistv5
Published
2024-05-30 15:28
Modified
2026-08-05 11:31
Summary
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")
Impacted products
Vendor Product Version
Linux Linux Version: 2e4c7553cd6f9c68bb741582dcb614edcbeca70f
Version: 2e4c7553cd6f9c68bb741582dcb614edcbeca70f
Version: 2e4c7553cd6f9c68bb741582dcb614edcbeca70f
Version: 2e4c7553cd6f9c68bb741582dcb614edcbeca70f
Version: 2e4c7553cd6f9c68bb741582dcb614edcbeca70f
Version: 2e4c7553cd6f9c68bb741582dcb614edcbeca70f
Version: 2e4c7553cd6f9c68bb741582dcb614edcbeca70f
Version: 2e4c7553cd6f9c68bb741582dcb614edcbeca70f
Create a notification for this product.
Show details on NVD website


{
  "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 (\u0027Race Condition\u0027)",
                "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  --\u003e dwc3_stop_active_transfers()\n    --\u003e dwc3_gadget_giveback(-ESHUTDOWN)\n      --\u003e ffs_epfile_async_io_complete()   ffs_aio_cancel()\n        --\u003e usb_ep_free_request()            --\u003e 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-\u003ereq) 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-\u003estatus 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\u0027t be added to ffs_epfile_async_io_complete(), as\nusb_ep_dequeue() (if successfully dequeuing a USB request) will call the\nfunction driver\u0027s 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-\u003ereq\nto NULL after freeing it within the ffs-\u003eeps_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-\u003estatus\n  consistently\")"
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - Both sides of the race are driven by local syscalls \u2014 `io_submit`/`io_cancel`/`io_destroy` on an AIO context plus `close()` of ep0 to force the mass `-ESHUTDOWN` giveback \u2014 with no USB host, cable, or physical access required. This is the gadget\u0027s userspace-facing API (f_fs), not a host-side driver parsing attacker-supplied descriptors, matching the AV:L precedent set for other gadget-side UAF races such as CVE-2024-38628.\nAC:L - The attacker controls both sides: it submits the AIO requests, triggers the bulk giveback that frees them, and then invokes `ffs_aio_cancel()` on every stale pointer at once via `free_ioctx_users()`. The ordered (max_active=1) `io_completion_wq` and the sleeping `kthread_use_mm`/`copy_to_iter` in the worker leave a huge window, and the whole sequence is freely repeatable.\nPR:L - The attacker needs an open descriptor on a functionfs endpoint file and an AIO context \u2014 available to any local unprivileged user in standard deployments, since ffs is mounted with `uid=`/`gid=`/`mode=` specifically to hand the endpoints to unprivileged daemons (adbd as `shell`, MTP as `media_rw`, embedded gadget daemons). No CAP_SYS_ADMIN is needed for the attack itself.\nUI:N - The attacking process performs every step itself \u2014 submit AIO, close ep0 to trigger the disconnect/giveback, then cancel/destroy the AIO context. No victim action is involved.\nS:U - The corruption is confined to kernel heap objects within the same security authority; there is no VM, IOMMU, or sandbox boundary crossed. This is standard local kernel privilege escalation.\nC:H - The use-after-free lets the attacker reclaim the freed `dwc3_request` slot with fully controlled data via the same fd (`ffs_alloc_buffer()` \u2192 `kmalloc` + `copy_from_iter_full`), after which `dwc3_gadget_ep_dequeue()`/`trace_dwc3_ep_dequeue()` dereference attacker-controlled pointers (`req-\u003edep-\u003ename`, `req-\u003etd_data-\u003estatus` on snps_udc), yielding an arbitrary kernel read primitive and leakage of adjacent heap contents.\nI:H - The stale request is passed to UDC dequeue routines that write into it and unlink it \u2014 `dwc3_gadget_giveback()` sets `req-\u003erequest.status` and `list_del()`s the entry (arbitrary write via controlled list pointers), while `snps_udc_core::udc_dequeue()` performs no membership check and calls `complete_req()`, invoking `req-\u003ereq.complete` \u2014 an indirect call through a function pointer read from freed, attacker-reclaimable memory, i.e. control-flow hijack.\nA:H - Even unweaponized, dereferencing the freed `usb_request` and the resulting double giveback/double free of `io_data` and its buffer reliably produce KASAN splats, slab corruption, and kernel panics. On a mass-disconnect the attacker triggers many of these at once with a single `io_destroy()`."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:31:53.288Z",
        "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-08-05T11:31:53.288Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"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\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html\"}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2025-11-03T21:55:22.274Z\"}}, {\"affected\": [{\"vendor\": \"Siemens\", \"product\": \"RUGGEDCOM RST2428P\", \"versions\": [{\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"*\", \"versionType\": \"custom\"}], \"defaultStatus\": \"unknown\"}, {\"vendor\": \"Siemens\", \"product\": \"SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family\", \"versions\": [{\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"*\", \"versionType\": \"custom\"}], \"defaultStatus\": \"unknown\"}, {\"vendor\": \"Siemens\", \"product\": \"SCALANCE XCM-/XRM-/XCH-/XRH-300 family\", \"versions\": [{\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"*\", \"versionType\": \"custom\"}], \"defaultStatus\": \"unknown\"}, {\"vendor\": \"Siemens\", \"product\": \"SIMATIC S7-1500 TM MFP - GNU/Linux subsystem\", \"versions\": [{\"status\": \"affected\", \"version\": \"0\", \"lessThan\": \"*\", \"versionType\": \"custom\"}], \"defaultStatus\": \"unknown\"}], \"x_adpType\": \"supplier\", \"references\": [{\"url\": \"https://cert-portal.siemens.com/productcert/html/ssa-265688.html\"}, {\"url\": \"https://cert-portal.siemens.com/productcert/html/ssa-355557.html\"}], \"providerMetadata\": {\"orgId\": \"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e\", \"shortName\": \"siemens-SADP\", \"dateUpdated\": \"2026-05-12T11:53:58.433Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"cvssV3_1\": {\"scope\": \"UNCHANGED\", \"version\": \"3.1\", \"baseScore\": 5.6, \"attackVector\": \"PHYSICAL\", \"baseSeverity\": \"MEDIUM\", \"vectorString\": \"CVSS:3.1/AV:P/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:H\", \"integrityImpact\": \"NONE\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"HIGH\", \"availabilityImpact\": \"HIGH\", \"privilegesRequired\": \"LOW\", \"confidentialityImpact\": \"HIGH\"}}, {\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-36894\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-06-03T15:53:00.949597Z\"}}}], \"affected\": [{\"cpes\": [\"cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*\"], \"vendor\": \"linux\", \"product\": \"linux_kernel\", \"versions\": [{\"status\": \"affected\", \"version\": \"2e4c7553cd6f\", \"lessThan\": \"73c05ad46bb4\", \"versionType\": \"custom\"}], \"defaultStatus\": \"unknown\"}, {\"cpes\": [\"cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*\"], \"vendor\": \"linux\", \"product\": \"linux_kernel\", \"versions\": [{\"status\": \"affected\", \"version\": \"2e4c7553cd6f\", \"lessThan\": \"d74618308232\", \"versionType\": \"custom\"}], \"defaultStatus\": \"unknown\"}, {\"cpes\": [\"cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*\"], \"vendor\": \"linux\", \"product\": \"linux_kernel\", \"versions\": [{\"status\": \"affected\", \"version\": \"2e4c7553cd6f\", \"lessThan\": \"24729b307eef\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f\", \"lessThan\": \"f71a53148ce3\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f\", \"lessThan\": \"9e72ef59cbe6\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f\", \"lessThan\": \"e500b1c4e29a\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f\", \"lessThan\": \"3613e5023f09\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f\", \"lessThan\": \"a0fdccb1c9e0\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"3.15\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"3.15\", \"versionType\": \"custom\"}, {\"status\": \"unaffected\", \"version\": \"4.19.317\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"4.20\"}, {\"status\": \"unaffected\", \"version\": \"5.4.279\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"5.5\"}, {\"status\": \"unaffected\", \"version\": \"5.10.221\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"5.11\"}, {\"status\": \"unaffected\", \"version\": \"5.15.162\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"5.16\"}, {\"status\": \"unaffected\", \"version\": \"6.1.95\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"6.2\"}, {\"status\": \"unaffected\", \"version\": \"6.6.31\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"6.7\"}, {\"status\": \"unaffected\", \"version\": \"6.8.10\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"6.9\"}, {\"status\": \"unaffected\", \"version\": \"6.9\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"*\"}], \"defaultStatus\": \"unknown\"}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-362\", \"description\": \"CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization (\u0027Race Condition\u0027)\"}]}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-06-03T16:04:02.070Z\"}}], \"cna\": {\"title\": \"usb: gadget: f_fs: Fix race between aio_cancel() and AIO request complete\", \"metrics\": [{\"cvssV3_1\": {\"version\": \"3.1\", \"baseScore\": 7.8, \"baseSeverity\": \"HIGH\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"AV:L - Both sides of the race are driven by local syscalls \\u2014 `io_submit`/`io_cancel`/`io_destroy` on an AIO context plus `close()` of ep0 to force the mass `-ESHUTDOWN` giveback \\u2014 with no USB host, cable, or physical access required. This is the gadget\u0027s userspace-facing API (f_fs), not a host-side driver parsing attacker-supplied descriptors, matching the AV:L precedent set for other gadget-side UAF races such as CVE-2024-38628.\\nAC:L - The attacker controls both sides: it submits the AIO requests, triggers the bulk giveback that frees them, and then invokes `ffs_aio_cancel()` on every stale pointer at once via `free_ioctx_users()`. The ordered (max_active=1) `io_completion_wq` and the sleeping `kthread_use_mm`/`copy_to_iter` in the worker leave a huge window, and the whole sequence is freely repeatable.\\nPR:L - The attacker needs an open descriptor on a functionfs endpoint file and an AIO context \\u2014 available to any local unprivileged user in standard deployments, since ffs is mounted with `uid=`/`gid=`/`mode=` specifically to hand the endpoints to unprivileged daemons (adbd as `shell`, MTP as `media_rw`, embedded gadget daemons). No CAP_SYS_ADMIN is needed for the attack itself.\\nUI:N - The attacking process performs every step itself \\u2014 submit AIO, close ep0 to trigger the disconnect/giveback, then cancel/destroy the AIO context. No victim action is involved.\\nS:U - The corruption is confined to kernel heap objects within the same security authority; there is no VM, IOMMU, or sandbox boundary crossed. This is standard local kernel privilege escalation.\\nC:H - The use-after-free lets the attacker reclaim the freed `dwc3_request` slot with fully controlled data via the same fd (`ffs_alloc_buffer()` \\u2192 `kmalloc` + `copy_from_iter_full`), after which `dwc3_gadget_ep_dequeue()`/`trace_dwc3_ep_dequeue()` dereference attacker-controlled pointers (`req-\u003edep-\u003ename`, `req-\u003etd_data-\u003estatus` on snps_udc), yielding an arbitrary kernel read primitive and leakage of adjacent heap contents.\\nI:H - The stale request is passed to UDC dequeue routines that write into it and unlink it \\u2014 `dwc3_gadget_giveback()` sets `req-\u003erequest.status` and `list_del()`s the entry (arbitrary write via controlled list pointers), while `snps_udc_core::udc_dequeue()` performs no membership check and calls `complete_req()`, invoking `req-\u003ereq.complete` \\u2014 an indirect call through a function pointer read from freed, attacker-reclaimable memory, i.e. control-flow hijack.\\nA:H - Even unweaponized, dereferencing the freed `usb_request` and the resulting double giveback/double free of `io_data` and its buffer reliably produce KASAN splats, slab corruption, and kernel panics. On a mass-disconnect the attacker triggers many of these at once with a single `io_destroy()`.\"}]}], \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"2e4c7553cd6f9c68bb741582dcb614edcbeca70f\", \"lessThan\": \"f71a53148ce34898fef099b75386a3a9f4449311\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f9c68bb741582dcb614edcbeca70f\", \"lessThan\": \"9e72ef59cbe61cd1243857a6418ca92104275867\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f9c68bb741582dcb614edcbeca70f\", \"lessThan\": \"e500b1c4e29ad0bd1c1332a1eaea2913627a92dd\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f9c68bb741582dcb614edcbeca70f\", \"lessThan\": \"3613e5023f09b3308545e9d1acda86017ebd418a\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f9c68bb741582dcb614edcbeca70f\", \"lessThan\": \"a0fdccb1c9e027e3195f947f61aa87d6d0d2ea14\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f9c68bb741582dcb614edcbeca70f\", \"lessThan\": \"73c05ad46bb4fbbdb346004651576d1c8dbcffbb\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f9c68bb741582dcb614edcbeca70f\", \"lessThan\": \"d7461830823242702f5d84084bcccb25159003f4\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"2e4c7553cd6f9c68bb741582dcb614edcbeca70f\", \"lessThan\": \"24729b307eefcd7c476065cd7351c1a018082c19\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/usb/gadget/function/f_fs.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"3.15\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"3.15\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"4.19.317\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"4.19.*\"}, {\"status\": \"unaffected\", \"version\": \"5.4.279\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.4.*\"}, {\"status\": \"unaffected\", \"version\": \"5.10.221\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.10.*\"}, {\"status\": \"unaffected\", \"version\": \"5.15.162\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"6.1.95\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.1.*\"}, {\"status\": \"unaffected\", \"version\": \"6.6.31\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.8.10\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.8.*\"}, {\"status\": \"unaffected\", \"version\": \"6.9\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/usb/gadget/function/f_fs.c\"], \"defaultStatus\": \"affected\"}], \"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\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"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  --\u003e dwc3_stop_active_transfers()\\n    --\u003e dwc3_gadget_giveback(-ESHUTDOWN)\\n      --\u003e ffs_epfile_async_io_complete()   ffs_aio_cancel()\\n        --\u003e usb_ep_free_request()            --\u003e 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-\u003ereq) 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-\u003estatus 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\u0027t be added to ffs_epfile_async_io_complete(), as\\nusb_ep_dequeue() (if successfully dequeuing a USB request) will call the\\nfunction driver\u0027s 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-\u003ereq\\nto NULL after freeing it within the ffs-\u003eeps_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-\u003estatus\\n  consistently\\\")\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"4.19.317\", \"versionStartIncluding\": \"3.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.4.279\", \"versionStartIncluding\": \"3.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.10.221\", \"versionStartIncluding\": \"3.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.15.162\", \"versionStartIncluding\": \"3.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.1.95\", \"versionStartIncluding\": \"3.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.6.31\", \"versionStartIncluding\": \"3.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.8.10\", \"versionStartIncluding\": \"3.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.9\", \"versionStartIncluding\": \"3.15\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-08-05T11:31:53.288Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-36894\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-05T11:31:53.288Z\", \"dateReserved\": \"2024-05-30T15:25:07.066Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-30T15:28:59.689Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…