diff options
author | Jiri Kosina <jkosina@suse.cz> | 2012-08-02 15:33:59 +0200 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-08-03 12:25:12 +0200 |
commit | 5b24c421621792fcc588af6f644d6acf2dd798cc (patch) | |
tree | bc89e67b20c47a8bacde1b82d087054e941aee24 /arch/parisc/kernel/sys_parisc.c | |
parent | [PARISC] Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts (diff) | |
download | linux-5b24c421621792fcc588af6f644d6acf2dd798cc.tar.xz linux-5b24c421621792fcc588af6f644d6acf2dd798cc.zip |
[PARISC] fix personality flag check in copy_thread()
Directly comparing task_struct->personality against PER_* is not fully
correct, as it doesn't take flags potentially stored in top three bytes
into account.
Analogically, directly forcefully setting personality to PER_LINUX32 or
PER_LINUX discards any flags stored in the top three bytes.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'arch/parisc/kernel/sys_parisc.c')
-rw-r--r-- | arch/parisc/kernel/sys_parisc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index c9b932260f47..7426e40699bd 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c @@ -225,12 +225,12 @@ long parisc_personality(unsigned long personality) long err; if (personality(current->personality) == PER_LINUX32 - && personality == PER_LINUX) - personality = PER_LINUX32; + && personality(personality) == PER_LINUX) + personality = (personality & ~PER_MASK) | PER_LINUX32; err = sys_personality(personality); - if (err == PER_LINUX32) - err = PER_LINUX; + if (personality(err) == PER_LINUX32) + err = (err & ~PER_MASK) | PER_LINUX; return err; } |