aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r--arch/x86/kernel/process.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 19a686c401b..fc6e4b773fc 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -8,9 +8,11 @@
8#include <linux/module.h> 8#include <linux/module.h>
9#include <linux/pm.h> 9#include <linux/pm.h>
10#include <linux/clockchips.h> 10#include <linux/clockchips.h>
11#include <linux/random.h>
11#include <trace/power.h> 12#include <trace/power.h>
12#include <asm/system.h> 13#include <asm/system.h>
13#include <asm/apic.h> 14#include <asm/apic.h>
15#include <asm/syscalls.h>
14#include <asm/idle.h> 16#include <asm/idle.h>
15#include <asm/uaccess.h> 17#include <asm/uaccess.h>
16#include <asm/i387.h> 18#include <asm/i387.h>
@@ -65,7 +67,7 @@ void arch_task_cache_init(void)
65 task_xstate_cachep = 67 task_xstate_cachep =
66 kmem_cache_create("task_xstate", xstate_size, 68 kmem_cache_create("task_xstate", xstate_size,
67 __alignof__(union thread_xstate), 69 __alignof__(union thread_xstate),
68 SLAB_PANIC, NULL); 70 SLAB_PANIC | SLAB_NOTRACK, NULL);
69} 71}
70 72
71/* 73/*
@@ -604,3 +606,16 @@ static int __init idle_setup(char *str)
604} 606}
605early_param("idle", idle_setup); 607early_param("idle", idle_setup);
606 608
609unsigned long arch_align_stack(unsigned long sp)
610{
611 if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
612 sp -= get_random_int() % 8192;
613 return sp & ~0xf;
614}
615
616unsigned long arch_randomize_brk(struct mm_struct *mm)
617{
618 unsigned long range_end = mm->brk + 0x02000000;
619 return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
620}
621