cve-2023-52855
Vulnerability from cvelistv5
Published
2024-05-21 15:31
Modified
2024-08-02 23:11
Severity
Summary
usb: dwc2: fix possible NULL pointer dereference caused by driver concurrency
Impacted products
VendorProduct
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2023-52855",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-29T17:15:57.421865Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-04T17:23:35.610Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T23:11:36.070Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/14c9ec34e8118fbffd7f5431814d767726323e72"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/fed492aa6493a91a77ebd51da6fb939c98d94a0d"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/64c47749fc7507ed732e155c958253968c1d275e"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/bdb3dd4096302d6b87441fdc528439f171b04be6"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/fcaafb574fc88a52dce817f039f7ff2f9da38001"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/6b21a22728852d020a6658d39cd7bb7e14b07790"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/3e851a77a13ce944d703721793f49ee82622986d"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/a7bee9598afb38004841a41dd8fe68c1faff4e90"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/ef307bc6ef04e8c1ea843231db58e3afaafa9fa6"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/dwc2/hcd.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "14c9ec34e811",
              "status": "affected",
              "version": "33ad261aa62b",
              "versionType": "git"
            },
            {
              "lessThan": "fed492aa6493",
              "status": "affected",
              "version": "33ad261aa62b",
              "versionType": "git"
            },
            {
              "lessThan": "64c47749fc75",
              "status": "affected",
              "version": "33ad261aa62b",
              "versionType": "git"
            },
            {
              "lessThan": "bdb3dd409630",
              "status": "affected",
              "version": "33ad261aa62b",
              "versionType": "git"
            },
            {
              "lessThan": "fcaafb574fc8",
              "status": "affected",
              "version": "33ad261aa62b",
              "versionType": "git"
            },
            {
              "lessThan": "6b21a2272885",
              "status": "affected",
              "version": "33ad261aa62b",
              "versionType": "git"
            },
            {
              "lessThan": "3e851a77a13c",
              "status": "affected",
              "version": "33ad261aa62b",
              "versionType": "git"
            },
            {
              "lessThan": "a7bee9598afb",
              "status": "affected",
              "version": "33ad261aa62b",
              "versionType": "git"
            },
            {
              "lessThan": "ef307bc6ef04",
              "status": "affected",
              "version": "33ad261aa62b",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/dwc2/hcd.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "4.2"
            },
            {
              "lessThan": "4.2",
              "status": "unaffected",
              "version": "0",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "4.14.*",
              "status": "unaffected",
              "version": "4.14.330",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.299",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.261",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.201",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.139",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.63",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.5.*",
              "status": "unaffected",
              "version": "6.5.12",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.2",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.7",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "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-\u003ehcpriv = NULL\" is executed without\nholding the lock \"hsotg-\u003elock\". In _dwc2_hcd_urb_dequeue():\n\n    spin_lock_irqsave(\u0026hsotg-\u003elock, flags);\n    ...\n\tif (!urb-\u003ehcpriv) {\n\t\tdev_dbg(hsotg-\u003edev, \"## urb-\u003ehcpriv is NULL ##\\n\");\n\t\tgoto out;\n\t}\n    rc = dwc2_hcd_urb_dequeue(hsotg, urb-\u003ehcpriv); // Use urb-\u003ehcpriv\n    ...\nout:\n    spin_unlock_irqrestore(\u0026hsotg-\u003elock, flags);\n\nWhen _dwc2_hcd_urb_enqueue() and _dwc2_hcd_urb_dequeue() are\nconcurrently executed, the NULL check of \"urb-\u003ehcpriv\" can be executed\nbefore \"urb-\u003ehcpriv = NULL\". After urb-\u003ehcpriv 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-\u003ehcpriv = NULL\" should be executed with\nholding the lock \"hsotg-\u003elock\". 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."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-05-29T05:18:31.211Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/14c9ec34e8118fbffd7f5431814d767726323e72"
        },
        {
          "url": "https://git.kernel.org/stable/c/fed492aa6493a91a77ebd51da6fb939c98d94a0d"
        },
        {
          "url": "https://git.kernel.org/stable/c/64c47749fc7507ed732e155c958253968c1d275e"
        },
        {
          "url": "https://git.kernel.org/stable/c/bdb3dd4096302d6b87441fdc528439f171b04be6"
        },
        {
          "url": "https://git.kernel.org/stable/c/fcaafb574fc88a52dce817f039f7ff2f9da38001"
        },
        {
          "url": "https://git.kernel.org/stable/c/6b21a22728852d020a6658d39cd7bb7e14b07790"
        },
        {
          "url": "https://git.kernel.org/stable/c/3e851a77a13ce944d703721793f49ee82622986d"
        },
        {
          "url": "https://git.kernel.org/stable/c/a7bee9598afb38004841a41dd8fe68c1faff4e90"
        },
        {
          "url": "https://git.kernel.org/stable/c/ef307bc6ef04e8c1ea843231db58e3afaafa9fa6"
        }
      ],
      "title": "usb: dwc2: fix possible NULL pointer dereference caused by driver concurrency",
      "x_generator": {
        "engine": "bippy-a5840b7849dd"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2023-52855",
    "datePublished": "2024-05-21T15:31:49.909Z",
    "dateReserved": "2024-05-21T15:19:24.257Z",
    "dateUpdated": "2024-08-02T23:11:36.070Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2023-52855\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-21T16:15:22.453\",\"lastModified\":\"2024-05-21T16:53:56.550\",\"vulnStatus\":\"Awaiting Analysis\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"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-\u003ehcpriv = NULL\\\" is executed without\\nholding the lock \\\"hsotg-\u003elock\\\". In _dwc2_hcd_urb_dequeue():\\n\\n    spin_lock_irqsave(\u0026hsotg-\u003elock, flags);\\n    ...\\n\\tif (!urb-\u003ehcpriv) {\\n\\t\\tdev_dbg(hsotg-\u003edev, \\\"## urb-\u003ehcpriv is NULL ##\\\\n\\\");\\n\\t\\tgoto out;\\n\\t}\\n    rc = dwc2_hcd_urb_dequeue(hsotg, urb-\u003ehcpriv); // Use urb-\u003ehcpriv\\n    ...\\nout:\\n    spin_unlock_irqrestore(\u0026hsotg-\u003elock, flags);\\n\\nWhen _dwc2_hcd_urb_enqueue() and _dwc2_hcd_urb_dequeue() are\\nconcurrently executed, the NULL check of \\\"urb-\u003ehcpriv\\\" can be executed\\nbefore \\\"urb-\u003ehcpriv = NULL\\\". After urb-\u003ehcpriv 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-\u003ehcpriv = NULL\\\" should be executed with\\nholding the lock \\\"hsotg-\u003elock\\\". 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.\"},{\"lang\":\"es\",\"value\":\"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-\u0026gt;hcpriv = NULL\\\" se ejecuta sin mantener presionado el bloqueo \\\"hsotg-\u0026gt;lock\\\" . En _dwc2_hcd_urb_dequeue(): spin_lock_irqsave(\u0026amp;hsotg-\u0026gt;lock, flags); ... if (!urb-\u0026gt;hcpriv) { dev_dbg(hsotg-\u0026gt;dev, \\\"## urb-\u0026gt;hcpriv es NULL ##\\\\n\\\"); salir; } rc = dwc2_hcd_urb_dequeue(hsotg, urb-\u0026gt;hcpriv); // Usa urb-\u0026gt;hcpriv ... out: spin_unlock_irqrestore(\u0026amp;hsotg-\u0026gt;lock, flags); Cuando _dwc2_hcd_urb_enqueue() y _dwc2_hcd_urb_dequeue() se ejecutan simult\u00e1neamente, la verificaci\u00f3n NULL de \\\"urb-\u0026gt;hcpriv\\\" se puede ejecutar antes de \\\"urb-\u0026gt;hcpriv = NULL\\\". Despu\u00e9s de que urb-\u0026gt;hcpriv sea NULL, se puede usar en la llamada de funci\u00f3n 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\u00e1lisis est\u00e1tico desarrollada por m\u00ed. Esta herramienta analiza las API de bloqueo para extraer pares de funciones que se pueden ejecutar simult\u00e1neamente y luego analiza las instrucciones en las funciones emparejadas para identificar posibles errores de concurrencia, incluidas ejecuci\u00f3ns de datos y violaciones de atomicidad. El posible error anterior se informa cuando mi herramienta analiza el c\u00f3digo fuente de Linux 6.5. Para corregir este posible error, se debe ejecutar \\\"urb-\u0026gt;hcpriv = NULL\\\" manteniendo presionado el bloqueo \\\"hsotg-\u0026gt;lock\\\". Despu\u00e9s de usar este parche, mi herramienta nunca informa el posible error, con la configuraci\u00f3n del kernel allyesconfig para x86_64. Como no tengo hardware asociado, no puedo probar el parche en tiempo de ejecuci\u00f3n y simplemente verificarlo de acuerdo con la l\u00f3gica del c\u00f3digo.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/14c9ec34e8118fbffd7f5431814d767726323e72\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/3e851a77a13ce944d703721793f49ee82622986d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/64c47749fc7507ed732e155c958253968c1d275e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/6b21a22728852d020a6658d39cd7bb7e14b07790\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a7bee9598afb38004841a41dd8fe68c1faff4e90\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/bdb3dd4096302d6b87441fdc528439f171b04be6\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/ef307bc6ef04e8c1ea843231db58e3afaafa9fa6\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/fcaafb574fc88a52dce817f039f7ff2f9da38001\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/fed492aa6493a91a77ebd51da6fb939c98d94a0d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...