# CVE-2025-21842: amdkfd: properly free gang_ctx_bo when failed to init user queue

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 15% of CVEs (2026-12-01)
- Published: 2025-03-07T09:10:00.298Z
- Modified: 2026-08-05T11:54:51.838Z
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

amdkfd: properly free gang_ctx_bo when failed to init user queue

The destructor of a gtt bo is declared as
void amdgpu_amdkfd_free_gtt_mem(struct amdgpu_device *adev, void **mem_obj);
Which takes void** as the second parameter.

GCC allows passing void* to the function because void* can be implicitly
casted to any other types, so it can pass compiling.

However, passing this void* parameter into the function's
execution process(which expects void** and dereferencing void**)
will result in errors.

(As written by CVE List.)

## Affected

- Linux Linux: from fb91065851cd5f2735348c5f3eddeeca3d7c2973 before ae5ab1c1ae504f622cc1ff48830a9ed48428146d; from fb91065851cd5f2735348c5f3eddeeca3d7c2973 before 091a68c58c1bbd2ab7d05d1b32c1306394ec691d; from fb91065851cd5f2735348c5f3eddeeca3d7c2973 before a33f7f9660705fb2ecf3467b2c48965564f392ce; 6.12 (not affected: before 6.12; from 6.12.16 up to 6.12.*; from 6.13.4 up to 6.13.*; from 6.14 up to *)
- linux linux_kernel: from 6.12 before 6.12.16; from 6.13 before 6.13.4; 6.14

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/ae5ab1c1ae504f622cc1ff48830a9ed48428146d> (patch)
- <https://git.kernel.org/stable/c/091a68c58c1bbd2ab7d05d1b32c1306394ec691d> (patch)
- <https://git.kernel.org/stable/c/a33f7f9660705fb2ecf3467b2c48965564f392ce> (patch)

## Sources

- CVE List: [CVE-2025-21842](https://www.cve.org/CVERecord?id=CVE-2025-21842), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2025-21842](https://nvd.nist.gov/vuln/detail/CVE-2025-21842), Public domain, modified 2026-07-30

---

Page: https://cve.day/CVE-2025-21842 · Whole record: https://cve.day/CVE-2025-21842.json · Rebuilt by cve.day 2026-11-25T22:58:55.049Z
