CVE-2022-49371 (GCVE-0-2022-49371)
Vulnerability from cvelistv5
Published
2025-02-26 02:11
Modified
2025-10-01 19:46
Summary
In the Linux kernel, the following vulnerability has been resolved: driver core: fix deadlock in __device_attach In __device_attach function, The lock holding logic is as follows: ... __device_attach device_lock(dev) // get lock dev async_schedule_dev(__device_attach_async_helper, dev); // func async_schedule_node async_schedule_node_domain(func) entry = kzalloc(sizeof(struct async_entry), GFP_ATOMIC); /* when fail or work limit, sync to execute func, but __device_attach_async_helper will get lock dev as well, which will lead to A-A deadlock. */ if (!entry || atomic_read(&entry_count) > MAX_WORK) { func; else queue_work_node(node, system_unbound_wq, &entry->work) device_unlock(dev) As shown above, when it is allowed to do async probes, because of out of memory or work limit, async work is not allowed, to do sync execute instead. it will lead to A-A deadlock because of __device_attach_async_helper getting lock dev. To fix the deadlock, move the async_schedule_dev outside device_lock, as we can see, in async_schedule_node_domain, the parameter of queue_work_node is system_unbound_wq, so it can accept concurrent operations. which will also not change the code logic, and will not lead to deadlock.
Impacted products
Vendor Product Version
Linux Linux Version: 765230b5f084863183aa8adb3405ab3f32c0b16e
Version: 765230b5f084863183aa8adb3405ab3f32c0b16e
Version: 765230b5f084863183aa8adb3405ab3f32c0b16e
Version: 765230b5f084863183aa8adb3405ab3f32c0b16e
Version: 765230b5f084863183aa8adb3405ab3f32c0b16e
Version: 765230b5f084863183aa8adb3405ab3f32c0b16e
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "cvssV3_1": {
              "attackComplexity": "LOW",
              "attackVector": "LOCAL",
              "availabilityImpact": "HIGH",
              "baseScore": 5.5,
              "baseSeverity": "MEDIUM",
              "confidentialityImpact": "NONE",
              "integrityImpact": "NONE",
              "privilegesRequired": "LOW",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
              "version": "3.1"
            }
          },
          {
            "other": {
              "content": {
                "id": "CVE-2022-49371",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2025-10-01T19:42:17.592122Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "problemTypes": [
          {
            "descriptions": [
              {
                "cweId": "CWE-667",
                "description": "CWE-667 Improper Locking",
                "lang": "en",
                "type": "CWE"
              }
            ]
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2025-10-01T19:46:52.917Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/base/dd.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "593b595332bd2d65e1a5c1ae7897996c157f5468",
              "status": "affected",
              "version": "765230b5f084863183aa8adb3405ab3f32c0b16e",
              "versionType": "git"
            },
            {
              "lessThan": "36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada",
              "status": "affected",
              "version": "765230b5f084863183aa8adb3405ab3f32c0b16e",
              "versionType": "git"
            },
            {
              "lessThan": "df6de52b80aa3b46f5ac804412355ffe2e1df93e",
              "status": "affected",
              "version": "765230b5f084863183aa8adb3405ab3f32c0b16e",
              "versionType": "git"
            },
            {
              "lessThan": "d53a227bfcd5160ce1b61d9954901968a20651e7",
              "status": "affected",
              "version": "765230b5f084863183aa8adb3405ab3f32c0b16e",
              "versionType": "git"
            },
            {
              "lessThan": "34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e",
              "status": "affected",
              "version": "765230b5f084863183aa8adb3405ab3f32c0b16e",
              "versionType": "git"
            },
            {
              "lessThan": "b232b02bf3c205b13a26dcec08e53baddd8e59ed",
              "status": "affected",
              "version": "765230b5f084863183aa8adb3405ab3f32c0b16e",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/base/dd.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": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.198",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.122",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.47",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.17.*",
              "status": "unaffected",
              "version": "5.17.15",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.18.*",
              "status": "unaffected",
              "version": "5.18.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.19",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.198",
                  "versionStartIncluding": "4.2",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.122",
                  "versionStartIncluding": "4.2",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.47",
                  "versionStartIncluding": "4.2",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.17.15",
                  "versionStartIncluding": "4.2",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.18.4",
                  "versionStartIncluding": "4.2",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.19",
                  "versionStartIncluding": "4.2",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndriver core: fix deadlock in __device_attach\n\nIn __device_attach function, The lock holding logic is as follows:\n...\n__device_attach\ndevice_lock(dev)      // get lock dev\n  async_schedule_dev(__device_attach_async_helper, dev); // func\n    async_schedule_node\n      async_schedule_node_domain(func)\n        entry = kzalloc(sizeof(struct async_entry), GFP_ATOMIC);\n\t/* when fail or work limit, sync to execute func, but\n\t   __device_attach_async_helper will get lock dev as\n\t   well, which will lead to A-A deadlock.  */\n\tif (!entry || atomic_read(\u0026entry_count) \u003e MAX_WORK) {\n\t  func;\n\telse\n\t  queue_work_node(node, system_unbound_wq, \u0026entry-\u003ework)\n  device_unlock(dev)\n\nAs shown above, when it is allowed to do async probes, because of\nout of memory or work limit, async work is not allowed, to do\nsync execute instead. it will lead to A-A deadlock because of\n__device_attach_async_helper getting lock dev.\n\nTo fix the deadlock, move the async_schedule_dev outside device_lock,\nas we can see, in async_schedule_node_domain, the parameter of\nqueue_work_node is system_unbound_wq, so it can accept concurrent\noperations. which will also not change the code logic, and will\nnot lead to deadlock."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-04T08:36:16.018Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/593b595332bd2d65e1a5c1ae7897996c157f5468"
        },
        {
          "url": "https://git.kernel.org/stable/c/36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada"
        },
        {
          "url": "https://git.kernel.org/stable/c/df6de52b80aa3b46f5ac804412355ffe2e1df93e"
        },
        {
          "url": "https://git.kernel.org/stable/c/d53a227bfcd5160ce1b61d9954901968a20651e7"
        },
        {
          "url": "https://git.kernel.org/stable/c/34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e"
        },
        {
          "url": "https://git.kernel.org/stable/c/b232b02bf3c205b13a26dcec08e53baddd8e59ed"
        }
      ],
      "title": "driver core: fix deadlock in __device_attach",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-49371",
    "datePublished": "2025-02-26T02:11:13.652Z",
    "dateReserved": "2025-02-26T02:08:31.555Z",
    "dateUpdated": "2025-10-01T19:46:52.917Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"cvssV3_1\": {\"scope\": \"UNCHANGED\", \"version\": \"3.1\", \"baseScore\": 5.5, \"attackVector\": \"LOCAL\", \"baseSeverity\": \"MEDIUM\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\", \"integrityImpact\": \"NONE\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"LOW\", \"availabilityImpact\": \"HIGH\", \"privilegesRequired\": \"LOW\", \"confidentialityImpact\": \"NONE\"}}, {\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2022-49371\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2025-10-01T19:42:17.592122Z\"}}}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-667\", \"description\": \"CWE-667 Improper Locking\"}]}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2025-10-01T16:45:47.657Z\"}}], \"cna\": {\"title\": \"driver core: fix deadlock in __device_attach\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"765230b5f084863183aa8adb3405ab3f32c0b16e\", \"lessThan\": \"593b595332bd2d65e1a5c1ae7897996c157f5468\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"765230b5f084863183aa8adb3405ab3f32c0b16e\", \"lessThan\": \"36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"765230b5f084863183aa8adb3405ab3f32c0b16e\", \"lessThan\": \"df6de52b80aa3b46f5ac804412355ffe2e1df93e\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"765230b5f084863183aa8adb3405ab3f32c0b16e\", \"lessThan\": \"d53a227bfcd5160ce1b61d9954901968a20651e7\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"765230b5f084863183aa8adb3405ab3f32c0b16e\", \"lessThan\": \"34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"765230b5f084863183aa8adb3405ab3f32c0b16e\", \"lessThan\": \"b232b02bf3c205b13a26dcec08e53baddd8e59ed\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/base/dd.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"4.2\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"4.2\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.4.198\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.4.*\"}, {\"status\": \"unaffected\", \"version\": \"5.10.122\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.10.*\"}, {\"status\": \"unaffected\", \"version\": \"5.15.47\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"5.17.15\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.17.*\"}, {\"status\": \"unaffected\", \"version\": \"5.18.4\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.18.*\"}, {\"status\": \"unaffected\", \"version\": \"5.19\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/base/dd.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/593b595332bd2d65e1a5c1ae7897996c157f5468\"}, {\"url\": \"https://git.kernel.org/stable/c/36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada\"}, {\"url\": \"https://git.kernel.org/stable/c/df6de52b80aa3b46f5ac804412355ffe2e1df93e\"}, {\"url\": \"https://git.kernel.org/stable/c/d53a227bfcd5160ce1b61d9954901968a20651e7\"}, {\"url\": \"https://git.kernel.org/stable/c/34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e\"}, {\"url\": \"https://git.kernel.org/stable/c/b232b02bf3c205b13a26dcec08e53baddd8e59ed\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\ndriver core: fix deadlock in __device_attach\\n\\nIn __device_attach function, The lock holding logic is as follows:\\n...\\n__device_attach\\ndevice_lock(dev)      // get lock dev\\n  async_schedule_dev(__device_attach_async_helper, dev); // func\\n    async_schedule_node\\n      async_schedule_node_domain(func)\\n        entry = kzalloc(sizeof(struct async_entry), GFP_ATOMIC);\\n\\t/* when fail or work limit, sync to execute func, but\\n\\t   __device_attach_async_helper will get lock dev as\\n\\t   well, which will lead to A-A deadlock.  */\\n\\tif (!entry || atomic_read(\u0026entry_count) \u003e MAX_WORK) {\\n\\t  func;\\n\\telse\\n\\t  queue_work_node(node, system_unbound_wq, \u0026entry-\u003ework)\\n  device_unlock(dev)\\n\\nAs shown above, when it is allowed to do async probes, because of\\nout of memory or work limit, async work is not allowed, to do\\nsync execute instead. it will lead to A-A deadlock because of\\n__device_attach_async_helper getting lock dev.\\n\\nTo fix the deadlock, move the async_schedule_dev outside device_lock,\\nas we can see, in async_schedule_node_domain, the parameter of\\nqueue_work_node is system_unbound_wq, so it can accept concurrent\\noperations. which will also not change the code logic, and will\\nnot lead to deadlock.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.4.198\", \"versionStartIncluding\": \"4.2\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.10.122\", \"versionStartIncluding\": \"4.2\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.15.47\", \"versionStartIncluding\": \"4.2\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.17.15\", \"versionStartIncluding\": \"4.2\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.18.4\", \"versionStartIncluding\": \"4.2\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.19\", \"versionStartIncluding\": \"4.2\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2025-05-04T08:36:16.018Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2022-49371\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-10-01T19:46:52.917Z\", \"dateReserved\": \"2025-02-26T02:08:31.555Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2025-02-26T02:11:13.652Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


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…