linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] uprobes: longjmp fixes
@ 2015-05-04 12:48 Oleg Nesterov
  2015-05-04 12:48 ` [PATCH 01/10] uprobes: Introduce get_uprobe() Oleg Nesterov
                   ` (9 more replies)
  0 siblings, 10 replies; 29+ messages in thread
From: Oleg Nesterov @ 2015-05-04 12:48 UTC (permalink / raw)
  To: Ananth N Mavinakayanahalli, Anton Arapov, David Long,
	Denys Vlasenko, Frank Ch. Eigler, Ingo Molnar, Jan Willeke,
	Jim Keniston, Mark Wielaard, Pratyush Anand, Srikar Dronamraju
  Cc: linux-kernel

Hello.

Currently ret-probes can't work (the application will likely crash)
if the probed function does not return, and this is even documented
in handle_trampoline().

This series tries to make the first step to fix the problem on x86:
it assumes that the probed functions use the same stack.

TODO: sigaltstack() can obviously break this assumption.

NOTE: I don't think it is possible to make this logic 100% correct,
the user-space can do everything with its stack. For example, the
application can do longjmp-like tricks to implement the coroutines,
the kernel can do nothing in this case. The application (or debugger)
should cooperate somehow to let the kernel know whats going on.

Jan, David, Pratyush, Ananth, do you think your architecure can reuse
the hacks/hooks added by this series and do something like x86 does?
If not, we will probably need "plan B" mentioned in 08/10, but I'd
like to avoid this if possible. Or any other thoughts?

Oleg.

 arch/arm/include/asm/uprobes.h     |    3 +
 arch/arm/probes/uprobes/core.c     |    3 +-
 arch/powerpc/include/asm/uprobes.h |    3 +
 arch/powerpc/kernel/uprobes.c      |    3 +-
 arch/s390/include/asm/uprobes.h    |    3 +
 arch/s390/kernel/uprobes.c         |    3 +-
 arch/x86/include/asm/uprobes.h     |    4 +
 arch/x86/kernel/uprobes.c          |   15 +++-
 include/linux/uprobes.h            |    5 +-
 kernel/events/uprobes.c            |  170 +++++++++++++++++++++---------------
 10 files changed, 136 insertions(+), 76 deletions(-)


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-06-05 21:41 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04 12:48 [PATCH 00/10] uprobes: longjmp fixes Oleg Nesterov
2015-05-04 12:48 ` [PATCH 01/10] uprobes: Introduce get_uprobe() Oleg Nesterov
2015-05-06 13:20   ` Srikar Dronamraju
2015-05-04 12:48 ` [PATCH 02/10] uprobes: Introduce free_ret_instance() Oleg Nesterov
2015-05-06 13:22   ` Srikar Dronamraju
2015-05-04 12:48 ` [PATCH 03/10] uprobes: Send SIGILL if handle_trampoline() fails Oleg Nesterov
2015-05-06 13:30   ` Srikar Dronamraju
2015-05-04 12:49 ` [PATCH 04/10] uprobes: Change prepare_uretprobe() to use uprobe_warn() Oleg Nesterov
2015-05-07 10:32   ` Srikar Dronamraju
2015-05-04 12:49 ` [PATCH 05/10] uprobes: Change handle_trampoline() to find the next chain beforehand Oleg Nesterov
2015-05-07 10:33   ` Srikar Dronamraju
2015-05-04 12:49 ` [PATCH 06/10] uprobes: Introduce struct arch_uretprobe Oleg Nesterov
2015-05-07 10:34   ` Srikar Dronamraju
2015-05-04 12:49 ` [PATCH 07/10] uprobes/x86: Introduce arch_uretprobe_is_alive() Oleg Nesterov
2015-05-07 10:35   ` Srikar Dronamraju
2015-05-07 11:08   ` Srikar Dronamraju
2015-05-07 17:11     ` Oleg Nesterov
2015-05-08 11:30       ` Srikar Dronamraju
2015-05-10 12:21         ` Oleg Nesterov
2015-05-13  8:11           ` Srikar Dronamraju
2015-05-20 16:51             ` Oleg Nesterov
2015-05-18 12:08   ` Pratyush Anand
2015-05-20 15:51     ` Oleg Nesterov
2015-05-04 12:49 ` [PATCH 08/10] uprobes: Change handle_trampoline() to flush the frames invalidated by longjmp() Oleg Nesterov
2015-05-07 10:38   ` Srikar Dronamraju
2015-05-04 12:49 ` [PATCH 09/10] uprobes: Change prepare_uretprobe() to (try to) flush the dead frames Oleg Nesterov
2015-05-07 11:19   ` Srikar Dronamraju
2015-06-05 21:40   ` Oleg Nesterov
2015-05-04 12:49 ` [PATCH 10/10] uprobes/x86: Change arch_uretprobe_is_alive() to take !chained into account Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).