-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 136447 b: refs/heads/master c: b2b062b h: refs/heads/master i: 136445: 66c732d 136443: ca914d9 136439: f6e037b 136431: 0fdb107 136415: 5a1e7d5 136383: 77a03d9 136319: 88eccf2 136191: f749f04 v: v3
- Loading branch information
Ingo Molnar
committed
Jan 18, 2009
1 parent
c56a98c
commit bca31b9
Showing
18 changed files
with
135 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 99937d6455cea95405ac681c86a857d0fcd530bd | ||
refs/heads/master: b2b062b8163391c42b3219d466ca1ac9742b9c7b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifndef _ASM_STACKPROTECTOR_H | ||
#define _ASM_STACKPROTECTOR_H 1 | ||
|
||
#include <asm/tsc.h> | ||
#include <asm/pda.h> | ||
|
||
/* | ||
* Initialize the stackprotector canary value. | ||
* | ||
* NOTE: this must only be called from functions that never return, | ||
* and it must always be inlined. | ||
*/ | ||
static __always_inline void boot_init_stack_canary(void) | ||
{ | ||
u64 canary; | ||
u64 tsc; | ||
|
||
/* | ||
* If we're the non-boot CPU, nothing set the PDA stack | ||
* canary up for us - and if we are the boot CPU we have | ||
* a 0 stack canary. This is a good place for updating | ||
* it, as we wont ever return from this function (so the | ||
* invalid canaries already on the stack wont ever | ||
* trigger). | ||
* | ||
* We both use the random pool and the current TSC as a source | ||
* of randomness. The TSC only matters for very early init, | ||
* there it already has some randomness on most systems. Later | ||
* on during the bootup the random pool has true entropy too. | ||
*/ | ||
get_random_bytes(&canary, sizeof(canary)); | ||
tsc = __native_read_tsc(); | ||
canary += tsc + (tsc << 32UL); | ||
|
||
current->stack_canary = canary; | ||
write_pda(stack_canary, canary); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#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 | ||
static inline void boot_init_stack_canary(void) | ||
{ | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters