{"schema":"/api/v1/schema/cve.json","api_version":"1","id":"CVE-2022-49398","published":"2025-02-26T07:01:16.377000Z","last_modified":"2026-06-17T05:17:56.197000Z","status":"Analyzed","cvss":{"version":"3.1","score":5.5,"severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","source":"nvd@nist.gov","primary":true},"auth":true,"cwes":[],"cpes":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"4.19.57","version_end_excluding":"4.20"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"5.0","version_end_excluding":"5.15.47"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"5.16","version_end_excluding":"5.17.15"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"5.18","version_end_excluding":"5.18.4"}],"cpes_truncated":false,"vendors":["linux"],"products":["linux/linux_kernel"],"epss":{"score":0.00284,"percentile":0.1352,"date":"2026-11-29","model_version":"v2026.06.15"},"cat":"os","platform":"linux","eol":false,"packages":[],"severity":"medium","priority_score":33,"links":{"html_es":"/es/cve/CVE-2022-49398/","html_en":"/en/cve/CVE-2022-49398/","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2022-49398","cve_org":"https://www.cve.org/CVERecord?id=CVE-2022-49398"},"untrusted":{"vendor_name":"Linux","product_name":"Linux Kernel","desc_en":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: dwc3: gadget: Replace list_for_each_entry_safe() if using giveback\n\nThe list_for_each_entry_safe() macro saves the current item (n) and\nthe item after (n+1), so that n can be safely removed without\ncorrupting the list.  However, when traversing the list and removing\nitems using gadget giveback, the DWC3 lock is briefly released,\nallowing other routines to execute.  There is a situation where, while\nitems are being removed from the cancelled_list using\ndwc3_gadget_ep_cleanup_cancelled_requests(), the pullup disable\nroutine is running in parallel (due to UDC unbind).  As the cleanup\nroutine removes n, and the pullup disable removes n+1, once the\ncleanup retakes the DWC3 lock, it references a request who was already\nremoved/handled.  With list debug enabled, this leads to a panic.\nEnsure all instances of the macro are replaced where gadget giveback\nis used.\n\nExample call stack:\n\nThread#1:\n__dwc3_gadget_ep_set_halt() - CLEAR HALT\n  -> dwc3_gadget_ep_cleanup_cancelled_requests()\n    ->list_for_each_entry_safe()\n    ->dwc3_gadget_giveback(n)\n      ->dwc3_gadget_del_and_unmap_request()- n deleted[cancelled_list]\n      ->spin_unlock\n      ->Thread#2 executes\n      ...\n    ->dwc3_gadget_giveback(n+1)\n      ->Already removed!\n\nThread#2:\ndwc3_gadget_pullup()\n  ->waiting for dwc3 spin_lock\n  ...\n  ->Thread#1 released lock\n  ->dwc3_stop_active_transfers()\n    ->dwc3_remove_requests()\n      ->fetches n+1 item from cancelled_list (n removed by Thread#1)\n      ->dwc3_gadget_giveback()\n        ->dwc3_gadget_del_and_unmap_request()- n+1 deleted[cancelled_list]\n        ->spin_unlock","affected":[{"untrusted_vendor":"Linux","untrusted_product":"Linux","versions":[]}],"references":[{"url":"https://git.kernel.org/stable/c/1c6e5dc3b639c96e6839a8d1b8e951923fdfd34a","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/2424307cdf421ac72075a1384eae4e4199ab6457","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/26a7e6832afe9d9a991cfd9015177f083cf959cc","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/bf594d1d0c1d7b895954018043536ffd327844f9","tags":["Patch"]}]}}