[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>
This commit is contained in:
parent
91b165c059
commit
8f80e9466e
1 changed files with 2 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include "linux/proc_fs.h"
|
#include "linux/proc_fs.h"
|
||||||
#include "linux/ptrace.h"
|
#include "linux/ptrace.h"
|
||||||
#include "linux/random.h"
|
#include "linux/random.h"
|
||||||
|
#include "linux/personality.h"
|
||||||
#include "asm/unistd.h"
|
#include "asm/unistd.h"
|
||||||
#include "asm/mman.h"
|
#include "asm/mman.h"
|
||||||
#include "asm/segment.h"
|
#include "asm/segment.h"
|
||||||
|
@ -476,7 +477,7 @@ int singlestepping(void * t)
|
||||||
#ifndef arch_align_stack
|
#ifndef arch_align_stack
|
||||||
unsigned long arch_align_stack(unsigned long sp)
|
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;
|
sp -= get_random_int() % 8192;
|
||||||
return sp & ~0xf;
|
return sp & ~0xf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue