lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMzpN2j=Nb25x6UQqa6r3UbWgrrhoRb-72U+zOFVA7RrqQ0Z3A@mail.gmail.com>
Date:	Sat, 27 Feb 2016 15:29:39 -0500
From:	Brian Gerst <brgerst@...il.com>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Peter Anvin <hpa@...or.com>, Oleg Nesterov <oleg@...hat.com>,
	linux-arch@...r.kernel.org, Tejun Heo <tj@...nel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Paul McKenney <paulmck@...ux.vnet.ibm.com>,
	Rafael Wysocki <rafael.j.wysocki@...el.com>,
	Arjan van de Ven <arjan@...ux.intel.com>,
	Rik van Riel <riel@...hat.com>,
	"Srivatsa S. Bhat" <srivatsa@....edu>,
	Sebastian Siewior <bigeasy@...utronix.de>,
	Paul Turner <pjt@...gle.com>
Subject: Re: [patch 01/20] idle: Move x86ism out of generic code

On Fri, Feb 26, 2016 at 1:43 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
> We have an arch specific callback here already.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
>  arch/x86/kernel/process.c |   12 ++++++++++++
>  kernel/sched/idle.c       |   15 ---------------
>  2 files changed, 12 insertions(+), 15 deletions(-)
>
> Index: b/arch/x86/kernel/process.c
> ===================================================================
> --- a/arch/x86/kernel/process.c
> +++ b/arch/x86/kernel/process.c
> @@ -271,6 +271,18 @@ void exit_idle(void)
>  }
>  #endif
>
> +void arch_cpu_idle_prepare(void)
> +{
> +       /*
> +        * If we're the non-boot CPU, nothing set the stack canary up
> +        * for us. The boot CPU already has it initialized but no harm
> +        * in doing it again. 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).
> +        */
> +       boot_init_stack_canary();
> +}
> +
>  void arch_cpu_idle_enter(void)
>  {
>         local_touch_nmi();
> Index: b/kernel/sched/idle.c
> ===================================================================
> --- a/kernel/sched/idle.c
> +++ b/kernel/sched/idle.c
> @@ -275,21 +275,6 @@ static void cpu_idle_loop(void)
>
>  void cpu_startup_entry(enum cpuhp_state state)
>  {
> -       /*
> -        * This #ifdef needs to die, but it's too late in the cycle to
> -        * make this generic (arm and sh have never invoked the canary
> -        * init for the non boot cpus!). Will be fixed in 3.11
> -        */
> -#ifdef CONFIG_X86
> -       /*
> -        * If we're the non-boot CPU, nothing set the stack canary up
> -        * for us. The boot CPU already has it initialized but no harm
> -        * in doing it again. 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).
> -        */
> -       boot_init_stack_canary();
> -#endif
>         arch_cpu_idle_prepare();
>         cpu_idle_loop();
>  }

Does this actually work with stack protector enabled?
boot_init_stack_canary() is inlined while arch_cpu_idle_prepare() is
not.

--
Brian Gerst

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