]> git.baikalelectronics.ru Git - kernel.git/commit
perf/x86: Fix broken LBR fixup code
authorStephane Eranian <eranian@google.com>
Mon, 11 Jun 2012 13:44:26 +0000 (15:44 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 13 Jun 2012 13:00:28 +0000 (15:00 +0200)
commit79657205a9993c4de61712d2d4099e0ba745c4d8
tree1ceacad99b6bcd462c40ad6c32e4ed4751434595
parent601b0aa331ddff954de224867efac37752d28dfc
perf/x86: Fix broken LBR fixup code

I noticed that the LBR fixups were not working anymore
on programs where they used to. I tracked this down to
a recent change to copy_from_user_nmi():

 738bb79290e ("perf/x86: Check user address explicitly in copy_from_user_nmi()")

This commit added a call to __range_not_ok() to the
copy_from_user_nmi() routine. The problem is that the logic
of the test must be reversed. __range_not_ok() returns 0 if the
range is VALID. We want to return early from copy_from_user_nmi()
if the range is NOT valid.

Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Arun Sharma <asharma@fb.com>
Link: http://lkml.kernel.org/r/20120611134426.GA7542@quad
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/lib/usercopy.c