linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* ppc32: Don't clobber personality flags on exec
@ 2009-04-16 16:22 Andreas Schwab
  2009-04-16 23:17 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2009-04-16 16:22 UTC (permalink / raw)
  To: linuxppc-dev

Now that ppc32 implements address randomization it also wants to inherit
personality flags like ADDR_NO_RANDOMIZE across exec, for things like
`setarch ppc -R' to work.  But the ppc32 version of SET_PERSONALITY
forcefully sets PER_LINUX, clearing all personality flags.  So be
careful about preserving the flags.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>

---
 arch/powerpc/include/asm/elf.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.30-rc1/arch/powerpc/include/asm/elf.h
===================================================================
--- linux-2.6.30-rc1.orig/arch/powerpc/include/asm/elf.h	2009-04-08 12:45:56.000000000 +0200
+++ linux-2.6.30-rc1/arch/powerpc/include/asm/elf.h	2009-04-12 14:24:06.000000000 +0200
@@ -258,7 +258,8 @@ do {								\
 # define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \
 		(exec_stk != EXSTACK_DISABLE_X) : 0)
 #else 
-# define SET_PERSONALITY(ex) set_personality(PER_LINUX)
+# define SET_PERSONALITY(ex) \
+  set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 #endif /* __powerpc64__ */
 
 extern int dcache_bsize;

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ppc32: Don't clobber personality flags on exec
  2009-04-16 16:22 ppc32: Don't clobber personality flags on exec Andreas Schwab
@ 2009-04-16 23:17 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-04-16 23:17 UTC (permalink / raw)
  To: schwab; +Cc: linuxppc-dev

From: Andreas Schwab <schwab@linux-m68k.org>
Date: Thu, 16 Apr 2009 18:22:01 +0200

> Now that ppc32 implements address randomization it also wants to inherit
> personality flags like ADDR_NO_RANDOMIZE across exec, for things like
> `setarch ppc -R' to work.  But the ppc32 version of SET_PERSONALITY
> forcefully sets PER_LINUX, clearing all personality flags.  So be
> careful about preserving the flags.
> 
> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>

Grumble, sparc has the same bugs...  thanks for finding this.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-16 23:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-16 16:22 ppc32: Don't clobber personality flags on exec Andreas Schwab
2009-04-16 23:17 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).