lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 23 Feb 2008 16:14:14 +0800
From:	WANG Cong <xiyou.wangcong@...il.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	WANG Cong <xiyou.wangcong@...il.com>,
	Ralf Baechle <ralf@...ux-mips.org>
Subject: [PATCH 11/16] mips: use get_personality()

Use get_personality() macro instead of explicit reference
for mips code.

Signed-off-by: WANG Cong <xiyou.wangcong@...il.com>
Cc:  Ralf Baechle <ralf@...ux-mips.org>

---
 arch/mips/kernel/linux32.c |    4 ++--
 arch/mips/kernel/process.c |    4 ++--
 include/asm-mips/elf.h     |    2 +-
 include/asm-mips/namei.h   |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 65af3cc..e5b7671 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -446,7 +446,7 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name)
 		ret = -EFAULT;
 	up_read(&uts_sem);
 
-	if (current->personality == PER_LINUX32 && !ret)
+	if (get_personality() == PER_LINUX32 && !ret)
 		if (copy_to_user(name->machine, "mips\0\0\0", 8))
 			ret = -EFAULT;
 
@@ -457,7 +457,7 @@ asmlinkage int sys32_personality(unsigned long personality)
 {
 	int ret;
 	personality &= 0xffffffff;
-	if (personality(current->personality) == PER_LINUX32 &&
+	if (personality(get_personality()) == PER_LINUX32 &&
 	    personality == PER_LINUX)
 		personality = PER_LINUX32;
 	ret = sys_personality(personality);
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 2c09a44..dc7486c 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -126,7 +126,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
 	childregs->regs[7] = 0;	/* Clear error flag */
 
 #if defined(CONFIG_BINFMT_IRIX)
-	if (current->personality != PER_LINUX) {
+	if (get_personality() != PER_LINUX) {
 		/* Under IRIX things are a little different. */
 		childregs->regs[3] = 1;
 		regs->regs[3] = 0;
@@ -471,7 +471,7 @@ out:
  */
 unsigned long arch_align_stack(unsigned long sp)
 {
-	if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
+	if (!(get_personality() & ADDR_NO_RANDOMIZE) && randomize_va_space)
 		sp -= get_random_int() & ~PAGE_MASK;
 
 	return sp & ALMASK;
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index f69f7ac..c07f464 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -308,7 +308,7 @@ do {									\
 									\
 	if (ibcs2)							\
 		set_personality(PER_SVR4);				\
-	else if (current->personality != PER_LINUX32)			\
+	else if (get_personality() != PER_LINUX32)			\
 		set_personality(PER_LINUX);				\
 } while (0)
 
diff --git a/include/asm-mips/namei.h b/include/asm-mips/namei.h
index c94d12d..18ab9eb 100644
--- a/include/asm-mips/namei.h
+++ b/include/asm-mips/namei.h
@@ -9,7 +9,7 @@
 
 static inline char *__emul_prefix(void)
 {
-	switch (current->personality) {
+	switch (get_personality()) {
 	case PER_IRIX32:
 	case PER_IRIXN32:
 	case PER_IRIX64:
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists