Skip to content

Commit

Permalink
x86: fix the stackprotector canary of the boot CPU
Browse files Browse the repository at this point in the history
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Ingo Molnar authored and Thomas Gleixner committed May 26, 2008
1 parent 18aa8bb commit 4205942
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <stdarg.h>

#include <linux/stackprotector.h>
#include <linux/cpu.h>
#include <linux/errno.h>
#include <linux/sched.h>
Expand Down
4 changes: 4 additions & 0 deletions include/linux/stackprotector.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef _LINUX_STACKPROTECTOR_H
#define _LINUX_STACKPROTECTOR_H 1

#include <linux/compiler.h>
#include <linux/sched.h>
#include <linux/random.h>

#ifdef CONFIG_CC_STACKPROTECTOR
# include <asm/stackprotector.h>
#else
Expand Down
6 changes: 6 additions & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,12 @@ asmlinkage void __init start_kernel(void)
unwind_init();
lockdep_init();
debug_objects_early_init();

/*
* Set up the the initial canary ASAP:
*/
boot_init_stack_canary();

cgroup_init_early();

local_irq_disable();
Expand Down

0 comments on commit 4205942

Please sign in to comment.