summaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-09-26 08:33:01 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 17:49:05 +0200
commit8f80e9466e18288df7391c9d21532c4125ac9c62 (patch)
tree2895ff7fc1414c9c92a92abbed6a28c7e3de38b3 /arch/um
parent[PATCH] uml: Use ARRAY_SIZE more assiduously (diff)
downloadlinux-8f80e9466e18288df7391c9d21532c4125ac9c62.tar.xz
linux-8f80e9466e18288df7391c9d21532c4125ac9c62.zip
[PATCH] uml: Fix stack alignment
Stack randomization needs to be conditional on the personality allowing it. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/kernel/process_kern.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
index f6a5a502120b..537895d68ad1 100644
--- a/arch/um/kernel/process_kern.c
+++ b/arch/um/kernel/process_kern.c
@@ -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;
}