From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C614C2BA19 for ; Mon, 13 Apr 2020 17:41:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E36C320692 for ; Mon, 13 Apr 2020 17:41:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="QlfEDmYJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732973AbgDMRlo (ORCPT ); Mon, 13 Apr 2020 13:41:44 -0400 Received: from mail.skyhub.de ([5.9.137.197]:39846 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732943AbgDMRli (ORCPT ); Mon, 13 Apr 2020 13:41:38 -0400 Received: from zn.tnic (p200300EC2F06C90094DE0BDBF95A27C8.dip0.t-ipconnect.de [IPv6:2003:ec:2f06:c900:94de:bdb:f95a:27c8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 111041EC0A02; Mon, 13 Apr 2020 19:41:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1586799696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gc71y0cM8+tCsVwGa6HMo9kNdRtGev9oBI43iMJtcF8=; b=QlfEDmYJMey1yNVo645/4JcSkWdZcGpFSZ9EqumxKdxRVN3ySYXLtmr4pm7D5WU3Uvb0e+ 9fuaFwAaWbly5fAj5YWAl74qHDx51jn5MrfYhaTQOcWvjwCfRLPGgFB89kbxynd+RN4czu 0SJLDsmAS77rKFsro5fk3uViVVABcRM= Date: Mon, 13 Apr 2020 19:41:30 +0200 From: Borislav Petkov To: boris.ostrovsky@oracle.com, jgross@suse.com Cc: =?utf-8?Q?Fr=C3=A9d=C3=A9ric_Pierret_=28fepitre=29?= , sstabellini@kernel.org, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, hpa@zytor.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] xen x86: fix early boot crash with gcc-10 Message-ID: <20200413174130.GE3772@zn.tnic> References: <20200413142051.GC3772@zn.tnic> <20200413150314.13974-1-frederic.pierret@qubes-os.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200413150314.13974-1-frederic.pierret@qubes-os.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 13, 2020 at 05:03:14PM +0200, Frédéric Pierret (fepitre) wrote: > 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) > --- > 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(); > -- Boris O, Jürgen, you guys might wanna wait a bit with this one: https://lkml.kernel.org/r/20200413163540.GD3772@zn.tnic -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E990DC2BA19 for ; Mon, 13 Apr 2020 17:42:10 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AED5820692 for ; Mon, 13 Apr 2020 17:42:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="QlfEDmYJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AED5820692 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jO35X-0002Le-Mo; Mon, 13 Apr 2020 17:41:39 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jO35W-0002LZ-UX for xen-devel@lists.xenproject.org; Mon, 13 Apr 2020 17:41:38 +0000 X-Inumbo-ID: 0610868d-7dae-11ea-8886-12813bfff9fa Received: from mail.skyhub.de (unknown [5.9.137.197]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0610868d-7dae-11ea-8886-12813bfff9fa; Mon, 13 Apr 2020 17:41:37 +0000 (UTC) Received: from zn.tnic (p200300EC2F06C90094DE0BDBF95A27C8.dip0.t-ipconnect.de [IPv6:2003:ec:2f06:c900:94de:bdb:f95a:27c8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 111041EC0A02; Mon, 13 Apr 2020 19:41:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1586799696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gc71y0cM8+tCsVwGa6HMo9kNdRtGev9oBI43iMJtcF8=; b=QlfEDmYJMey1yNVo645/4JcSkWdZcGpFSZ9EqumxKdxRVN3ySYXLtmr4pm7D5WU3Uvb0e+ 9fuaFwAaWbly5fAj5YWAl74qHDx51jn5MrfYhaTQOcWvjwCfRLPGgFB89kbxynd+RN4czu 0SJLDsmAS77rKFsro5fk3uViVVABcRM= Date: Mon, 13 Apr 2020 19:41:30 +0200 From: Borislav Petkov To: boris.ostrovsky@oracle.com, jgross@suse.com Subject: Re: [PATCH v2] xen x86: fix early boot crash with gcc-10 Message-ID: <20200413174130.GE3772@zn.tnic> References: <20200413142051.GC3772@zn.tnic> <20200413150314.13974-1-frederic.pierret@qubes-os.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200413150314.13974-1-frederic.pierret@qubes-os.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: sstabellini@kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, =?utf-8?Q?Fr=C3=A9d=C3=A9ric_Pierret_=28fepitre=29?= , tglx@linutronix.de Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On Mon, Apr 13, 2020 at 05:03:14PM +0200, Frédéric Pierret (fepitre) wrote: > 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) > --- > 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(); > -- Boris O, Jürgen, you guys might wanna wait a bit with this one: https://lkml.kernel.org/r/20200413163540.GD3772@zn.tnic -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette