linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] [PATCH 4/7] UML - Fix stack alignment
@ 2006-07-28  3:06 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2006-07-28  3:06 UTC (permalink / raw)
  To: akpm; +Cc: Frank van Maarseveen, linux-kernel, user-mode-linux-devel

Stack randomization needs to be conditional on the personality allowing it.

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: linux-2.6.17/arch/um/kernel/process_kern.c
===================================================================
--- linux-2.6.17.orig/arch/um/kernel/process_kern.c	2006-06-17 21:49:35.000000000 -0400
+++ linux-2.6.17/arch/um/kernel/process_kern.c	2006-07-13 15:05:02.000000000 -0400
@@ -23,6 +23,7 @@
 #include "linux/proc_fs.h"
 #include "linux/ptrace.h"
 #include "linux/random.h"
+#include "linux/personality.h"
 #include "asm/unistd.h"
 #include "asm/mman.h"
 #include "asm/segment.h"
@@ -476,7 +477,7 @@ int singlestepping(void * t)
 #ifndef arch_align_stack
 unsigned long arch_align_stack(unsigned long sp)
 {
-	if (randomize_va_space)
+	if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
 		sp -= get_random_int() % 8192;
 	return sp & ~0xf;
 }


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-28  3:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-28  3:06 [uml-devel] [PATCH 4/7] UML - Fix stack alignment Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox