Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2097174pxu; Fri, 9 Oct 2020 07:55:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN3M0PbASn3AlwF1AgDDchzs6kzXe+aIDdFBjtiDMXnkduY+xcAFweeLZWgDDcinr6ztB2 X-Received: by 2002:a05:6402:943:: with SMTP id h3mr15000580edz.88.1602255313256; Fri, 09 Oct 2020 07:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602255313; cv=none; d=google.com; s=arc-20160816; b=NTJYZQTcPheMYO11U8dbEeveqJO1RNjkOx5kQ7FRlLT8A5UZSVTq/lNfc4UalwG04z ZhqFlXGX8KMKL+19iNhhayemxOblGk3ttjzI5ivyAYIyrxPQZtHpywWiRRC8g/Nn91Cz ZEb8bvhamsyttCpfK8sWoEKAt9bpEc18gdvTC0n1qyFm0TBecAhZRhAqnoU/OLw2VUmM wHemY6JETR3LBa/o8Zel5OF6qgkY/vXSVXNO+vEcgyGGxj9Bh/x7Unqc5z6XYmroACoS E7W30CLXx0miHq0gZq8s2e2uuP0qWLvzsg3CQ3CWTRbL3sQB2ZytX3VT3BPpAd+5q+VI 1uew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=PgAi/3ddtlQAkYKyQmc+AAV6u6m16fslc0FY78xm/QA=; b=Yzzc6RIvH8C7FdZFNpmyFkSvtdINMe4C/zOzgjG805cmWTms0zxsiDBNr+GuMwgNRn 5i+BN5hiCpOsMstL98P3oRtqk/I/rVaaLjM9e7vt9rgYTtKet9zSSIkRdb+09JYSKfOG wEXrZteLybbVfgrMivB8D4sSCucf19mJSTIStqiKh/0v9oPhD5Q3OsGOHWtcSxG9ZwPU ppdzZztZJkYsbiUbneXHMNHd8DkLP7aChwN0gD1ecOh7f7hJRhKLyxV8q0USqmiQ3JYI I+TvJPz3rRmAgF23Bl25f6eMvBeDKqLLIpG4qrpXh2p3iAekcaQSdLiZS7tC777Y6geP xSRA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu8si5920937ejb.76.2020.10.09.07.54.49; Fri, 09 Oct 2020 07:55:13 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388901AbgJIOtk (ORCPT + 99 others); Fri, 9 Oct 2020 10:49:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:54414 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732056AbgJIOtj (ORCPT ); Fri, 9 Oct 2020 10:49:39 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3F9CFAF33; Fri, 9 Oct 2020 14:49:38 +0000 (UTC) Date: Fri, 9 Oct 2020 16:49:36 +0200 From: Joerg Roedel To: Arvind Sankar Cc: x86@kernel.org, Borislav Petkov , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/5] x86/head/64: Disable stack protection for head$(BITS).o Message-ID: <20201009144936.GC3302@suse.de> References: <20201008191623.2881677-1-nivedita@alum.mit.edu> <20201008191623.2881677-6-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201008191623.2881677-6-nivedita@alum.mit.edu> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2020 at 03:16:23PM -0400, Arvind Sankar wrote: > On 64-bit, the startup_64_setup_env() function added in > 866b556efa12 ("x86/head/64: Install startup GDT") > has stack protection enabled because of set_bringup_idt_handler(). > > At this point, %gs is not yet initialized, and this doesn't cause a > crash only because the #PF handler from the decompressor stub is still > installed and handles the page fault. > > Disable stack protection for the whole file, and do it on 32-bit as > well to avoid surprises. > > Signed-off-by: Arvind Sankar > --- > arch/x86/kernel/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile > index 04ceea8f4a89..68608bd892c0 100644 > --- a/arch/x86/kernel/Makefile > +++ b/arch/x86/kernel/Makefile > @@ -47,6 +47,8 @@ endif > # non-deterministic coverage. > KCOV_INSTRUMENT := n > > +CFLAGS_head$(BITS).o += -fno-stack-protector > + > CFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace > > obj-y := process_$(BITS).o signal.o > -- > 2.26.2 Reviewed-by: Joerg Roedel