{"id":"CVE-2023-52855","aliases":["CVE-2023-52855"],"related":[],"kind":"vulnerability","state":"published","title":"usb: dwc2: fix possible NULL pointer dereference caused by driver concurrency","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: dwc2: fix possible NULL pointer dereference caused by driver concurrency\n\nIn _dwc2_hcd_urb_enqueue(), \"urb->hcpriv = NULL\" is executed without\nholding the lock \"hsotg->lock\". In _dwc2_hcd_urb_dequeue():\n\n    spin_lock_irqsave(&hsotg->lock, flags);\n    ...\n\tif (!urb->hcpriv) {\n\t\tdev_dbg(hsotg->dev, \"## urb->hcpriv is NULL ##\\n\");\n\t\tgoto out;\n\t}\n    rc = dwc2_hcd_urb_dequeue(hsotg, urb->hcpriv); // Use urb->hcpriv\n    ...\nout:\n    spin_unlock_irqrestore(&hsotg->lock, flags);\n\nWhen _dwc2_hcd_urb_enqueue() and _dwc2_hcd_urb_dequeue() are\nconcurrently executed, the NULL check of \"urb->hcpriv\" can be executed\nbefore \"urb->hcpriv = NULL\". After urb->hcpriv is NULL, it can be used\nin the function call to dwc2_hcd_urb_dequeue(), which can cause a NULL\npointer dereference.\n\nThis possible bug is found by an experimental static analysis tool\ndeveloped by myself. This tool analyzes the locking APIs to extract\nfunction pairs that can be concurrently executed, and then analyzes the\ninstructions in the paired functions to identify possible concurrency\nbugs including data races and atomicity violations. The above possible\nbug is reported, when my tool analyzes the source code of Linux 6.5.\n\nTo fix this possible bug, \"urb->hcpriv = NULL\" should be executed with\nholding the lock \"hsotg->lock\". After using this patch, my tool never\nreports the possible bug, with the kernelconfiguration allyesconfig for\nx86_64. Because I have no associated hardware, I cannot test the patch\nin runtime testing, and just verify it according to the code logic.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: dwc2: fix possible NULL pointer dereference caused by driver concurrency\n\nIn _dwc2_hcd_urb_enqueue(), \"urb->hcpriv = NULL\" is executed without\nholding the lock \"hsotg->lock\". In _dwc2_hcd_urb_dequeue():\n\n    spin_lock_irqsave(&hsotg->lock, flags);\n    ...\n\tif (!urb->hcpriv) {\n\t\tdev_dbg(hsotg->dev, \"## urb->hcpriv is NULL ##\\n\");\n\t\tgoto out;\n\t}\n    rc = dwc2_hcd_urb_dequeue(hsotg, urb->hcpriv); // Use urb->hcpriv\n    ...\nout:\n    spin_unlock_irqrestore(&hsotg->lock, flags);\n\nWhen _dwc2_hcd_urb_enqueue() and _dwc2_hcd_urb_dequeue() are\nconcurrently executed, the NULL check of \"urb->hcpriv\" can be executed\nbefore \"urb->hcpriv = NULL\". After urb->hcpriv is NULL, it can be used\nin the function call to dwc2_hcd_urb_dequeue(), which can cause a NULL\npointer dereference.\n\nThis possible bug is found by an experimental static analysis tool\ndeveloped by myself. This tool analyzes the locking APIs to extract\nfunction pairs that can be concurrently executed, and then analyzes the\ninstructions in the paired functions to identify possible concurrency\nbugs including data races and atomicity violations. The above possible\nbug is reported, when my tool analyzes the source code of Linux 6.5.\n\nTo fix this possible bug, \"urb->hcpriv = NULL\" should be executed with\nholding the lock \"hsotg->lock\". After using this patch, my tool never\nreports the possible bug, with the kernelconfiguration allyesconfig for\nx86_64. Because I have no associated hardware, I cannot test the patch\nin runtime testing, and just verify it according to the code logic.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: usb: dwc2: corrige posible desreferencia de puntero NULL causada por concurrencia de controladores. En _dwc2_hcd_urb_enqueue(), \"urb-&gt;hcpriv = NULL\" se ejecuta sin mantener presionado el bloqueo \"hsotg-&gt;lock\" . En _dwc2_hcd_urb_dequeue(): spin_lock_irqsave(&amp;hsotg-&gt;lock, flags); ... if (!urb-&gt;hcpriv) { dev_dbg(hsotg-&gt;dev, \"## urb-&gt;hcpriv es NULL ##\\n\"); salir; } rc = dwc2_hcd_urb_dequeue(hsotg, urb-&gt;hcpriv); // Usa urb-&gt;hcpriv ... out: spin_unlock_irqrestore(&amp;hsotg-&gt;lock, flags); Cuando _dwc2_hcd_urb_enqueue() y _dwc2_hcd_urb_dequeue() se ejecutan simultáneamente, la verificación NULL de \"urb-&gt;hcpriv\" se puede ejecutar antes de \"urb-&gt;hcpriv = NULL\". Después de que urb-&gt;hcpriv sea NULL, se puede usar en la llamada de función a dwc2_hcd_urb_dequeue(), lo que puede provocar una desreferencia del puntero NULL. Este posible error se encuentra mediante una herramienta experimental de análisis estático desarrollada por mí. Esta herramienta analiza las API de bloqueo para extraer pares de funciones que se pueden ejecutar simultáneamente y luego analiza las instrucciones en las funciones emparejadas para identificar posibles errores de concurrencia, incluidas ejecucións de datos y violaciones de atomicidad. El posible error anterior se informa cuando mi herramienta analiza el código fuente de Linux 6.5. Para corregir este posible error, se debe ejecutar \"urb-&gt;hcpriv = NULL\" manteniendo presionado el bloqueo \"hsotg-&gt;lock\". Después de usar este parche, mi herramienta nunca informa el posible error, con la configuración del kernel allyesconfig para x86_64. Como no tengo hardware asociado, no puedo probar el parche en tiempo de ejecución y simplemente verificarlo de acuerdo con la lógica del código.","source":"nvd"}],"published":"2024-05-21T15:31:49.909Z","modified":"2026-06-17T06:43:44.617Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"33ad261aa62be02f0cedeb4d5735cc726de84a3f","fixed":"14c9ec34e8118fbffd7f5431814d767726323e72","status":"affected"},{"type":"git","introduced":"33ad261aa62be02f0cedeb4d5735cc726de84a3f","fixed":"fed492aa6493a91a77ebd51da6fb939c98d94a0d","status":"affected"},{"type":"git","introduced":"33ad261aa62be02f0cedeb4d5735cc726de84a3f","fixed":"64c47749fc7507ed732e155c958253968c1d275e","status":"affected"},{"type":"git","introduced":"33ad261aa62be02f0cedeb4d5735cc726de84a3f","fixed":"bdb3dd4096302d6b87441fdc528439f171b04be6","status":"affected"},{"type":"git","introduced":"33ad261aa62be02f0cedeb4d5735cc726de84a3f","fixed":"fcaafb574fc88a52dce817f039f7ff2f9da38001","status":"affected"},{"type":"git","introduced":"33ad261aa62be02f0cedeb4d5735cc726de84a3f","fixed":"6b21a22728852d020a6658d39cd7bb7e14b07790","status":"affected"},{"type":"git","introduced":"33ad261aa62be02f0cedeb4d5735cc726de84a3f","fixed":"3e851a77a13ce944d703721793f49ee82622986d","status":"affected"},{"type":"git","introduced":"33ad261aa62be02f0cedeb4d5735cc726de84a3f","fixed":"a7bee9598afb38004841a41dd8fe68c1faff4e90","status":"affected"},{"type":"git","introduced":"33ad261aa62be02f0cedeb4d5735cc726de84a3f","fixed":"ef307bc6ef04e8c1ea843231db58e3afaafa9fa6","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.2","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.2","status":"unaffected"},{"type":"semver","introduced":"4.14.330","lastAffected":"4.14.*","status":"unaffected"},{"type":"semver","introduced":"4.19.299","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.261","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.201","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.139","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.63","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.5.12","lastAffected":"6.5.*","status":"unaffected"},{"type":"semver","introduced":"6.6.2","lastAffected":"6.6.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.7","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"4.2","fixed":"4.14.330"},{"status":"affected","introduced":"4.15","fixed":"4.19.299"},{"status":"affected","introduced":"4.20","fixed":"5.4.261"},{"status":"affected","introduced":"5.5","fixed":"5.10.201"},{"status":"affected","introduced":"5.11","fixed":"5.15.139"},{"status":"affected","introduced":"5.16","fixed":"6.1.63"},{"status":"affected","introduced":"6.2","fixed":"6.5.12"},{"status":"affected","introduced":"6.6","fixed":"6.6.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/14c9ec34e8118fbffd7f5431814d767726323e72","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fed492aa6493a91a77ebd51da6fb939c98d94a0d","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/64c47749fc7507ed732e155c958253968c1d275e","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bdb3dd4096302d6b87441fdc528439f171b04be6","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fcaafb574fc88a52dce817f039f7ff2f9da38001","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6b21a22728852d020a6658d39cd7bb7e14b07790","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3e851a77a13ce944d703721793f49ee82622986d","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a7bee9598afb38004841a41dd8fe68c1faff4e90","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ef307bc6ef04e8c1ea843231db58e3afaafa9fa6","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-05-29T17:15:57.421Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-52855","url":"https://www.cve.org/CVERecord?id=CVE-2023-52855","licence":"CVE Terms of Use","modified":"2026-05-11T19:34:19.661Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-52855","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-52855","licence":"Public domain","modified":"2026-06-17T06:43:44.617Z"}],"updatedAt":"2026-11-25T22:58:34.056Z","epss":{"score":0.00245,"percentile":0.16847,"date":"2026-12-02T12:00:21.000Z"}}