uprobes/x86: Don't use arch_uprobe_abort_xol() in arch_uprobe_post_xol()
authorOleg Nesterov <oleg@redhat.com>
Mon, 21 Apr 2014 16:28:02 +0000 (18:28 +0200)
committerOleg Nesterov <oleg@redhat.com>
Wed, 30 Apr 2014 17:10:37 +0000 (19:10 +0200)
commit6ded5f3848bfd3227ee208aa38f8bf8d7209d4e3
treebb62c3b9f2b4a2be01581d9563df31bafb510f3b
parent588fbd613c3d8fa73e96720761d49f1d40d34d4c
uprobes/x86: Don't use arch_uprobe_abort_xol() in arch_uprobe_post_xol()

014940bad8e4 "uprobes/x86: Send SIGILL if arch_uprobe_post_xol() fails"
changed arch_uprobe_post_xol() to use arch_uprobe_abort_xol() if ->post_xol
fails. This was correct and helped to avoid the additional complications,
we need to clear X86_EFLAGS_TF in this case.

However, now that we have uprobe_xol_ops->abort() hook it would be better
to avoid arch_uprobe_abort_xol() here. ->post_xol() should likely do what
->abort() does anyway, we should not do the same work twice. Currently only
handle_riprel_post_xol() can be called twice, this is unnecessary but safe.
Still this is not clean and can lead to the problems in future.

Change arch_uprobe_post_xol() to clear X86_EFLAGS_TF and restore ->ip by
hand and avoid arch_uprobe_abort_xol(). This temporary uglifies the usage
of autask.saved_tf, we will cleanup this later.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Jim Keniston <jkenisto@us.ibm.com>
arch/x86/kernel/uprobes.c