{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2021-47081","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2024-02-29T22:33:44.298Z","datePublished":"2024-03-01T21:15:16.684Z","dateUpdated":"2026-08-05T08:45:52.781Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T08:45:52.781Z"},"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->id later,\nwhich is a potential uaf.\n\nMy patch add a variable 'id' to accept the value of cb->id before the\nhl_cb_put(cb) is called, to avoid the potential uaf."}],"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 vulnerable path is reached by opening and closing the local HabanaLabs char device (/dev/hl*), which triggers context release, memory scrubbing, and gaudi_memset_device_memory; it is not reachable via network packets.\nAC:L - An attacker who can open the device reliably drives the put-then-use-id cleanup on every scrub/memset invocation, and use-after-free races of this kind are treated as attacker-influencible rather than requiring uncontrollable conditions.\nPR:L - hl_device_open performs no capability check, and Gaudi device nodes are routinely granted to unprivileged users via udev group/world permissions in real deployments, matching other scored habanalabs CVEs.\nUI:N - The attacker triggers the bug solely by opening and closing the device themselves; no separate victim action is required.\nS:U - Impact is confined to the host kernel authority (local privilege escalation / memory corruption); there is no VM, IOMMU, or other security-authority boundary crossed.\nC:H - This is a use-after-free on a kernel command-buffer object; UAF enables heap reuse and disclosure of freed object contents, so confidentiality impact is High.\nI:H - Use-after-free of the CB object can be turned into heap spray and arbitrary write / control-flow hijacking primitives, so integrity impact is High.\nA:H - Use-after-free of kernel memory can cause kernel oops/panic or device-driver failure, yielding High availability impact."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/misc/habanalabs/gaudi/gaudi.c"],"versions":[{"version":"423815bf02e257091d5337be5c63b57fc29e4254","lessThan":"b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7","status":"affected","versionType":"git"},{"version":"423815bf02e257091d5337be5c63b57fc29e4254","lessThan":"115726c5d312b462c9d9931ea42becdfa838a076","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/misc/habanalabs/gaudi/gaudi.c"],"versions":[{"version":"5.12","status":"affected"},{"version":"0","lessThan":"5.12","status":"unaffected","versionType":"semver"},{"version":"5.12.7","lessThanOrEqual":"5.12.*","status":"unaffected","versionType":"semver"},{"version":"5.13","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":"5.12","versionEndExcluding":"5.12.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.12","versionEndExcluding":"5.13"}]}]}],"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"}},"adp":[{"title":"CISA ADP Vulnrichment","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-06-04T17:14:15.058Z"}},{"providerMetadata":{"orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE","dateUpdated":"2024-08-04T05:24:39.774Z"},"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"]}]}]}}