CVE-2021-47541 (GCVE-0-2021-47541)

Vulnerability from cvelistv5 – Published: 2024-05-24 15:09 – Updated: 2025-05-04 07:13
VLAI?
Title
net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()
Summary
In the Linux kernel, the following vulnerability has been resolved: net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources() In mlx4_en_try_alloc_resources(), mlx4_en_copy_priv() is called and tmp->tx_cq will be freed on the error path of mlx4_en_copy_priv(). After that mlx4_en_alloc_resources() is called and there is a dereference of &tmp->tx_cq[t][i] in mlx4_en_alloc_resources(), which could lead to a use after free problem on failure of mlx4_en_copy_priv(). Fix this bug by adding a check of mlx4_en_copy_priv() This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_MLX4_EN=m show no new warnings, and our static analyzer no longer warns about this code.
Severity ?
No CVSS data available.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: ec25bc04ed8e12947738468cbe2191f1529f9e39 , < be12572c5ddc8ad7453bada4eec8fa46967dc757 (git)
Affected: ec25bc04ed8e12947738468cbe2191f1529f9e39 , < 676dc7d9b15bf8733233a2db1ec3f9091ab34275 (git)
Affected: ec25bc04ed8e12947738468cbe2191f1529f9e39 , < e461a9816a1ac5b4aeb61621b817225b61e46a68 (git)
Affected: ec25bc04ed8e12947738468cbe2191f1529f9e39 , < f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b (git)
Affected: ec25bc04ed8e12947738468cbe2191f1529f9e39 , < 75917372eef0dbfb290ae45474314d35f97aea18 (git)
Affected: ec25bc04ed8e12947738468cbe2191f1529f9e39 , < addad7643142f500080417dd7272f49b7a185570 (git)
Create a notification for this product.
    Linux Linux Affected: 4.7
