提交 d62c9ced 编写于 作者: D David Daney 提交者: Ralf Baechle

MIPS: compat: Don't clobber personality bits in 32-bit sys_personality().

If PER_LINUX32 has been set on a 32-bit kernel, only twiddle with the
low-order personality bits, let the upper bits pass through.
Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Cc: Camm Maguire <camm@maguirefamily.org>
Patchwork: https://patchwork.linux-mips.org/patch/1751/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 1c0d52b9
...@@ -251,14 +251,15 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz, ...@@ -251,14 +251,15 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
SYSCALL_DEFINE1(32_personality, unsigned long, personality) SYSCALL_DEFINE1(32_personality, unsigned long, personality)
{ {
unsigned int p = personality & 0xffffffff;
int ret; int ret;
personality &= 0xffffffff;
if (personality(current->personality) == PER_LINUX32 && if (personality(current->personality) == PER_LINUX32 &&
personality == PER_LINUX) personality(p) == PER_LINUX)
personality = PER_LINUX32; p = (p & ~PER_MASK) | PER_LINUX32;
ret = sys_personality(personality); ret = sys_personality(p);
if (ret == PER_LINUX32) if (ret != -1 && personality(ret) == PER_LINUX32)
ret = PER_LINUX; ret = (ret & ~PER_MASK) | PER_LINUX;
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册