[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200413150314.13974-1-frederic.pierret@qubes-os.org>
Date: Mon, 13 Apr 2020 17:03:14 +0200
From: Frédéric Pierret (fepitre)
<frederic.pierret@...es-os.org>
To: boris.ostrovsky@...cle.com, jgross@...e.com,
sstabellini@...nel.org, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, x86@...nel.org, hpa@...or.com,
xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
Cc: Frédéric Pierret (fepitre)
<frederic.pierret@...es-os.org>
Subject: [PATCH v2] xen x86: fix early boot crash with gcc-10
The change fixes boot failure on VM where kernel (at least v5.4 and v5.6)
is built with gcc-10 and STACKPROTECTOR_STRONG enabled:
```
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: cpu_bringup_and_idle+0x93/0xa0
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.4.31-1.qubes.x86_64 #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.12.0-1 04/01/2014
Call Trace:
dump_stack+0x64/0x88
panic+0x10b/0x2ed
? cpu_bringup_and_idle+0x93/0xa0
__stack_chk_fail+0x15/0x20
cpu_bringup_and_idle+0x93/0xa
```
The change makes successfully booting the VM. The VM is hosted by
KVM hypervisor and is running Xen into.
Based on work done by Sergei Trofimovich: https://lkml.org/lkml/2020/3/26/1133
Signed-off-by: Frédéric Pierret (fepitre) <frederic.pierret@...es-os.org>
---
arch/x86/xen/smp_pv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c
index 8fb8a50a28b4..5c8ee4a5bb0c 100644
--- a/arch/x86/xen/smp_pv.c
+++ b/arch/x86/xen/smp_pv.c
@@ -88,7 +88,7 @@ static void cpu_bringup(void)
local_irq_enable();
}
-asmlinkage __visible void cpu_bringup_and_idle(void)
+asmlinkage __visible void __no_stack_protector cpu_bringup_and_idle(void)
{
cpu_bringup();
boot_init_stack_canary();
--
2.25.2
Powered by blists - more mailing lists