Skip to content

Commit

Permalink
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip

Pull perf fix from Ingo Molnar:
 "A fix for a misplaced permission check that can leave perf PT or LBR
  disabled (on Intel CPUs) permanently until the next reboot"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/x86/intel/bts: Fix exclusive event reference leak
  • Loading branch information
torvalds committed Oct 28, 2017
2 parents 5cefb4e + 2eece39 commit 02c7dfc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/events/intel/bts.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,6 @@ static int bts_event_init(struct perf_event *event)
if (event->attr.type != bts_pmu.type)
return -ENOENT;

if (x86_add_exclusive(x86_lbr_exclusive_bts))
return -EBUSY;

/*
* BTS leaks kernel addresses even when CPL0 tracing is
* disabled, so disallow intel_bts driver for unprivileged
Expand All @@ -562,6 +559,9 @@ static int bts_event_init(struct perf_event *event)
!capable(CAP_SYS_ADMIN))
return -EACCES;

if (x86_add_exclusive(x86_lbr_exclusive_bts))
return -EBUSY;

ret = x86_reserve_hardware();
if (ret) {
x86_del_exclusive(x86_lbr_exclusive_bts);
Expand Down

0 comments on commit 02c7dfc

Please sign in to comment.