[PATCH v2 0/5] perf, bts: Fallout from the fuzzer for perf/urgent

From: Alexander Shishkin
Date: Tue Sep 06 2016 - 09:28:29 EST


Hi,

There were more bugs since the previous version, plus the BTS barriers
got fixed. With these patches, my testcase keeps running and no
spurious NMI warnings pop up any more.

Original story:

Recently Vince has reported warnings and panics coming from the
general direction of AUX tracing. I found two bugs which manifest
similarly, one in intel_bts driver and one in AUX unmapping path.

Both are triggered by racing SET_OUTPUT against mmap_close while
running AUX tracing. I have a test case that set fire to the kernel
within a few seconds by doing this, which I can share if anyone
cares.

These are all good candidates for 4.7-stable and the BTS ones can be
theoretically backported further.

Alexander Shishkin (5):
perf: Fix a race between mmap_close and set_output of AUX events
perf: Fix aux_mmap_count vs aux_refcount order
perf/x86/intel/bts: Fix confused ordering of PMU callbacks
perf/x86/intel/bts: Fix BTS PMI detection
perf/x86/intel/bts: Kill a silly warning

arch/x86/events/intel/bts.c | 123 +++++++++++++++++++++++++++++++++-----------
kernel/events/core.c | 31 ++++++++---
kernel/events/ring_buffer.c | 16 +++---
3 files changed, 129 insertions(+), 41 deletions(-)

--
2.9.3