drm/nouveau: fix a use-after-free in nouveau_gem_prime_import_sg_table()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 019cbd4a4feb3aa3a917d78e7110e3011bbff6d5 · < 540dfd188ea2940582841c1c220bd035a7db0e51| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/nouveau: fix a use-after-free in nouveau_gem_prime_import_sg_table()
nouveau_bo_init() is backed by ttm_bo_init() and ferries its return code back to the caller. On failures, ttm will call nouveau_bo_del_ttm() and free the memory.Thus, when nouveau_bo_init() returns an error, the gem object has already been released. Then the call to nouveau_bo_ref() will use the freed "nvbo->bo" and lead to a use-after-free bug.
We should delete the call to nouveau_bo_ref() to avoid the use-after-free.
From the CVE record · Linux
The Linux kernel’s nouveau GEM import path has a use-after-free. If buffer-object initialization fails, a subsequent reference call accesses memory that has already been freed. The input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels with the nouveau driver should check their versions; affected versions are not specified.