Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Mar 2017 22:38:16 +0000 (14:38 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Mar 2017 22:38:16 +0000 (14:38 -0800)
Pull perf fixes from Ingo Molnar:
 "This includes a fix for a crash if certain special addresses are
  kprobed, plus does a rename of two Kconfig variables that were a minor
  misnomer"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/core: Rename CONFIG_[UK]PROBE_EVENT to CONFIG_[UK]PROBE_EVENTS
  kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed

1  2 
arch/x86/kernel/kprobes/core.c

index 6384eb754a58302a18406c3a9587034bbff3c2c3,88b3c942473ded526dcbcb8dcd65d26148a0660e..993fa4fe4f68694a3fa75406b2e762cfadbbf745
@@@ -45,7 -45,6 +45,7 @@@
  #include <linux/slab.h>
  #include <linux/hardirq.h>
  #include <linux/preempt.h>
 +#include <linux/sched/debug.h>
  #include <linux/extable.h>
  #include <linux/kdebug.h>
  #include <linux/kallsyms.h>
@@@ -167,12 -166,12 +167,12 @@@ NOKPROBE_SYMBOL(skip_prefixes)
   * Returns non-zero if opcode is boostable.
   * RIP relative instructions are adjusted at copying time in 64 bits mode
   */
- int can_boost(kprobe_opcode_t *opcodes)
+ int can_boost(kprobe_opcode_t *opcodes, void *addr)
  {
        kprobe_opcode_t opcode;
        kprobe_opcode_t *orig_opcodes = opcodes;
  
-       if (search_exception_tables((unsigned long)opcodes))
+       if (search_exception_tables((unsigned long)addr))
                return 0;       /* Page fault may occur on this address. */
  
  retry:
@@@ -417,7 -416,7 +417,7 @@@ static int arch_copy_kprobe(struct kpro
         * __copy_instruction can modify the displacement of the instruction,
         * but it doesn't affect boostable check.
         */
-       if (can_boost(p->ainsn.insn))
+       if (can_boost(p->ainsn.insn, p->addr))
                p->ainsn.boostable = 0;
        else
                p->ainsn.boostable = -1;