Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp802327pxu; Wed, 7 Oct 2020 16:56:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDrSEOhduldJDx2lgS3PRL2o5X005sqb+hOjXlBO3ZC/78aWLtiWU+UdkAhh9ZreKBhanP X-Received: by 2002:a05:6402:b91:: with SMTP id cf17mr6226527edb.130.1602114961587; Wed, 07 Oct 2020 16:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602114961; cv=none; d=google.com; s=arc-20160816; b=IVdfSlaxFlixr+h1XrNpSiDJL/oKPlqFmoYrnx3uOI4MJQkTs2WZJF/on2CGJu6CQf ygivQnJBhPh6FjcBomFQ8hsNJdCz7qB41OiZiD5ea8UIsiFQFQ55bZgH5SLqcP2m2Mpw 404NV09y7zfY2zsycU/e8+iVtUPLoHs686iU8KpcKKPwbyTq1qrJzF1TmaUdt/QlL2WS EG7+xCyKDP0RKB52fBxOPUda1GOMITicA3cV+yCPl55u2/AraQFtwzalDhOtUEKpOk9y d4XKUMp+xu+IBq+s6xpqB/PdPJNg98rBq8eAfkmBXrDoKOWTn+Wvo42qA82WPKOoRs8h iBgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VWZPrk2HAzOluyH/d6XXY+zNuc54KSPlwvPVs4xhysM=; b=UHJ+6yFq/qpkDHh/FXy2AfBm6PcnBux4EuqH6h2slPO46wDKWi5/4aRC+pAb1MdbQQ F+JdYNbchnpVVM11rpjGvdFDxYBSAqI1oTSbHhjlzIjTCyiep4garptG9A0SLXeeiGRP Hl00t6k908MbtHJ4hVwyADQIYZiCZ1r/6+PUUbCo6a5oD7I13xuPnBn2f8vH10pX272S Thx6DdbMPBQBuLbIfeQgnoW6tDOmjKBSmQx+Mdu35K3RTEIH3bjklsZvT4iEN942w0cG Cl3tEcniDGW9KXewxT82COW+rQwMpAMzPRAf/MaMgdzTZ197arUNBzdMW5eeMajYGZgW aYJw== 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 gt24si2618128ejb.90.2020.10.07.16.55.38; Wed, 07 Oct 2020 16:56:01 -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 S1728584AbgJGTyK (ORCPT + 99 others); Wed, 7 Oct 2020 15:54:10 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:43512 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728522AbgJGTx6 (ORCPT ); Wed, 7 Oct 2020 15:53:58 -0400 Received: by mail-qk1-f196.google.com with SMTP id c2so4342296qkf.10 for ; Wed, 07 Oct 2020 12:53:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VWZPrk2HAzOluyH/d6XXY+zNuc54KSPlwvPVs4xhysM=; b=PaEqu3bVgON++U0YY3NGkuWQQ6ECfGruMoqXAqYpYGowkpFmpPAinXqO+Tgjp+ZeVm j6IyGDSUjZ0Db9p+9hy3KbMJR64kdiL8VyXfOieS3t5ifqQlmqAwiMpEwqB+bLjaNBbE iMEQQyFpSlr1jGlmfdqt3q217qNluntf61RoVNB+2/A8/H3zP1V/+HDupaVHd4ju3YdK LpBhC6h63jELbCjldDxW/crNL7bgP4k193WC6V+lX3XpSlYlqVgyLKU/KvJMbF9kY6Mz pZSmtRFOeKcvxeeKzXria00LeOodGst3xXTqS40kOPwxHFi1tWf6uJRrNX/pAnjHUsbZ JGZg== X-Gm-Message-State: AOAM530ZlgPpEa1sixTWkcLbRZEM9xlgaADNsbg4/7ifLndsy6/+o8CE iLxzcquz/QHgUiTpWNiQHvaatuTReWzOeQ== X-Received: by 2002:a37:6288:: with SMTP id w130mr4484526qkb.193.1602100437277; Wed, 07 Oct 2020 12:53:57 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id k20sm2287658qtm.44.2020.10.07.12.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 12:53:56 -0700 (PDT) From: Arvind Sankar To: x86@kernel.org, Joerg Roedel Cc: linux-kernel@vger.kernel.org Subject: [PATCH 5/5] x86/head/64: Disable stack protection for head$(BITS).o Date: Wed, 7 Oct 2020 15:53:51 -0400 Message-Id: <20201007195351.776555-6-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201007195351.776555-1-nivedita@alum.mit.edu> References: <20201007195351.776555-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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