Commit 02c7dfc0 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/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
parents 5cefb4ee 2eece390
...@@ -546,9 +546,6 @@ static int bts_event_init(struct perf_event *event) ...@@ -546,9 +546,6 @@ static int bts_event_init(struct perf_event *event)
if (event->attr.type != bts_pmu.type) if (event->attr.type != bts_pmu.type)
return -ENOENT; return -ENOENT;
if (x86_add_exclusive(x86_lbr_exclusive_bts))
return -EBUSY;
/* /*
* BTS leaks kernel addresses even when CPL0 tracing is * BTS leaks kernel addresses even when CPL0 tracing is
* disabled, so disallow intel_bts driver for unprivileged * disabled, so disallow intel_bts driver for unprivileged
...@@ -562,6 +559,9 @@ static int bts_event_init(struct perf_event *event) ...@@ -562,6 +559,9 @@ static int bts_event_init(struct perf_event *event)
!capable(CAP_SYS_ADMIN)) !capable(CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
if (x86_add_exclusive(x86_lbr_exclusive_bts))
return -EBUSY;
ret = x86_reserve_hardware(); ret = x86_reserve_hardware();
if (ret) { if (ret) {
x86_del_exclusive(x86_lbr_exclusive_bts); x86_del_exclusive(x86_lbr_exclusive_bts);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment