OSDN Git Service

perf/x86: Fix potential out-of-bounds access
authorPeter Zijlstra <peterz@infradead.org>
Fri, 6 Dec 2019 11:50:16 +0000 (12:50 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 17 Dec 2019 12:32:46 +0000 (13:32 +0100)
commit1e69a0efc0bd0e02b8327e7186fbb4a81878ea0b
tree8eeccf5d120c1eb9346e1959225383a02c3f69d7
parent57e04eeda515ee979fec3bc3d64c408feae18acc
perf/x86: Fix potential out-of-bounds access

UBSAN reported out-of-bound accesses for x86_pmu.event_map(), it's
arguments should be < x86_pmu.max_events. Make sure all users observe
this constraint.

Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Meelis Roos <mroos@linux.ee>
arch/x86/events/core.c