diff options
| author | Len Brown <len.brown@intel.com> | 2026-05-06 10:00:00 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2026-10-03 14:49:37 -0400 |
| commit | 8a7f120e5288b9ebd87850350d2d7bdf74a54f08 (patch) | |
| tree | c674674e56d44ff82e0d75bfeedaf4dc87f3904d /tools/perf/scripts/python/bin | |
| parent | 242cdafe7a70dddec37f4ce18ef61152020941f2 (diff) | |
| download | linux-next-8a7f120e5288b9ebd87850350d2d7bdf74a54f08.tar.gz linux-next-8a7f120e5288b9ebd87850350d2d7bdf74a54f08.zip | |
x86_energy_perf_policy: Bound package iteration
Add explicit bounds checking against MAX_PACKAGES in for_packages()
to prevent potential out-of-bounds bit shift operations.
The for_packages() function iterates through package numbers and
performs a bit shift (1UL << pkg_num). If max_pkg_num is set to or
exceeds MAX_PACKAGES (64), the loop could attempt an invalid bit
shift on the bit set, potentially causing undefined behavior.
Adding a defensive break statement ensures we never attempt to
bit-shift beyond the valid range of the pkg_selected_set bitmask.
Fixes: 4beec1d75196 ("tools/power x86_energy_perf_policy: support HWP.EPP")
Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
