CVE-2021-47081 (GCVE-0-2021-47081)
Vulnerability from cvelistv5 – Published: 2024-03-01 21:15 – Updated: 2025-05-04 07:03
VLAI?
Summary
In the Linux kernel, the following vulnerability has been resolved:
habanalabs/gaudi: Fix a potential use after free in gaudi_memset_device_memory
Our code analyzer reported a uaf.
In gaudi_memset_device_memory, cb is get via hl_cb_kernel_create()
with 2 refcount.
If hl_cs_allocate_job() failed, the execution runs into release_cb
branch. One ref of cb is dropped by hl_cb_put(cb) and could be freed
if other thread also drops one ref. Then cb is used by cb->id later,
which is a potential uaf.
My patch add a variable 'id' to accept the value of cb->id before the
hl_cb_put(cb) is called, to avoid the potential uaf.
Severity ?
No CVSS data available.
Assigner
References
Impacted products
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2021-47081",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2024-03-04T19:32:29.244809Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2024-06-04T17:14:15.058Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
},
{
"providerMetadata": {
"dateUpdated": "2024-08-04T05:24:39.774Z",
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE"
},
"references": [
{
"tags": [
"x_transferred"
],
"url": "https://git.kernel.org/stable/c/b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7"
},
{
"tags": [
"x_transferred"
],
"url": "https://git.kernel.org/stable/c/115726c5d312b462c9d9931ea42becdfa838a076"
}
],
"title": "CVE Program Container"
}
],
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"product": "Linux",
"programFiles": [
"drivers/misc/habanalabs/gaudi/gaudi.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"lessThan": "b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7",
"status": "affected",
"version": "423815bf02e257091d5337be5c63b57fc29e4254",
"versionType": "git"
},
{
"lessThan": "115726c5d312b462c9d9931ea42becdfa838a076",
"status": "affected",
"version": "423815bf02e257091d5337be5c63b57fc29e4254",
"versionType": "git"
}
]
},
{
"defaultStatus": "affected",
"product": "Linux",
"programFiles": [
"drivers/misc/habanalabs/gaudi/gaudi.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"status": "affected",
"version": "5.12"
},
{
"lessThan": "5.12",
"status": "unaffected",
"version": "0",
"versionType": "semver"
},
{
"lessThanOrEqual": "5.12.*",
"status": "unaffected",
"version": "5.12.7",
"versionType": "semver"
},
{
"lessThanOrEqual": "*",
"status": "unaffected",
"version": "5.13",
"versionType": "original_commit_for_fix"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "5.12.7",
"versionStartIncluding": "5.12",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "5.13",
"versionStartIncluding": "5.12",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\nhabanalabs/gaudi: Fix a potential use after free in gaudi_memset_device_memory\n\nOur code analyzer reported a uaf.\n\nIn gaudi_memset_device_memory, cb is get via hl_cb_kernel_create()\nwith 2 refcount.\nIf hl_cs_allocate_job() failed, the execution runs into release_cb\nbranch. One ref of cb is dropped by hl_cb_put(cb) and could be freed\nif other thread also drops one ref. Then cb is used by cb-\u003eid later,\nwhich is a potential uaf.\n\nMy patch add a variable \u0027id\u0027 to accept the value of cb-\u003eid before the\nhl_cb_put(cb) is called, to avoid the potential uaf."
}
],
"providerMetadata": {
"dateUpdated": "2025-05-04T07:03:46.750Z",
"orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"shortName": "Linux"
},
"references": [
{
"url": "https://git.kernel.org/stable/c/b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7"
},
{
"url": "https://git.kernel.org/stable/c/115726c5d312b462c9d9931ea42becdfa838a076"
}
],
"title": "habanalabs/gaudi: Fix a potential use after free in gaudi_memset_device_memory",
"x_generator": {
"engine": "bippy-1.2.0"
}
}
},
"cveMetadata": {
"assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"assignerShortName": "Linux",
"cveId": "CVE-2021-47081",
"datePublished": "2024-03-01T21:15:16.684Z",
"dateReserved": "2024-02-29T22:33:44.298Z",
"dateUpdated": "2025-05-04T07:03:46.750Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.1",
"vulnerability-lookup:meta": {
"fkie_nvd": {
"configurations": "[{\"nodes\": [{\"operator\": \"OR\", \"negate\": false, \"cpeMatch\": [{\"vulnerable\": true, \"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"versionStartIncluding\": \"5.12\", \"versionEndExcluding\": \"5.12.7\", \"matchCriteriaId\": \"13460FFE-8AA9-4F1C-963C-30982D8858D1\"}, {\"vulnerable\": true, \"criteria\": \"cpe:2.3:o:linux:linux_kernel:5.13:rc1:*:*:*:*:*:*\", \"matchCriteriaId\": \"0CBAD0FC-C281-4666-AB2F-F8E6E1165DF7\"}, {\"vulnerable\": true, \"criteria\": \"cpe:2.3:o:linux:linux_kernel:5.13:rc2:*:*:*:*:*:*\", \"matchCriteriaId\": \"96AC23B2-D46A-49D9-8203-8E1BEDCA8532\"}]}]}]",
"descriptions": "[{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nhabanalabs/gaudi: Fix a potential use after free in gaudi_memset_device_memory\\n\\nOur code analyzer reported a uaf.\\n\\nIn gaudi_memset_device_memory, cb is get via hl_cb_kernel_create()\\nwith 2 refcount.\\nIf hl_cs_allocate_job() failed, the execution runs into release_cb\\nbranch. One ref of cb is dropped by hl_cb_put(cb) and could be freed\\nif other thread also drops one ref. Then cb is used by cb-\u003eid later,\\nwhich is a potential uaf.\\n\\nMy patch add a variable \u0027id\u0027 to accept the value of cb-\u003eid before the\\nhl_cb_put(cb) is called, to avoid the potential uaf.\"}, {\"lang\": \"es\", \"value\": \"En el kernel de Linux se ha resuelto la siguiente vulnerabilidad: habanalabs/gaudi: Corregir un uso potencial despu\\u00e9s de liberar en gaudi_memset_device_memory Nuestro analizador de c\\u00f3digo report\\u00f3 un uaf. En gaudi_memset_device_memory, cb se obtiene a trav\\u00e9s de hl_cb_kernel_create() con 2 refcount. Si hl_cs_allocate_job() falla, la ejecuci\\u00f3n se ejecuta en la rama release_cb. hl_cb_put(cb) elimina una referencia de cb y podr\\u00eda liberarse si otro hilo tambi\\u00e9n elimina una referencia. Luego, cb-\u0026gt;id usa cb m\\u00e1s tarde, que es un uaf potencial. Mi parche agrega una variable \u0027id\u0027 para aceptar el valor de cb-\u0026gt;id antes de llamar a hl_cb_put(cb), para evitar el potencial uaf.\"}]",
"id": "CVE-2021-47081",
"lastModified": "2024-12-09T18:45:24.617",
"metrics": "{\"cvssMetricV31\": [{\"source\": \"nvd@nist.gov\", \"type\": \"Primary\", \"cvssData\": {\"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\", \"attackVector\": \"LOCAL\", \"attackComplexity\": \"LOW\", \"privilegesRequired\": \"LOW\", \"userInteraction\": \"NONE\", \"scope\": \"UNCHANGED\", \"confidentialityImpact\": \"HIGH\", \"integrityImpact\": \"HIGH\", \"availabilityImpact\": \"HIGH\"}, \"exploitabilityScore\": 1.8, \"impactScore\": 5.9}]}",
"published": "2024-03-01T22:15:47.483",
"references": "[{\"url\": \"https://git.kernel.org/stable/c/115726c5d312b462c9d9931ea42becdfa838a076\", \"source\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"tags\": [\"Patch\"]}, {\"url\": \"https://git.kernel.org/stable/c/b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7\", \"source\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"tags\": [\"Patch\"]}, {\"url\": \"https://git.kernel.org/stable/c/115726c5d312b462c9d9931ea42becdfa838a076\", \"source\": \"af854a3a-2127-422b-91ae-364da2661108\", \"tags\": [\"Patch\"]}, {\"url\": \"https://git.kernel.org/stable/c/b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7\", \"source\": \"af854a3a-2127-422b-91ae-364da2661108\", \"tags\": [\"Patch\"]}]",
"sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"vulnStatus": "Analyzed",
"weaknesses": "[{\"source\": \"nvd@nist.gov\", \"type\": \"Primary\", \"description\": [{\"lang\": \"en\", \"value\": \"CWE-416\"}]}]"
},
"nvd": "{\"cve\":{\"id\":\"CVE-2021-47081\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-03-01T22:15:47.483\",\"lastModified\":\"2024-12-09T18:45:24.617\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nhabanalabs/gaudi: Fix a potential use after free in gaudi_memset_device_memory\\n\\nOur code analyzer reported a uaf.\\n\\nIn gaudi_memset_device_memory, cb is get via hl_cb_kernel_create()\\nwith 2 refcount.\\nIf hl_cs_allocate_job() failed, the execution runs into release_cb\\nbranch. One ref of cb is dropped by hl_cb_put(cb) and could be freed\\nif other thread also drops one ref. Then cb is used by cb-\u003eid later,\\nwhich is a potential uaf.\\n\\nMy patch add a variable \u0027id\u0027 to accept the value of cb-\u003eid before the\\nhl_cb_put(cb) is called, to avoid the potential uaf.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux se ha resuelto la siguiente vulnerabilidad: habanalabs/gaudi: Corregir un uso potencial despu\u00e9s de liberar en gaudi_memset_device_memory Nuestro analizador de c\u00f3digo report\u00f3 un uaf. En gaudi_memset_device_memory, cb se obtiene a trav\u00e9s de hl_cb_kernel_create() con 2 refcount. Si hl_cs_allocate_job() falla, la ejecuci\u00f3n se ejecuta en la rama release_cb. hl_cb_put(cb) elimina una referencia de cb y podr\u00eda liberarse si otro hilo tambi\u00e9n elimina una referencia. Luego, cb-\u0026gt;id usa cb m\u00e1s tarde, que es un uaf potencial. Mi parche agrega una variable \u0027id\u0027 para aceptar el valor de cb-\u0026gt;id antes de llamar a hl_cb_put(cb), para evitar el potencial uaf.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"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\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-416\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.12\",\"versionEndExcluding\":\"5.12.7\",\"matchCriteriaId\":\"13460FFE-8AA9-4F1C-963C-30982D8858D1\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.13:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"0CBAD0FC-C281-4666-AB2F-F8E6E1165DF7\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:5.13:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"96AC23B2-D46A-49D9-8203-8E1BEDCA8532\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/115726c5d312b462c9d9931ea42becdfa838a076\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/115726c5d312b462c9d9931ea42becdfa838a076\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Patch\"]}]}}",
"vulnrichment": {
"containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/115726c5d312b462c9d9931ea42becdfa838a076\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-04T05:24:39.774Z\"}}, {\"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2021-47081\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-03-04T19:32:29.244809Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-05-23T19:01:14.755Z\"}, \"title\": \"CISA ADP Vulnrichment\"}], \"cna\": {\"title\": \"habanalabs/gaudi: Fix a potential use after free in gaudi_memset_device_memory\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"423815bf02e257091d5337be5c63b57fc29e4254\", \"lessThan\": \"b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"423815bf02e257091d5337be5c63b57fc29e4254\", \"lessThan\": \"115726c5d312b462c9d9931ea42becdfa838a076\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/misc/habanalabs/gaudi/gaudi.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.12\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"5.12\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.12.7\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.12.*\"}, {\"status\": \"unaffected\", \"version\": \"5.13\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/misc/habanalabs/gaudi/gaudi.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7\"}, {\"url\": \"https://git.kernel.org/stable/c/115726c5d312b462c9d9931ea42becdfa838a076\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nhabanalabs/gaudi: Fix a potential use after free in gaudi_memset_device_memory\\n\\nOur code analyzer reported a uaf.\\n\\nIn gaudi_memset_device_memory, cb is get via hl_cb_kernel_create()\\nwith 2 refcount.\\nIf hl_cs_allocate_job() failed, the execution runs into release_cb\\nbranch. One ref of cb is dropped by hl_cb_put(cb) and could be freed\\nif other thread also drops one ref. Then cb is used by cb-\u003eid later,\\nwhich is a potential uaf.\\n\\nMy patch add a variable \u0027id\u0027 to accept the value of cb-\u003eid before the\\nhl_cb_put(cb) is called, to avoid the potential uaf.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.12.7\", \"versionStartIncluding\": \"5.12\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.13\", \"versionStartIncluding\": \"5.12\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2025-05-04T07:03:46.750Z\"}}}",
"cveMetadata": "{\"cveId\": \"CVE-2021-47081\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-05-04T07:03:46.750Z\", \"dateReserved\": \"2024-02-29T22:33:44.298Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-03-01T21:15:16.684Z\", \"assignerShortName\": \"Linux\"}",
"dataType": "CVE_RECORD",
"dataVersion": "5.1"
}
}
}
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…
Loading…