* [PATCH 1/2] x86: initialize stack canary in secondary start
@ 2009-12-17 18:00 Pan, Jacob jun
2009-12-18 16:02 ` Thomas Gleixner
0 siblings, 1 reply; 3+ messages in thread
From: Pan, Jacob jun @ 2009-12-17 18:00 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: x86, linux-kernel
>From 06503838368350268a46528e134c1dad9f4f8c93 Mon Sep 17 00:00:00 2001
From: Jacob Pan <jacob.jun.pan@intel.com>
Date: Thu, 17 Sep 2009 07:36:43 -0700
Subject: [PATCH 1/2] x86: initialize stack canary in secondary start
some secondary clockevent setup code needs to call request_irq, which will
cause fake stack check failure in schedule() if voluntary preemption
model is chosen, it is safe to have stack canary initialized here early,
since start_secondary() does not return.
Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
---
arch/x86/kernel/smpboot.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 678d0b8..56ce974 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -48,6 +48,7 @@
#include <linux/err.h>
#include <linux/nmi.h>
#include <linux/tboot.h>
+#include <linux/stackprotector.h>
#include <asm/acpi.h>
#include <asm/desc.h>
@@ -324,6 +325,9 @@ notrace static void __cpuinit start_secondary(void *unused)
/* enable local interrupts */
local_irq_enable();
+ /* to prevent fake stack check failure in clock setup */
+ boot_init_stack_canary();
+
x86_cpuinit.setup_percpu_clockev();
wmb();
--
1.6.5.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] x86: initialize stack canary in secondary start
2009-12-17 18:00 [PATCH 1/2] x86: initialize stack canary in secondary start Pan, Jacob jun
@ 2009-12-18 16:02 ` Thomas Gleixner
2009-12-18 17:31 ` Pan, Jacob jun
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2009-12-18 16:02 UTC (permalink / raw)
To: Pan, Jacob jun; +Cc: H. Peter Anvin, x86, linux-kernel
On Thu, 17 Dec 2009, Pan, Jacob jun wrote:
> >From 06503838368350268a46528e134c1dad9f4f8c93 Mon Sep 17 00:00:00 2001
> From: Jacob Pan <jacob.jun.pan@intel.com>
> Date: Thu, 17 Sep 2009 07:36:43 -0700
> Subject: [PATCH 1/2] x86: initialize stack canary in secondary start
>
> some secondary clockevent setup code needs to call request_irq, which will
> cause fake stack check failure in schedule() if voluntary preemption
> model is chosen, it is safe to have stack canary initialized here early,
> since start_secondary() does not return.
Where is it initialized now ? Shouldnt the current init be removed ?
Thanks,
tglx
> Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
> ---
> arch/x86/kernel/smpboot.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 678d0b8..56ce974 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -48,6 +48,7 @@
> #include <linux/err.h>
> #include <linux/nmi.h>
> #include <linux/tboot.h>
> +#include <linux/stackprotector.h>
>
> #include <asm/acpi.h>
> #include <asm/desc.h>
> @@ -324,6 +325,9 @@ notrace static void __cpuinit start_secondary(void *unused)
> /* enable local interrupts */
> local_irq_enable();
>
> + /* to prevent fake stack check failure in clock setup */
> + boot_init_stack_canary();
> +
> x86_cpuinit.setup_percpu_clockev();
>
> wmb();
> --
> 1.6.5.3
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH 1/2] x86: initialize stack canary in secondary start
2009-12-18 16:02 ` Thomas Gleixner
@ 2009-12-18 17:31 ` Pan, Jacob jun
0 siblings, 0 replies; 3+ messages in thread
From: Pan, Jacob jun @ 2009-12-18 17:31 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: H. Peter Anvin, x86, linux-kernel
>-----Original Message-----
>From: Thomas Gleixner [mailto:tglx@linutronix.de]
>Sent: Friday, December 18, 2009 8:03 AM
>To: Pan, Jacob jun
>Cc: H. Peter Anvin; x86@kernel.org; linux-kernel@vger.kernel.org
>Subject: Re: [PATCH 1/2] x86: initialize stack canary in secondary start
>
>On Thu, 17 Dec 2009, Pan, Jacob jun wrote:
>> >From 06503838368350268a46528e134c1dad9f4f8c93 Mon Sep 17 00:00:00 2001
>> From: Jacob Pan <jacob.jun.pan@intel.com>
>> Date: Thu, 17 Sep 2009 07:36:43 -0700
>> Subject: [PATCH 1/2] x86: initialize stack canary in secondary start
>>
>> some secondary clockevent setup code needs to call request_irq, which will
>> cause fake stack check failure in schedule() if voluntary preemption
>> model is chosen, it is safe to have stack canary initialized here early,
>> since start_secondary() does not return.
>
>Where is it initialized now ? Shouldnt the current init be removed ?
>
[[JPAN]] it is currently in cpu_idle(), i don't think it can be removed since
there are other path calling it. calling boot_init_stack_canary() is redundant
in some case but harmless.
>Thanks,
>
> tglx
>
>> Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
>> ---
>> arch/x86/kernel/smpboot.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
>> index 678d0b8..56ce974 100644
>> --- a/arch/x86/kernel/smpboot.c
>> +++ b/arch/x86/kernel/smpboot.c
>> @@ -48,6 +48,7 @@
>> #include <linux/err.h>
>> #include <linux/nmi.h>
>> #include <linux/tboot.h>
>> +#include <linux/stackprotector.h>
>>
>> #include <asm/acpi.h>
>> #include <asm/desc.h>
>> @@ -324,6 +325,9 @@ notrace static void __cpuinit start_secondary(void
>*unused)
>> /* enable local interrupts */
>> local_irq_enable();
>>
>> + /* to prevent fake stack check failure in clock setup */
>> + boot_init_stack_canary();
>> +
>> x86_cpuinit.setup_percpu_clockev();
>>
>> wmb();
>> --
>> 1.6.5.3
>>
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-18 17:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-17 18:00 [PATCH 1/2] x86: initialize stack canary in secondary start Pan, Jacob jun
2009-12-18 16:02 ` Thomas Gleixner
2009-12-18 17:31 ` Pan, Jacob jun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®