mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] Add the canary field to the PDA area and the task struct
This patch adds the per thread cookie field to the task struct and the PDA. Also it makes sure that the PDA value gets the new cookie value at context switch, and that a new task gets a new cookie at task creation time. Signed-off-by: Arjan van Ven <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Andi Kleen <[email protected]> CC: Andi Kleen <[email protected]>
This commit is contained in:
parent
b62a5c740d
commit
0a42540580
4 changed files with 24 additions and 1 deletions
|
|
@ -45,6 +45,7 @@
|
|||
#include <linux/cn_proc.h>
|
||||
#include <linux/delayacct.h>
|
||||
#include <linux/taskstats_kern.h>
|
||||
#include <linux/random.h>
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/pgalloc.h>
|
||||
|
|
@ -175,6 +176,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
|
|||
tsk->thread_info = ti;
|
||||
setup_thread_stack(tsk, orig);
|
||||
|
||||
#ifdef CONFIG_CC_STACKPROTECTOR
|
||||
tsk->stack_canary = get_random_int();
|
||||
#endif
|
||||
|
||||
/* One for us, one for whoever does the "release_task()" (usually parent) */
|
||||
atomic_set(&tsk->usage,2);
|
||||
atomic_set(&tsk->fs_excl, 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue