LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/4] powerpc/stackprotector: work around stack-guard init from atomic
Date: Fri, 10 May 2019 17:46:42 -0400	[thread overview]
Message-ID: <20190510174642.46e357f6@gandalf.local.home> (raw)
In-Reply-To: <20190327183310.1015-2-bigeasy@linutronix.de>

On Wed, 27 Mar 2019 19:33:08 +0100
Sebastian Andrzej Siewior <bigeasy@linutronix.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@linutronix.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;


  reply	other threads:[~2019-05-10 21:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 17:15 [ANNOUNCE] v5.0.3-rt1 Sebastian Andrzej Siewior
2019-03-22 18:52 ` Julien Grall
2019-03-25  8:13   ` John Ogness
2019-03-25 10:18     ` Julien Grall
2019-03-25 10:34       ` John Ogness
2019-03-26 10:26         ` Julien Grall
2019-03-26 16:04           ` John Ogness
2019-03-27 18:33 ` [PATCH 1/4] printk: An all-in-one commit to fix build failures Sebastian Andrzej Siewior
2019-03-27 18:33   ` [PATCH 2/4] powerpc/stackprotector: work around stack-guard init from atomic Sebastian Andrzej Siewior
2019-05-10 21:46     ` Steven Rostedt [this message]
2019-03-27 18:33   ` [PATCH 3/4] powerpc/pseries/iommu: Use a locallock instead local_irq_save() Sebastian Andrzej Siewior
2019-03-27 18:33   ` [PATCH 4/4] powerpc: reshuffle TIF bits Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190510174642.46e357f6@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCH 2/4] powerpc/stackprotector: work around stack-guard init from atomic' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).