Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp26121ybt; Tue, 16 Jun 2020 15:30:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9FyyQgczPMOFEckgA2akfDKS4TDVcnwI3z4mSLwriJ6R+LZevL2JDwrqCWM/wIw88wcDr X-Received: by 2002:a17:906:1d1a:: with SMTP id n26mr4579809ejh.351.1592346623859; Tue, 16 Jun 2020 15:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592346623; cv=none; d=google.com; s=arc-20160816; b=BQH+Cyd3QCC4uXcbTTQYcFQ/oQnIpBkV3ZQEIQZllZ17sXFIbYMaCUPq0hmKzqbnGP 5Ykn8pLJIzV1l9kW9Eb96WAJIIZ/KvW3Czuulvn7DQqWifEW68VI8NaXvVYcYoRB4pI4 UBqp2BFTwDuq6Fep0/x8XhVY2cNzQSon/lU3DzwDlvV/7T5GfAGZAbI0HchQ4fxHYasC ODCohGaIb8qNvSbBArb8lDAyFM+OJjaupT4JeRINwPOnohHUnadi0uQuKsekSCXHfPSO 4yDL8mwa+coGURWc1+7IBMpoNCe1Iod8doNxpX3Vy52xLrjerCvc1ojdYYWFZXJqoKrv cO+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VcKfZlE4WkUhVaivLHqicBLfv47GDp8cYmEaB3V/yXI=; b=OAu350ogJvntK/if+86nXhgySPjXRMWh7w84PigPKKvmzPZwmEkRAIGlKLirBIsrg1 KtU/citAgOs71o41bQk2lxxSXMHNoc2p17cCIvyJl76pvVbrWszHLeE5g2zKde4puv2r g5c0u3GE6Z3KfvzreEgcfqQ+hHPVBKOxYbaEWg570z3RD4TnzrpPSPQ7ELwKSGQ7zOzj p/VzYJ4YQn9yf3nbN5Wppvkc+kshHkFffecfT8Viy8R55OCbx1iTi21O1pMnmTd4+N6I sRGy6vko7uVH3vqpkq9t8tFoXa7+cp9CU1h7IK0Re/4VOMUYcMUXBr4tx7VodTDUbvX0 RbSg== 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 v13si12044858eji.498.2020.06.16.15.30.00; Tue, 16 Jun 2020 15:30:23 -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 S1726349AbgFPWZv (ORCPT + 99 others); Tue, 16 Jun 2020 18:25:51 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42397 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbgFPWZv (ORCPT ); Tue, 16 Jun 2020 18:25:51 -0400 Received: by mail-qk1-f195.google.com with SMTP id l17so203475qki.9 for ; Tue, 16 Jun 2020 15:25:50 -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=VcKfZlE4WkUhVaivLHqicBLfv47GDp8cYmEaB3V/yXI=; b=rLUoZOZ8JStWVgPsHXFSVdi320jWCV4Ds7VR5rrRt/QsR4iWrUUAbnnTZxOJqUAlv9 K6v8KHmt7jSPub5mX+0VdcviG47+K+YpN7I1KhH6KURl++xrs6wIHamEFCQJfyCX+xEl I2Zm1VI6+X8ULHt3+KJSboK1TLC3Pg40bRU9cCETlFf9keGSq6g6NR0HUbHiHWqHKu/E kSn+CQBu40Ka+KDq3CI++5w/ayhBeCxBcApXJMIRvuO0U8QB8OVf1cfY001dHFwhgdck ba6+Jw5NJiVUXn2ydZ0Y6GOQDcbgH2JA0xKnddG2EZRrQbhMB3XGaubB06bQ2AVCXMNL hxYg== X-Gm-Message-State: AOAM5334bOpdYk8cpc98h4oXqBHXs34P421zuaBjvx3Z8WwKL+EA06YG CvQGMUNy//RMj72r3QrILGQ= X-Received: by 2002:a37:4753:: with SMTP id u80mr22286270qka.178.1592346350157; Tue, 16 Jun 2020 15:25:50 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id p13sm15290473qke.135.2020.06.16.15.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 15:25:49 -0700 (PDT) From: Arvind Sankar To: x86@kernel.org, kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Gabriel C , Linus Torvalds , Hans de Goede , Borislav Petkov Subject: [PATCH] x86/purgatory: Add -fno-stack-protector Date: Tue, 16 Jun 2020 18:25:47 -0400 Message-Id: <20200616222547.1979233-1-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The purgatory Makefile removes -fstack-protector options if they were configured in, but does not currently add -fno-stack-protector. If gcc was configured with the --enable-default-ssp configure option, this results in the stack protector still being enabled for the purgatory (absent distro-specific specs files that might disable it again for freestanding compilations), if the main kernel is being compiled with stack protection enabled (if it's disabled for the main kernel, the top-level Makefile will add -fno-stack-protector). This will break the build since commit e4160b2e4b02 ("x86/purgatory: Fail the build if purgatory.ro has missing symbols") and prior to that would have caused runtime failure when trying to use kexec. Explicitly add -fno-stack-protector to avoid this, as done in other Makefiles that need to disable the stack protector. Reported-by: Gabriel C Signed-off-by: Arvind Sankar --- arch/x86/purgatory/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile index b04e6e72a592..088bd764e0b7 100644 --- a/arch/x86/purgatory/Makefile +++ b/arch/x86/purgatory/Makefile @@ -34,6 +34,7 @@ KCOV_INSTRUMENT := n PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING +PURGATORY_CFLAGS += $(call cc-option,-fno-stack-protector) # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That # in turn leaves some undefined symbols like __fentry__ in purgatory and not -- 2.26.2