uprobes/x86: Reimplement arch_uretprobe_is_alive()
authorOleg Nesterov <[email protected]>
Tue, 21 Jul 2015 13:40:18 +0000 (15:40 +0200)
committerIngo Molnar <[email protected]>
Fri, 31 Jul 2015 08:38:05 +0000 (10:38 +0200)
commit7b868e4802a86d867aad1be0471b5767d9c20e10
treec56275f7bdc1bddbb34b393a1747b7514f77f994
parent97da89767d398c1dfa1f34e5f312eb8ebb382f7f
uprobes/x86: Reimplement arch_uretprobe_is_alive()

Add the x86 specific version of arch_uretprobe_is_alive()
helper. It returns true if the stack frame mangled by
prepare_uretprobe() is still on stack. So if it returns false,
we know that the probed function has already returned.

We add the new return_instance->stack member and change the
generic code to initialize it in prepare_uretprobe, but it
should be equally useful for other architectures.

TODO: this assumes that the probed application can't use
      multiple stacks (say sigaltstack). We will try to improve
      this logic later.

Tested-by: Pratyush Anand <[email protected]>
Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Srikar Dronamraju <[email protected]>
Acked-by: Anton Arapov <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/uprobes.c
include/linux/uprobes.h
kernel/events/uprobes.c