X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;ds=sidebyside;f=arch%2Fx86%2Fkernel%2Fprocess.c;h=3bb2be1649bddb5b3ba9870553b72ce73e41b460;hb=862366118026a358882eefc70238dbcc3db37aac;hp=fb5dfb891f0fb6b31c968ec01e4c704aabf8c38e;hpb=511b01bdf64ad8a38414096eab283c7784aebfc4;p=safe%2Fjmp%2Flinux-2.6 diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index fb5dfb8..3bb2be1 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -8,9 +8,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -614,3 +616,16 @@ static int __init idle_setup(char *str) } early_param("idle", idle_setup); +unsigned long arch_align_stack(unsigned long sp) +{ + if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) + sp -= get_random_int() % 8192; + return sp & ~0xf; +} + +unsigned long arch_randomize_brk(struct mm_struct *mm) +{ + unsigned long range_end = mm->brk + 0x02000000; + return randomize_range(mm->brk, range_end, 0) ? : mm->brk; +} +