[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190510174642.46e357f6@gandalf.local.home>
Date: Fri, 10 May 2019 17:46:42 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
linux-rt-users <linux-rt-users@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 2/4] powerpc/stackprotector: work around stack-guard
init from atomic
On Wed, 27 Mar 2019 19:33:08 +0100
Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:
> 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.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Hi Sebastian,
in your repo, you marked this as stable-rt, but this code was added in
4.20, and the next -rt is at 4.19.
-- Steve
> ---
> arch/powerpc/include/asm/stackprotector.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/powerpc/include/asm/stackprotector.h b/arch/powerpc/include/asm/stackprotector.h
> index 1c8460e235838..e764eb4b6c284 100644
> --- a/arch/powerpc/include/asm/stackprotector.h
> +++ b/arch/powerpc/include/asm/stackprotector.h
> @@ -24,7 +24,11 @@ static __always_inline void boot_init_stack_canary(void)
> unsigned long canary;
>
> /* Try to get a semi random initial value. */
> +#ifdef CONFIG_PREEMPT_RT_FULL
> + canary = (unsigned long)&canary;
> +#else
> canary = get_random_canary();
> +#endif
> canary ^= mftb();
> canary ^= LINUX_VERSION_CODE;
> canary &= CANARY_MASK;
Powered by blists - more mailing lists