summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorZhongqiu Han <zhongqiu.han@oss.qualcomm.com>2026-10-27 21:33:31 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-10-27 16:24:22 +0100
commit8a702989677216489e471a6f27599da53f753567 (patch)
treef61666821a0c554e5749ef023b2721b9ecc89505 /scripts/Makefile.thinlto
parent0ffc7534a210105ba973167a5b86d5ab39d4031f (diff)
downloadlinux-8a702989677216489e471a6f27599da53f753567.tar.gz
linux-8a702989677216489e471a6f27599da53f753567.zip
cpufreq: stats: Fix potential out-of-bounds access in deferred reset
cpufreq_stats_create_table() sets stats->last_index to -1 if policy->cur is not in the frequency table. It then stays at -1, because cpufreq_stats_record_transition() returns early on old_index == -1 before it gets to update last_index. Commit 46a310b80bc2 ("[CPUFREQ] Don't set stat->last_index to -1 if the pol->cur has incorrect value.") added that check. However, since commit 40c3bd4cfa6f ("cpufreq: stats: Defer stats update to cpufreq_stats_record_transition()"), the stats reset is deferred to the beginning of cpufreq_stats_record_transition(), before that check, and cpufreq_stats_reset_table() ends with an unconditional cpufreq_stats_update(). So if the "reset" attribute is written while last_index is -1, the next frequency transition accesses time_in_state[-1]. Fix it by also returning early on last_index == -1 in cpufreq_stats_reset_table(). Fixes: 40c3bd4cfa6f ("cpufreq: stats: Defer stats update to cpufreq_stats_record_transition()") Cc: 5.10+ <stable@vger.kernel.org> # 5.10+ Signed-off-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com> Link: https://patch.msgid.link/20261027133332.377546-1-zhongqiu.han@oss.qualcomm.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions