]> git.baikalelectronics.ru Git - kernel.git/commit
perf/x86/intel/bts: Fix exclusive event reference leak
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Mon, 23 Oct 2017 12:35:33 +0000 (15:35 +0300)
committerIngo Molnar <mingo@kernel.org>
Tue, 24 Oct 2017 11:19:27 +0000 (13:19 +0200)
commit88e5dfd43cd4c6b1280b213b60be40eba73e86f3
tree94e5167d90a56e6437789583a626ca34a090b27b
parent1a69c4557618e253c09dced5c93764cf4e4b14d5
perf/x86/intel/bts: Fix exclusive event reference leak

Commit:

  b71157046377e ("perf/x86/intel/bts: Disallow use by unprivileged users on paranoid systems")

... adds a privilege check in the exactly wrong place in the event init path:
after the 'LBR exclusive' reference has been taken, and doesn't release it
in the case of insufficient privileges. After this, nobody in the system
gets to use PT or LBR afterwards.

This patch moves the privilege check to where it should have been in the
first place.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: b71157046377e ("perf/x86/intel/bts: Disallow use by unprivileged users on paranoid systems")
Link: http://lkml.kernel.org/r/20171023123533.16973-1-alexander.shishkin@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/events/intel/bts.c