drm/nouveau/clk: fix list cursor use after loop in nvkm_clk_ustate_update
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 7c856522069755ab9d163a24ac332cd3cb35fe30 · < 0d096a7f7d79207490858dde731b16da5337e90c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/nouveau/clk: fix list cursor use after loop in nvkm_clk_ustate_update
If list_for_each_entry() exits without hitting a break then "pstate" is not a valid pstate pointer. Introduce a "found" variable instead.
The check is reachable from userspace: nvkm_clk_ustate_update() takes the pstate id straight from the 'pstate' debugfs file, so requesting an id that is not in clk->states - or any id at all when the perf tables are broken and the list is empty - makes the pstate->pstate != req test dereference the list head cast to a struct nvkm_pstate, which is an out-of-bounds read.
[Francesco: rebased on drm-misc-next, expanded the commit message]
From the CVE record · Linux
The Linux kernel’s nouveau clock code can read out of bounds when a pstate lookup fails. A local user who can write to the pstate debugfs file can trigger the read by requesting an absent pstate ID, or any ID if the performance-state list is empty.
Engineers running Linux kernels with the nouveau driver should check whether their kernel includes this fix; affected versions were not specified.