summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-09-19 10:31:36 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-09-19 10:31:36 -0700
commit598a0c7d0932e385486b173768f03d95bf5507c8 (patch)
treed528410bffc0297c205b55dbb2b4a012243089d7 /arch/x86
parent7a5e87867e9fe043c3067a864124caf2b8e7fb99 (diff)
parent3577af70a2ce4853d58e57d832e687d739281479 (diff)
downloadop-kernel-dev-598a0c7d0932e385486b173768f03d95bf5507c8.zip
op-kernel-dev-598a0c7d0932e385486b173768f03d95bf5507c8.tar.gz
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "Two kernel side fixes: a kprobes fix and a perf_remove_from_context() fix (which does not yet fix the migration bug which is WIP)" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Fix a race condition in perf_remove_from_context() kprobes/x86: Free 'optinsn' cache when range check fails
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/kprobes/opt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c
index f304773..f1314d0 100644
--- a/arch/x86/kernel/kprobes/opt.c
+++ b/arch/x86/kernel/kprobes/opt.c
@@ -338,8 +338,10 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
* a relative jump.
*/
rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE;
- if (abs(rel) > 0x7fffffff)
+ if (abs(rel) > 0x7fffffff) {
+ __arch_remove_optimized_kprobe(op, 0);
return -ERANGE;
+ }
buf = (u8 *)op->optinsn.insn;
OpenPOWER on IntegriCloud