]> granicus.if.org Git - strace/commitdiff
syscall.c: always update tcp->currpers in update_personality
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 15 Jan 2018 17:55:48 +0000 (18:55 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 16 Jan 2018 22:54:38 +0000 (22:54 +0000)
Sometimes (for example, switching from a process with one personality
to a process that previously had different personality but returning
from execve to that same personality into) it is possible that
current_personality is not changed, but tcp->currpers is different.
So, let's not return from update_personality and always update
tcp->currpers if it differs from the target personality.

* syscall.c (update_personality): Do not exit early if personality ==
current_personality.

syscall.c

index ee479721f112a39afe2167e561f242f832827110..c9155845a33988aed585cbfbbcc1916a7eacd61c 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -306,9 +306,8 @@ update_personality(struct tcb *tcp, unsigned int personality)
        static bool need_mpers_warning[] =
                { false, !HAVE_PERSONALITY_1_MPERS, !HAVE_PERSONALITY_2_MPERS };
 
-       if (personality == current_personality)
-               return;
-       set_personality(personality);
+       if (personality != current_personality)
+               set_personality(personality);
 
        if (personality == tcp->currpers)
                return;