diff options
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index ca989158e847..3bb2be1649bd 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -8,12 +8,15 @@ | |||
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> |
19 | #include <asm/ds.h> | ||
17 | 20 | ||
18 | unsigned long idle_halt; | 21 | unsigned long idle_halt; |
19 | EXPORT_SYMBOL(idle_halt); | 22 | EXPORT_SYMBOL(idle_halt); |
@@ -45,6 +48,8 @@ void free_thread_xstate(struct task_struct *tsk) | |||
45 | kmem_cache_free(task_xstate_cachep, tsk->thread.xstate); | 48 | kmem_cache_free(task_xstate_cachep, tsk->thread.xstate); |
46 | tsk->thread.xstate = NULL; | 49 | tsk->thread.xstate = NULL; |
47 | } | 50 | } |
51 | |||
52 | WARN(tsk->thread.ds_ctx, "leaking DS context\n"); | ||
48 | } | 53 | } |
49 | 54 | ||
50 | void free_thread_info(struct thread_info *ti) | 55 | void free_thread_info(struct thread_info *ti) |
@@ -83,8 +88,6 @@ void exit_thread(void) | |||
83 | put_cpu(); | 88 | put_cpu(); |
84 | kfree(bp); | 89 | kfree(bp); |
85 | } | 90 | } |
86 | |||
87 | ds_exit_thread(current); | ||
88 | } | 91 | } |
89 | 92 | ||
90 | void flush_thread(void) | 93 | void flush_thread(void) |
@@ -613,3 +616,16 @@ static int __init idle_setup(char *str) | |||
613 | } | 616 | } |
614 | early_param("idle", idle_setup); | 617 | early_param("idle", idle_setup); |
615 | 618 | ||
619 | unsigned long arch_align_stack(unsigned long sp) | ||
620 | { | ||
621 | if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) | ||
622 | sp -= get_random_int() % 8192; | ||
623 | return sp & ~0xf; | ||
624 | } | ||
625 | |||
626 | unsigned long arch_randomize_brk(struct mm_struct *mm) | ||
627 | { | ||
628 | unsigned long range_end = mm->brk + 0x02000000; | ||
629 | return randomize_range(mm->brk, range_end, 0) ? : mm->brk; | ||
630 | } | ||
631 | |||