Alexei had his box explode because doing read() on a package (rapl/uncore) event that isn't currently scheduled in ends up doing an out-of-bounds load. Rework the code to more explicitly deal with event->oncpu being -1. Author: Peter Zijlstra (Intel) <peterz@infradead.org> Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com> Tested-by: Alexei Starovoitov <ast@kernel.org> Tested-by: David Carrillo-Cisneros <davidcc@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: eranian@google.com Fixes: d6a2f9035bfc ("perf/core: Introduce PMU_EV_CAP_READ_ACTIVE_PKG") Signed-off-by: Ingo Molnar <mingo@kernel.org> Git-commit: 451d24d1e5f40bad000fa9abe36ddb16fc9928cb Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git [pfay@codeaurora.org: apply the event->oncpu validity check from from the patch. Other code from the patch calls routines not yet in 4.4 so omit that part of patch. This code fixes segfault crashes during reboot where the event->oncpu value is -1. Change-Id: I040f0af2030e53ac3329e4b3a1bbcd37f080cdcf Signed-off-by: Patrick Fay <pfay@codeaurora.org> |
||
---|---|---|
.. | ||
callchain.c | ||
core.c | ||
hw_breakpoint.c | ||
internal.h | ||
Makefile | ||
ring_buffer.c | ||
uprobes.c |