perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology()
authorAlexander Antonov <alexander.antonov@linux.intel.com>
Mon, 27 Nov 2023 18:52:45 +0000 (10:52 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 30 Nov 2023 13:29:52 +0000 (14:29 +0100)
commit1692cf434ba13ee212495b5af795b6a07e986ce4
treeb251ee35f2aae0f02715997111b550d8f158a2c6
parent0f9e0d7928d8e88d57b1482effab70edb9741ce1
perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology()

Get logical socket id instead of physical id in discover_upi_topology()
to avoid out-of-bound access on 'upi = &type->topology[nid][idx];' line
that leads to NULL pointer dereference in upi_fill_topology()

Fixes: f680b6e6062e ("perf/x86/intel/uncore: Enable UPI topology discovery for Icelake Server")
Reported-by: Kyle Meyer <kyle.meyer@hpe.com>
Signed-off-by: Alexander Antonov <alexander.antonov@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Tested-by: Kyle Meyer <kyle.meyer@hpe.com>
Link: https://lore.kernel.org/r/20231127185246.2371939-2-alexander.antonov@linux.intel.com
arch/x86/events/intel/uncore_snbep.c