On 5/5/20 3:16 PM, Thomas Gleixner wrote:
Make sure task_work runs before any kind of userspace -- very much
including signals -- is invoked.

Suggested-by: Andy Lutomirski <l...@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <pet...@infradead.org>
Signed-off-by: Thomas Gleixner <t...@linutronix.de>
---
  arch/x86/entry/common.c |    8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Alexandre Chartre <alexandre.char...@oracle.com>

alex.

--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -156,16 +156,16 @@ static void exit_to_usermode_loop(struct
                if (cached_flags & _TIF_PATCH_PENDING)
                        klp_update_patch_state(current);
- /* deal with pending signal delivery */
-               if (cached_flags & _TIF_SIGPENDING)
-                       do_signal(regs);
-
                if (cached_flags & _TIF_NOTIFY_RESUME) {
                        clear_thread_flag(TIF_NOTIFY_RESUME);
                        tracehook_notify_resume(regs);
                        rseq_handle_notify_resume(NULL, regs);
                }
+ /* deal with pending signal delivery */
+               if (cached_flags & _TIF_SIGPENDING)
+                       do_signal(regs);
+
                if (cached_flags & _TIF_USER_RETURN_NOTIFY)
                        fire_user_return_notifiers();

Reply via email to