Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp555779ybz; Wed, 22 Apr 2020 03:37:43 -0700 (PDT) X-Google-Smtp-Source: APiQypJPiMUuti2WFNLU5TKbEGS7cgB3D1ZDXeQA611ccfWgEmaY2z0oNEAujawBDcBaBxTzrUwZ X-Received: by 2002:a50:eb08:: with SMTP id y8mr21823245edp.49.1587551863342; Wed, 22 Apr 2020 03:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587551863; cv=none; d=google.com; s=arc-20160816; b=Q/eEkUyb+urUrV+28KYmhQ0gLg7tjOhPdSQiT0MZcSYtm13kNdoSBNs6qFh1y3QZB6 sPTr4ccx09rsgA8Ia12qzHY7rtUImNG3ZktA0FULP+47QMy1SMbzflv6Ju3vO1Ft6W2h 6xdgWGYZd33A2pFLGl6/7/1hoy/xtck57TAKPHkQcUOasg4MiZ/q8uY5MYR0JOtgrQpi QlOmC4fVX3t63c1VMzSju08H82wmNeW9AmL8LbrCFbzTI3tvNSFnAwAFjgEdxgVGhd1K 5ab9p6d+M9pXFOktuCKXSlJu8tRyBvJqKNdD+h54URwdIWRBiuGsYldfnwVX4b3sDFjn Tc5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HDuUABhmmUgyzWxWyDZN0U/l9ljHbsLtT1vuHABexv8=; b=Ant/X2RI0dWCYzwisgmWFzZS+PUW7iDGNDBfqrSu2qN0n6WZ+UyWHUpr2HK5+UiQAw r/GVIq2XG3tMEP87LqgZxs9dg/h5U8eG6TjcHaHUVr3AQKi0tH41mdKtXwsEtbvJhFQQ gOoVC3t6fYILDXf9iTjhNY+dULqWzvW4A0ghDVQi0+1aNgE9Uuz7DtvhqiJy8ZL/orgZ 6V5+Lr+GsrWuqRW2lDmCyV17yZAtxwJ4UTdZfDMWaepniKdtECSJNHMegmb7VF5KDZoB AOoE3896PBPoaw7K5CzggUJhkdxGmawx9j1W8EuUChCasHdtRE17b9SbxkkT1bU9KozI ibfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=VMGpvZXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si3276457ejf.197.2020.04.22.03.37.19; Wed, 22 Apr 2020 03:37:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=VMGpvZXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730351AbgDVKXg (ORCPT + 99 others); Wed, 22 Apr 2020 06:23:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730298AbgDVKXQ (ORCPT ); Wed, 22 Apr 2020 06:23:16 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AFBFC03C1A8 for ; Wed, 22 Apr 2020 03:23:16 -0700 (PDT) Received: from zn.tnic (p200300EC2F0DC100B57FB20533079C8E.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:c100:b57f:b205:3307:9c8e]) (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 62BE41EC0D3A; Wed, 22 Apr 2020 12:23:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1587550994; 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:in-reply-to:in-reply-to: references:references; bh=HDuUABhmmUgyzWxWyDZN0U/l9ljHbsLtT1vuHABexv8=; b=VMGpvZXLrSuGmV7jBbvq6prp0sGWkwub9bVK9v+hBWVzuN3uZLatR/bWbn4DIlfGT5phAV nB5cmO0sy1MEES5H2XDEWMrDgQ5Plz5VVrG6Y8Wru9Fbv+SF6kb66ffM0KULxdBT/QupyU smykpf8zpVCgU+9dum7H9GzuokZvXuo= Date: Wed, 22 Apr 2020 12:23:09 +0200 From: Borislav Petkov To: Nick Desaulniers Cc: Michael Matz , Jakub Jelinek , Sergei Trofimovich , LKML , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , clang-built-linux Subject: Re: [PATCH v2] x86: fix early boot crash on gcc-10 Message-ID: <20200422102309.GA26846@zn.tnic> References: <20200417075739.GA7322@zn.tnic> <20200417080726.GS2424@tucnak> <20200417084224.GB7322@zn.tnic> <20200417085859.GU2424@tucnak> <20200417090909.GC7322@zn.tnic> <20200417190607.GY2424@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 Ok, let's try the simple and clean fix first. Nick, would that work on LLVM too? And I hope this will remain working and the compiler won't jump over an inline asm and go nuts. Thx. --- diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 3b9bf8c7e29d..06d2e16bedbb 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -266,6 +266,13 @@ static void notrace start_secondary(void *unused) wmb(); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); + + /* + * Prevent tail call to cpu_startup_entry() because the stack protector + * guard has been changed in the middle of this function and must not be + * checked before tail calling another function. + */ + asm (""); } /** -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette