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
This commit is contained in:
commit
02c7dfc006
|
@ -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)
|
||||||
!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);
|
||||||
|
|
Loading…
Reference in New Issue