powerpc/stackprotector: work around stack-guard init from atomic
BugLink: https://bugs.launchpad.net/bugs/2060704 This is invoked from the secondary CPU in atomic context. On x86 we use tsc instead. On Power we XOR it against mftb() so lets use stack address as the initial value. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Kevin Becker <kevin.becker@canonical.com>
This commit is contained in:
committed by
Kevin Becker
parent
954447fb48
commit
b34005aafa
@@ -19,8 +19,13 @@
|
||||
*/
|
||||
static __always_inline void boot_init_stack_canary(void)
|
||||
{
|
||||
unsigned long canary = get_random_canary();
|
||||
unsigned long canary;
|
||||
|
||||
#ifndef CONFIG_PREEMPT_RT
|
||||
canary = get_random_canary();
|
||||
#else
|
||||
canary = ((unsigned long)&canary) & CANARY_MASK;
|
||||
#endif
|
||||
current->stack_canary = canary;
|
||||
#ifdef CONFIG_PPC64
|
||||
get_paca()->canary = canary;
|
||||
|
||||
Reference in New Issue
Block a user