summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2026-09-18 15:16:17 +0200
committerLyude Paul <lyude@redhat.com>2026-09-18 14:09:00 -0400
commitaff09d9e37e02dc60bde79035ac15b136d602259 (patch)
tree6d3692da68fa442631a7ae83fd1f8c18c635f631 /tools/perf/scripts/python/stackcollapse.py
parentfefd9480ec361969f1a836df46326a1801062c26 (diff)
downloadlinux-next-aff09d9e37e02dc60bde79035ac15b136d602259.tar.gz
linux-next-aff09d9e37e02dc60bde79035ac15b136d602259.zip
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. Fixes: 7c8565220697 ("drm/nouveau/clk: implement power state and engine clock control in core") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> [Francesco: rebased on drm-misc-next, expanded the commit message] Signed-off-by: Francesco Magazzu <postadelmaga@gmail.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://patch.msgid.link/20260918131620.405133-2-postadelmaga@gmail.com
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions