We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06ce6e9 commit a5f8129Copy full SHA for a5f8129
arch/x86/events/intel/cstate.c
@@ -92,6 +92,7 @@
92
#include <linux/module.h>
93
#include <linux/slab.h>
94
#include <linux/perf_event.h>
95
+#include <linux/nospec.h>
96
#include <asm/cpu_device_id.h>
97
#include <asm/intel-family.h>
98
#include "../perf_event.h"
@@ -302,6 +303,7 @@ static int cstate_pmu_event_init(struct perf_event *event)
302
303
} else if (event->pmu == &cstate_pkg_pmu) {
304
if (cfg >= PERF_CSTATE_PKG_EVENT_MAX)
305
return -EINVAL;
306
+ cfg = array_index_nospec((unsigned long)cfg, PERF_CSTATE_PKG_EVENT_MAX);
307
if (!pkg_msr[cfg].attr)
308
309
event->hw.event_base = pkg_msr[cfg].msr;
0 commit comments