{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2021-47541",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2024-05-24T15:02:54.829Z",
        "datePublished": "2024-05-24T15:09:47.916Z",
        "dateUpdated": "2026-08-05T08:48:18.817Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T08:48:18.817Z"
            },
            "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->tx_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 &tmp->tx_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."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7.8,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The bug is in mlx4_en driver resource reallocation, reached only via local admin netdev configuration (ethtool set_ringparam/set_channels, tc mqprio ndo_setup_tc, hwtstamp/set_features, or XDP ndo_bpf), not via received network packets.\nAC:L - The attacker can deliberately induce the required kcalloc failure through memory pressure and then invoke the reconfiguration path; no conditions outside attacker influence are required beyond that controllable low-memory state.\nPR:L - Entry points require CAP_NET_ADMIN checked via ns_capable/GENL_UNS_ADMIN_PERM, which is obtainable as an unprivileged user through user namespaces or as container root with a delegated mlx4/VF device, so privileges are Low rather than host root.\nUI:N - Exploitation needs no victim action; the attacker alone triggers the reconfiguration ioctl/netlink call under memory pressure.\nS:U - Impact is confined to the host kernel authority (privilege escalation/crash within the same OS); this is not a VM/IOMMU escape or cross-boundary compromise.\nC:H - Use-after-free of the tx_cq/tx_ring pointer arrays enables heap reuse and arbitrary read primitives via controlled reallocation of the freed objects.\nI:H - mlx4_en_create_cq writes the new cq pointer into the already-freed array (*pcq = cq), yielding a write-to-freed-memory primitive suitable for heap corruption and control-flow hijacking.\nA:H - The UAF and/or NULL-based dereference paths cause kernel oops/panic, so availability impact is High even without full exploitation."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/net/ethernet/mellanox/mlx4/en_netdev.c"
                    ],
                    "versions": [
                        {
                            "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
                            "lessThan": "be12572c5ddc8ad7453bada4eec8fa46967dc757",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
                            "lessThan": "676dc7d9b15bf8733233a2db1ec3f9091ab34275",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
                            "lessThan": "e461a9816a1ac5b4aeb61621b817225b61e46a68",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
                            "lessThan": "f1d43efa59f1edd3e7eca0e94559b4c6b1cd4e2b",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
                            "lessThan": "75917372eef0dbfb290ae45474314d35f97aea18",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "ec25bc04ed8e12947738468cbe2191f1529f9e39",
                            "lessThan": "addad7643142f500080417dd7272f49b7a185570",
                            "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/net/ethernet/mellanox/mlx4/en_netdev.c"
                    ],
                    "versions": [
                        {
                            "version": "4.7",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "4.7",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "4.14.257",
                            "lessThanOrEqual": "4.14.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "4.19.220",
                            "lessThanOrEqual": "4.19.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.4.164",
                            "lessThanOrEqual": "5.4.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.10.84",
                            "lessThanOrEqual": "5.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.7",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.16",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.7",
                                    "versionEndExcluding": "4.14.257"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.7",
                                    "versionEndExcluding": "4.19.220"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.7",
                                    "versionEndExcluding": "5.4.164"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.7",
                                    "versionEndExcluding": "5.10.84"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.7",
                                    "versionEndExcluding": "5.15.7"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.7",
                                    "versionEndExcluding": "5.16"
                                }
                            ]
                        }
                    ]
                }
            ],
            "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"
            }
        },
        "adp": [
            {
                "metrics": [
                    {
                        "other": {
                            "type": "ssvc",
                            "content": {
                                "timestamp": "2024-06-10T18:52:32.131525Z",
                                "id": "CVE-2021-47541",
                                "options": [
                                    {
                                        "Exploitation": "none"
                                    },
                                    {
                                        "Automatable": "no"
                                    },
                                    {
                                        "Technical Impact": "partial"
                                    }
                                ],
                                "role": "CISA Coordinator",
                                "version": "2.0.3"
                            }
                        }
                    }
                ],
                "title": "CISA ADP Vulnrichment",
                "providerMetadata": {
                    "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
                    "shortName": "CISA-ADP",
                    "dateUpdated": "2024-06-10T18:52:41.480Z"
                }
            },
            {
                "providerMetadata": {
                    "orgId": "af854a3a-2127-422b-91ae-364da2661108",
                    "shortName": "CVE",
                    "dateUpdated": "2024-08-04T05:39:59.831Z"
                },
                "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"
                        ]
                    }
                ]
            }
        ]
    }
}