summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorAlison Schofield <alison.schofield@intel.com>2026-08-07 17:05:51 -0700
committerDave Jiang <dave.jiang@intel.com>2026-09-16 09:05:11 -0700
commit4e42c398af136d62fac8c19c9f410ec83a8dd34a (patch)
treed4c8d975a1d6c09bb96524ea04d4bbbdc15fb01c /tools/perf/scripts/python/stackcollapse.py
parent7dae18c39e99813461db6ef3fc13f077452109ce (diff)
downloadlinux-next-4e42c398af136d62fac8c19c9f410ec83a8dd34a.tar.gz
linux-next-4e42c398af136d62fac8c19c9f410ec83a8dd34a.zip
cxl/port: Bound switch decoder target array access by nr_targets
Switch decoder target lookups walk the target array using interleave ways as the bound. The array is allocated with nr_targets entries, so a decoder whose interleave ways exceeds nr_targets reads and writes past the end of it. That happens during dport activation, during decoder target population, and when userspace reads the target_list attribute. Bounding by nr_targets alone is not correct either. Commit d6488fee6647 ("cxl/port: Fix decoder initialization when nr_targets > interleave_ways") moved target population to interleave ways precisely so that targets a decoder does not use are left unpopulated. Neither field alone is a safe bound, so add a helper that returns the minimum of the two and use it at every walk of the target array. Valid configurations keep interleave ways within nr_targets, so this is not a behavior change for them. Fixes: 40ba17afdfab ("cxl/acpi: Introduce cxl_decoder objects") Fixes: d6488fee6647 ("cxl/port: Fix decoder initialization when nr_targets > interleave_ways") Signed-off-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Li Ming <ming.li@zohomail.com> Link: https://patch.msgid.link/d7577652cc6d414e1de0ee4045d4d6b2808172ce.1786143520.git.alison.schofield@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions