aboutsummaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-03-23 14:50:03 +0100
committerThomas Gleixner <tglx@linutronix.de>2009-03-23 21:20:20 +0100
commit80c5520811d3805adcb15c570ea5e2d489fa5d0b (patch)
treeae797a7f4af39f80e77526533d06ac23b439f0ab /kernel/fork.c
parentb3e3b302cf6dc8d60b67f0e84d1fa5648889c038 (diff)
parent8c083f081d0014057901c68a0a3e0f8ca7ac8d23 (diff)
Merge branch 'cpus4096' into irq/threaded
Conflicts: arch/parisc/kernel/irq.c kernel/irq/handle.c Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
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 4854c2c4a82..6715ebc3761 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();