mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 21:40:54 +07:00
[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
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user