diff options
author | Andy Lutomirski <luto@amacapital.net> | 2014-11-21 16:26:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-23 17:25:28 -0500 |
commit | 82975bc6a6df743b9a01810fb32cb65d0ec5d60b (patch) | |
tree | b5a5b092dcd8420d9f72bf66be2e6544a5622040 | |
parent | 90e362f4a75d0911ca75e5cd95591a6cf1f169dc (diff) |
uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME
x86 call do_notify_resume on paranoid returns if TIF_UPROBE is set but
not on non-paranoid returns. I suspect that this is a mistake and that
the code only works because int3 is paranoid.
Setting _TIF_NOTIFY_RESUME in the uprobe code was probably a workaround
for the x86 bug. With that bug fixed, we can remove _TIF_NOTIFY_RESUME
from the uprobes code.
Reported-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/x86/include/asm/thread_info.h | 2 | ||||
-rw-r--r-- | kernel/events/uprobes.c | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index 854053889d4d..547e344a6dc6 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h | |||
@@ -141,7 +141,7 @@ struct thread_info { | |||
141 | /* Only used for 64 bit */ | 141 | /* Only used for 64 bit */ |
142 | #define _TIF_DO_NOTIFY_MASK \ | 142 | #define _TIF_DO_NOTIFY_MASK \ |
143 | (_TIF_SIGPENDING | _TIF_MCE_NOTIFY | _TIF_NOTIFY_RESUME | \ | 143 | (_TIF_SIGPENDING | _TIF_MCE_NOTIFY | _TIF_NOTIFY_RESUME | \ |
144 | _TIF_USER_RETURN_NOTIFY) | 144 | _TIF_USER_RETURN_NOTIFY | _TIF_UPROBE) |
145 | 145 | ||
146 | /* flags to check in __switch_to() */ | 146 | /* flags to check in __switch_to() */ |
147 | #define _TIF_WORK_CTXSW \ | 147 | #define _TIF_WORK_CTXSW \ |
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 1d0af8a2c646..ed8f2cde34c5 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -1640,7 +1640,6 @@ bool uprobe_deny_signal(void) | |||
1640 | if (__fatal_signal_pending(t) || arch_uprobe_xol_was_trapped(t)) { | 1640 | if (__fatal_signal_pending(t) || arch_uprobe_xol_was_trapped(t)) { |
1641 | utask->state = UTASK_SSTEP_TRAPPED; | 1641 | utask->state = UTASK_SSTEP_TRAPPED; |
1642 | set_tsk_thread_flag(t, TIF_UPROBE); | 1642 | set_tsk_thread_flag(t, TIF_UPROBE); |
1643 | set_tsk_thread_flag(t, TIF_NOTIFY_RESUME); | ||
1644 | } | 1643 | } |
1645 | } | 1644 | } |
1646 | 1645 | ||