Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1126637ybz; Wed, 22 Apr 2020 14:07:16 -0700 (PDT) X-Google-Smtp-Source: APiQypL3OapDP/RsveEVVEpKIatjM3+UdQ/zS+2nHJ2tgRM2tpVuAeKNPgWKcViMioxNFvPOma45 X-Received: by 2002:aa7:cd08:: with SMTP id b8mr439438edw.96.1587589636381; Wed, 22 Apr 2020 14:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587589636; cv=none; d=google.com; s=arc-20160816; b=ixPGkA+xSkY5cet75yTJlueqqb+TLXFyGXsSpdLh4Eo/oUS0J2gxNDytp1NZhY/mwO JyijOX4kan02cCy5Tlvwsw9Rbvi5qf+GJBSv1/3ZBz6JlufdQoFvm3qe8sM6gkq+TnRr ZO002RVzlIai5j/v4L2HzkXctflFYUoAIuqSOSv2VHCfPV3VjAAyKZUTHTXce6aZ3x8Q rm+N/xQEmZLIrSLQ/A+ILxeWXWDyejX0hfnZAZij27UxSt+Qsy5plGsBUeMinMPDHe1m XZe4BjdyeTMTKLs5v6cGjk2hLPMy/Ka7YBP2hyJVW2uT+315qvu3TZSmTv+PjykaD8zA 0BtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zUKNu7tEP2Ew6mpJstVWpghTc6pfH8SZlsjBVVy2IUE=; b=Ap8OdoStqaCuqBFgBBuFJvwAdJdu47M7oGl8NllaU4/4MIONzxI8ZiozMWhar5NTBK nXu9fUvoVxE05QyrLM9T66buPjKX8rEvVNL+DvjH74oQIq3JP2qOUiSeOg3PFChQ/rEg JHotN/msTLCvTzwuS5yH25/xEpG5P1VLMfHXA/7DxssNoc+5w0quVUnGmUc6n/cedprM ImGSVPYp6c94E6Pe1tUS+sy33bytkbWTe5B6wnJq8HsH/Okr22DdtSKwen62eceysmK3 YbAfh4Gs4iDmoFR6kPSfYNeiejqYHBRNA2b7Se6iJKfh2HjUZDflNqbga1vYhhXcPpDF lP6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=k53gcYui; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si204788ejg.470.2020.04.22.14.06.51; Wed, 22 Apr 2020 14:07:16 -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=@google.com header.s=20161025 header.b=k53gcYui; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726319AbgDVVF2 (ORCPT + 99 others); Wed, 22 Apr 2020 17:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbgDVVF1 (ORCPT ); Wed, 22 Apr 2020 17:05:27 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F8ACC03C1A9 for ; Wed, 22 Apr 2020 14:05:26 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id s10so1445692plr.1 for ; Wed, 22 Apr 2020 14:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zUKNu7tEP2Ew6mpJstVWpghTc6pfH8SZlsjBVVy2IUE=; b=k53gcYuiX1USwy+BW91kJIwRsEU6oXQm3/UpxGhd1ktKmz2KU5yUG3TA7f3WqtMUEO FcNIStlDZmO/lZc2LN/LwPsUdOVD39uJwLS76s49B9en/geQBSRycOdCeVERCU5wGwaD JmSw5WpCaajNnFmrl9SSTTuBhCT3sZIYje7Y4lVQW0cakWgyRLkbtYzE45G8H1tcXDda vyiQt0dWXV8N6AMyIr1/GoYDTI/pGphlqDWGFwhve1LMMm3Bky4uZzUW0F8kLCAPq5gb JUx8V1IS0rOvS0RIqO9priwIMoW5HBEePhMyTceBphZOxdB+GxHj21Kyu1R51omB8ZaN m1Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zUKNu7tEP2Ew6mpJstVWpghTc6pfH8SZlsjBVVy2IUE=; b=ZaFIf8X6Kdp6R7WAFW/W8Oj+71So0cwUQRaee4ATpLp0zidtsOv+0eD7sw7bHkMykS +KELSYuVwRCot/IQQJ6qQqN2ObSgwJzQG8fjcwuVNQq8WWebvJ9LieIyGsSv/AI52TcW K8EibtTkBfh48I60x5xkIOtU5yJnS8apKgQh7FIbOeyKpaaf0LB4zNQLwNTyyrTH/bhi zpLBQli1X7mi7Bxa9i47VbJZyhyhE7p95Z7/pP4MQflDGA8XJJeFHcT/kRPgWyKT88d+ RTJ1y0ESWQyN0kDU2gaXst974dUVMTISoj6hgaaJpizyzJ0143LIeJITLz68bDff6hTO ec7w== X-Gm-Message-State: AGi0PubERAr/WliEgf46CYMCDtlLb1QRvTyok00RFBtQF3bRlVNanawJ cUbqz3ivKZze9oDCntqYofDAMo/vptp47GFrOXSq8Q== X-Received: by 2002:a17:90a:266c:: with SMTP id l99mr616512pje.186.1587589525583; Wed, 22 Apr 2020 14:05:25 -0700 (PDT) MIME-Version: 1.0 References: <20200417084224.GB7322@zn.tnic> <20200417085859.GU2424@tucnak> <20200417090909.GC7322@zn.tnic> <20200417190607.GY2424@tucnak> <20200422102309.GA26846@zn.tnic> <20200422192113.GG26846@zn.tnic> In-Reply-To: <20200422192113.GG26846@zn.tnic> From: Nick Desaulniers Date: Wed, 22 Apr 2020 14:05:13 -0700 Message-ID: Subject: Re: [PATCH v2] x86: fix early boot crash on gcc-10 To: Borislav Petkov 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 , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 12:21 PM Borislav Petkov wrote: > > On Wed, Apr 22, 2020 at 11:55:50AM -0700, Nick Desaulniers wrote: > > Can you add by whom? It's not clear to me which function call in > > start_secondary modifies the stack protector guard. > > How's that > > /* > * Prevent tail call to cpu_startup_entry() because the stack protector > * guard has been changed a couple of functions up, in s/functions/statements/ or s/functions/function calls/ Sorry to be pedantic and bikeshed a comment! *ducks* With that you can add my: Reviewed-by: Nick Desaulniers > * boot_init_stack_canary() and must not be checked before tail calling > * another function. > */ > asm (""); > > ? > > > Another question. Do we not want a stack protector at all in this > > function? I'm not super familiar with how they work; do we not want > > them at all, or simply not to check the guard? > > Not to check the guard. See the beginning of > arch/x86/include/asm/stackprotector.h about how they work. > > > But if we're not going to check it, I think > > __attribute__((no_stack_protector)) applied to start_secondary might > > be a more precise fix. > > No such attribute in gcc yet. But yes, this came up a bit upthread, you > can go back in time for details. :) Filed: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94722 (Maybe a link to that might be helpful in the comment, for future travelers? But I don't feel strongly about that either way, and trust+defer to your judgement). -- Thanks, ~Nick Desaulniers