drm/nouveau: fix double-free in nvif_vmm_dtor
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 20d8a88e557aae5264e793f4626c45cd644c7144 · < 109a8d2d5b7d2719ebe09df3f9241023900b3846| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/nouveau: fix double-free in nvif_vmm_dtor
On failure, nouveau_cli_init() calls nouveau_cli_fini() to tear the client down. Then, nouveau_drm_open() also enters into its cleanup path and calls nouveau_cli_fini() AGAIN. nouveau_cli_fini() calls nouveau_vmm_fini():
void nouveau_vmm_fini(struct nouveau_vmm *vmm) { nouveau_svmm_fini(&vmm->svmm); nvif_vmm_dtor(&vmm->vmm); vmm->cli = NULL; }
Inside nvif_vmm_dtor(), vmm->page is freed unconditionally:
void nvif_vmm_dtor(struct nvif_vmm *vmm) { kfree(vmm->page); nvif_object_dtor(&vmm->object); }
vmm->page is never cleared after being freed, so the second call of nvif_vmm_dtor() will cause a double-free.
Found by fuzzing the nouveau driver with a modified Syzkaller:
From the CVE record · Linux
The Linux kernel’s nouveau driver can free the same memory twice during cleanup if client initialization fails while opening a DRM device. A local process that triggers this failure path can cause the double-free; the input does not establish whether authentication or user interaction is required.
Engineers running Linux systems with the nouveau driver should check their kernel versions; affected versions are not specified.