{
   "containers": {
      "cna": {
         "providerMetadata": {
            "orgId": "f4215fc3-5b6b-47ff-a258-f7189bd81038"
         },
         "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->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."
            }
         ],
         "affected": [
            {
               "product": "Linux",
               "vendor": "Linux",
               "defaultStatus": "unaffected",
               "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               "programFiles": [
                  "drivers/usb/dwc2/hcd.c"
               ],
               "versions": [
                  {
                     "version": "33ad261aa62b",
                     "lessThan": "14c9ec34e811",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "33ad261aa62b",
                     "lessThan": "fed492aa6493",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "33ad261aa62b",
                     "lessThan": "64c47749fc75",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "33ad261aa62b",
                     "lessThan": "bdb3dd409630",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "33ad261aa62b",
                     "lessThan": "fcaafb574fc8",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "33ad261aa62b",
                     "lessThan": "6b21a2272885",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "33ad261aa62b",
                     "lessThan": "3e851a77a13c",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "33ad261aa62b",
                     "lessThan": "a7bee9598afb",
                     "status": "affected",
                     "versionType": "git"
                  },
                  {
                     "version": "33ad261aa62b",
                     "lessThan": "ef307bc6ef04",
                     "status": "affected",
                     "versionType": "git"
                  }
               ]
            },
            {
               "product": "Linux",
               "vendor": "Linux",
               "defaultStatus": "affected",
               "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               "programFiles": [
                  "drivers/usb/dwc2/hcd.c"
               ],
               "versions": [
                  {
                     "version": "4.2",
                     "status": "affected"
                  },
                  {
                     "version": "0",
                     "lessThan": "4.2",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "4.14.330",
                     "lessThanOrEqual": "4.14.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "4.19.299",
                     "lessThanOrEqual": "4.19.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "5.4.261",
                     "lessThanOrEqual": "5.4.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "5.10.201",
                     "lessThanOrEqual": "5.10.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "5.15.139",
                     "lessThanOrEqual": "5.15.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.1.63",
                     "lessThanOrEqual": "6.1.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.5.12",
                     "lessThanOrEqual": "6.5.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.6.2",
                     "lessThanOrEqual": "6.6.*",
                     "status": "unaffected",
                     "versionType": "custom"
                  },
                  {
                     "version": "6.7",
                     "lessThanOrEqual": "*",
                     "status": "unaffected",
                     "versionType": "original_commit_for_fix"
                  }
               ]
            }
         ],
         "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": "f4215fc3-5b6b-47ff-a258-f7189bd81038",
      "cveID": "CVE-2023-52855",
      "requesterUserId": "gregkh@kernel.org",
      "serial": "1",
      "state": "PUBLISHED"
   },
   "dataType": "CVE_RECORD",
   "dataVersion": "5.0"
}
