Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Andy Lutomirski and committed by
Linus Torvalds
82975bc6 90e362f4

+1 -2
+1 -1
arch/x86/include/asm/thread_info.h
··· 141 141 /* Only used for 64 bit */ 142 142 #define _TIF_DO_NOTIFY_MASK \ 143 143 (_TIF_SIGPENDING | _TIF_MCE_NOTIFY | _TIF_NOTIFY_RESUME | \ 144 - _TIF_USER_RETURN_NOTIFY) 144 + _TIF_USER_RETURN_NOTIFY | _TIF_UPROBE) 145 145 146 146 /* flags to check in __switch_to() */ 147 147 #define _TIF_WORK_CTXSW \
-1
kernel/events/uprobes.c
··· 1640 1640 if (__fatal_signal_pending(t) || arch_uprobe_xol_was_trapped(t)) { 1641 1641 utask->state = UTASK_SSTEP_TRAPPED; 1642 1642 set_tsk_thread_flag(t, TIF_UPROBE); 1643 - set_tsk_thread_flag(t, TIF_NOTIFY_RESUME); 1644 1643 } 1645 1644 } 1646 1645