CVE-2021-47081

habanalabs/gaudi: Fix a potential use after free in gaudi_memset_device_memory

State
Published
Severity
7.8 High
Published
Mar 1, 2024
Updated
Aug 5, 2026
Reserved
Feb 29, 2024

Read the record on cve.org

Description

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.

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HLinux

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • 423815bf02e257091d5337be5c63b57fc29e4254 to before b49f5af30b0e4064fbd91e83823a4bfcb2c7a3e7Affected
  • 423815bf02e257091d5337be5c63b57fc29e4254 to before 115726c5d312b462c9d9931ea42becdfa838a076Affected
LinuxLinux
  • 5.12Affected
  • before 5.12Not affected
  • 5.12.7 through 5.12.*Not affected
  • 5.13 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.