[MIPS] Fix O32 personality(2) call with 0xffffffff argument.
authorThiemo Seufer <ths@networkno.de>
Sat, 12 Aug 2006 23:53:29 +0000 (00:53 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 19 Oct 2006 16:55:13 +0000 (17:55 +0100)
A sign extension bug did result in sys_personality being invoked with a
0xffffffffffffffffUL argument, so querying the current personality didn't
work.

Signed-off-by: Thiemo Seufer <ths@networkno.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/linux32.c

index 53f4171fc188a9695eb094b6a4ddda7977af349c..7a3ebbeba1f3aa036fd583e7472aa838595b10aa 100644 (file)
@@ -1055,7 +1055,9 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name)
 asmlinkage int sys32_personality(unsigned long personality)
 {
        int ret;
-       if (current->personality == PER_LINUX32 && personality == PER_LINUX)
+       personality &= 0xffffffff;
+       if (personality(current->personality) == PER_LINUX32 &&
+           personality == PER_LINUX)
                personality = PER_LINUX32;
        ret = sys_personality(personality);
        if (ret == PER_LINUX32)