aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-19 12:36:09 +0100
committerIngo Molnar <mingo@elte.hu>2009-01-19 12:36:09 +0100
commit7890ba8c87604ca4c2c73f7de846bf5305d743e4 (patch)
treef3f920c09b8de694b1bc1d4b878cfd2b0b98c913 /kernel/fork.c
parent99937d6455cea95405ac681c86a857d0fcd530bd (diff)
parentb2b062b8163391c42b3219d466ca1ac9742b9c7b (diff)
downloadkernel_replicant_linux-7890ba8c87604ca4c2c73f7de846bf5305d743e4.tar.gz
kernel_replicant_linux-7890ba8c87604ca4c2c73f7de846bf5305d743e4.tar.bz2
kernel_replicant_linux-7890ba8c87604ca4c2c73f7de846bf5305d743e4.zip
Merge branch 'stackprotector' into core/percpu
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 1d68f1255dd8..4a9b318dad0d 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -61,6 +61,7 @@
#include <linux/proc_fs.h>
#include <linux/blkdev.h>
#include <trace/sched.h>
+#include <linux/magic.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
@@ -212,6 +213,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
{
struct task_struct *tsk;
struct thread_info *ti;
+ unsigned long *stackend;
+
int err;
prepare_to_copy(orig);
@@ -237,6 +240,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
goto out;
setup_thread_stack(tsk, orig);
+ stackend = end_of_stack(tsk);
+ *stackend = STACK_END_MAGIC; /* for overflow detection */
#ifdef CONFIG_CC_STACKPROTECTOR
tsk->stack_canary = get_random_int();