Unaffected: 0 , < 4.7 (semver)
Unaffected: 4.14.257 , ≤ 4.14.* (semver)
Unaffected: 4.19.220 , ≤ 4.19.* (semver)
Unaffected: 5.4.164 , ≤ 5.4.* (semver)
Unaffected: 5.10.84 , ≤ 5.10.* (semver)
Unaffected: 5.15.7 , ≤ 5.15.* (semver)
Unaffected: 5.16 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2021-47541",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-06-10T18:52:32.131525Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-10T18:52:41.480Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-04T05:39:59.831Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/be12572c5ddc8ad7453bada4eec8fa46967dc757"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/676dc7d9b15bf8733233a2db1ec3f9091ab34275"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e461a9816a1ac5b4aeb61621b817225b61e46a68"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/75917372eef0dbfb290ae45474314d35f97aea18"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/addad7643142f500080417dd7272f49b7a185570"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/ethernet/mellanox/mlx4/en_netdev.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "be12572c5ddc8ad7453bada4eec8fa46967dc757",
              "status": "affected",
              "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
              "versionType": "git"
            },
            {
              "lessThan": "676dc7d9b15bf8733233a2db1ec3f9091ab34275",
              "status": "affected",
              "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
              "versionType": "git"
            },
            {
              "lessThan": "e461a9816a1ac5b4aeb61621b817225b61e46a68",
              "status": "affected",
              "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
              "versionType": "git"
            },
            {
              "lessThan": "f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b",
              "status": "affected",
              "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
              "versionType": "git"
            },
            {
              "lessThan": "75917372eef0dbfb290ae45474314d35f97aea18",
              "status": "affected",
              "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
              "versionType": "git"
            },
            {
              "lessThan": "addad7643142f500080417dd7272f49b7a185570",
              "status": "affected",
              "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/ethernet/mellanox/mlx4/en_netdev.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "4.7"
            },
            {
              "lessThan": "4.7",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.14.*",
              "status": "unaffected",
              "version": "4.14.257",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.220",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.164",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.84",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.7",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.16",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "4.14.257",
                  "versionStartIncluding": "4.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "4.19.220",
                  "versionStartIncluding": "4.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.164",
                  "versionStartIncluding": "4.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.84",
                  "versionStartIncluding": "4.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.7",
                  "versionStartIncluding": "4.7",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.16",
                  "versionStartIncluding": "4.7",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()\n\nIn mlx4_en_try_alloc_resources(), mlx4_en_copy_priv() is called and\ntmp-\u003etx_cq will be freed on the error path of mlx4_en_copy_priv().\nAfter that mlx4_en_alloc_resources() is called and there is a dereference\nof \u0026tmp-\u003etx_cq[t][i] in mlx4_en_alloc_resources(), which could lead to\na use after free problem on failure of mlx4_en_copy_priv().\n\nFix this bug by adding a check of mlx4_en_copy_priv()\n\nThis bug was found by a static analyzer. The analysis employs\ndifferential checking to identify inconsistent security operations\n(e.g., checks or kfrees) between two code paths and confirms that the\ninconsistent operations are not recovered in the current function or\nthe callers, so they constitute bugs.\n\nNote that, as a bug found by static analysis, it can be a false\npositive or hard to trigger. Multiple researchers have cross-reviewed\nthe bug.\n\nBuilds with CONFIG_MLX4_EN=m show no new warnings,\nand our static analyzer no longer warns about this code."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-04T07:13:09.872Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/be12572c5ddc8ad7453bada4eec8fa46967dc757"
        },
        {
          "url": "https://git.kernel.org/stable/c/676dc7d9b15bf8733233a2db1ec3f9091ab34275"
        },
        {
          "url": "https://git.kernel.org/stable/c/e461a9816a1ac5b4aeb61621b817225b61e46a68"
        },
        {
          "url": "https://git.kernel.org/stable/c/f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b"
        },
        {
          "url": "https://git.kernel.org/stable/c/75917372eef0dbfb290ae45474314d35f97aea18"
        },
        {
          "url": "https://git.kernel.org/stable/c/addad7643142f500080417dd7272f49b7a185570"
        }
      ],
      "title": "net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2021-47541",
    "datePublished": "2024-05-24T15:09:47.916Z",
    "dateReserved": "2024-05-24T15:02:54.829Z",
    "dateUpdated": "2025-05-04T07:13:09.872Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/be12572c5ddc8ad7453bada4eec8fa46967dc757\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/676dc7d9b15bf8733233a2db1ec3f9091ab34275\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/e461a9816a1ac5b4aeb61621b817225b61e46a68\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/75917372eef0dbfb290ae45474314d35f97aea18\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/addad7643142f500080417dd7272f49b7a185570\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-04T05:39:59.831Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2021-47541\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-06-10T18:52:32.131525Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-06-10T18:52:37.977Z\"}}], \"cna\": {\"title\": \"net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"ec25bc04ed8e12947738468cbe2191f1529f9e39\", \"lessThan\": \"be12572c5ddc8ad7453bada4eec8fa46967dc757\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"ec25bc04ed8e12947738468cbe2191f1529f9e39\", \"lessThan\": \"676dc7d9b15bf8733233a2db1ec3f9091ab34275\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"ec25bc04ed8e12947738468cbe2191f1529f9e39\", \"lessThan\": \"e461a9816a1ac5b4aeb61621b817225b61e46a68\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"ec25bc04ed8e12947738468cbe2191f1529f9e39\", \"lessThan\": \"f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"ec25bc04ed8e12947738468cbe2191f1529f9e39\", \"lessThan\": \"75917372eef0dbfb290ae45474314d35f97aea18\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"ec25bc04ed8e12947738468cbe2191f1529f9e39\", \"lessThan\": \"addad7643142f500080417dd7272f49b7a185570\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/net/ethernet/mellanox/mlx4/en_netdev.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.7\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"4.7\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"4.14.257\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"4.14.*\"}, {\"status\": \"unaffected\", \"version\": \"4.19.220\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"4.19.*\"}, {\"status\": \"unaffected\", \"version\": \"5.4.164\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.4.*\"}, {\"status\": \"unaffected\", \"version\": \"5.10.84\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.10.*\"}, {\"status\": \"unaffected\", \"version\": \"5.15.7\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"5.16\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/net/ethernet/mellanox/mlx4/en_netdev.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/be12572c5ddc8ad7453bada4eec8fa46967dc757\"}, {\"url\": \"https://git.kernel.org/stable/c/676dc7d9b15bf8733233a2db1ec3f9091ab34275\"}, {\"url\": \"https://git.kernel.org/stable/c/e461a9816a1ac5b4aeb61621b817225b61e46a68\"}, {\"url\": \"https://git.kernel.org/stable/c/f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b\"}, {\"url\": \"https://git.kernel.org/stable/c/75917372eef0dbfb290ae45474314d35f97aea18\"}, {\"url\": \"https://git.kernel.org/stable/c/addad7643142f500080417dd7272f49b7a185570\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnet/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()\\n\\nIn mlx4_en_try_alloc_resources(), mlx4_en_copy_priv() is called and\\ntmp-\u003etx_cq will be freed on the error path of mlx4_en_copy_priv().\\nAfter that mlx4_en_alloc_resources() is called and there is a dereference\\nof \u0026tmp-\u003etx_cq[t][i] in mlx4_en_alloc_resources(), which could lead to\\na use after free problem on failure of mlx4_en_copy_priv().\\n\\nFix this bug by adding a check of mlx4_en_copy_priv()\\n\\nThis bug was found by a static analyzer. The analysis employs\\ndifferential checking to identify inconsistent security operations\\n(e.g., checks or kfrees) between two code paths and confirms that the\\ninconsistent operations are not recovered in the current function or\\nthe callers, so they constitute bugs.\\n\\nNote that, as a bug found by static analysis, it can be a false\\npositive or hard to trigger. Multiple researchers have cross-reviewed\\nthe bug.\\n\\nBuilds with CONFIG_MLX4_EN=m show no new warnings,\\nand our static analyzer no longer warns about this code.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"4.14.257\", \"versionStartIncluding\": \"4.7\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"4.19.220\", \"versionStartIncluding\": \"4.7\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.4.164\", \"versionStartIncluding\": \"4.7\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.10.84\", \"versionStartIncluding\": \"4.7\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.15.7\", \"versionStartIncluding\": \"4.7\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.16\", \"versionStartIncluding\": \"4.7\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2025-05-04T07:13:09.872Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2021-47541\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-05-04T07:13:09.872Z\", \"dateReserved\": \"2024-05-24T15:02:54.829Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-24T15:09:47.916Z\", \"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 observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…