From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8125FC433E7 for ; Mon, 19 Oct 2020 19:45:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0791B22314 for ; Mon, 19 Oct 2020 19:45:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="O1y9/Ifc"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PdNK/zck" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731379AbgJSTpm (ORCPT ); Mon, 19 Oct 2020 15:45:42 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:33728 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731238AbgJSTp1 (ORCPT ); Mon, 19 Oct 2020 15:45:27 -0400 Date: Mon, 19 Oct 2020 19:44:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603136685; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YcgJ4BPdlQmnU2PeWPhz9B/1NJuC8LEYYfO6G2QaXrE=; b=O1y9/IfctEZpD9bngO5Xg1GNjZKS3rlkS/XjqZLVsBhNSYf6L3R+C87mNZt5Ej+jAMK933 Aobry+GNVJ5yHaXBj0UeLHGtr2axfhdJDeAQ3hYnEau1x7AGIvzFkeepDF7KAaz7SIjsYK iJW9v2qcJhIQlr4l/Wrps3Ssmv/Y/xKvEsRLeMMzZI0jhkwYQ+D8Lq6HQdha5gTi4tJk3s UU7R3MFO0sB8D1RKx9pVcIi9dqG2STS3fs4lXXyqyeRAg7lukbt0j/gYgO9vNeKhWrSEaY 3g8kNmxBQiRLy4rfHT3oUGMVOnljuDAnsB87xC8PqtHtEU9XxeQAce/SxkKb4A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603136685; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YcgJ4BPdlQmnU2PeWPhz9B/1NJuC8LEYYfO6G2QaXrE=; b=PdNK/zck0y54oBXfLAGcB66GzQVhxoUQDc0d/FlBG9bSAKTDJo0gW4Ltb59f1wIoj5cVEQ 7pOb2hCJHhfdTaCQ== From: "tip-bot2 for Arvind Sankar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/seves] x86/head/64: Disable stack protection for head$(BITS).o Cc: Arvind Sankar , Borislav Petkov , Joerg Roedel , x86 , LKML In-Reply-To: <20201008191623.2881677-6-nivedita@alum.mit.edu> References: <20201008191623.2881677-6-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <160313668451.7002.5512333485207413562.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/seves branch of tip: Commit-ID: 103a4908ad4da9decdf9bc7216ec5a4861edf703 Gitweb: https://git.kernel.org/tip/103a4908ad4da9decdf9bc7216ec5a4861edf703 Author: Arvind Sankar AuthorDate: Thu, 08 Oct 2020 15:16:23 -04:00 Committer: Borislav Petkov CommitterDate: Mon, 19 Oct 2020 13:11:00 +02:00 x86/head/64: Disable stack protection for head$(BITS).o 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(). This happens when CONFIG_STACKPROTECTOR_STRONG is enabled. It also currently needs CONFIG_AMD_MEM_ENCRYPT enabled because then set_bringup_idt_handler() is not an empty stub but that might change in the future, when the other vendor adds their similar technology. 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. [ bp: Extend commit message with the exact explanation how it happens. ] Signed-off-by: Arvind Sankar Signed-off-by: Borislav Petkov Reviewed-by: Joerg Roedel Link: https://lkml.kernel.org/r/20201008191623.2881677-6-nivedita@alum.mit.edu --- arch/x86/kernel/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 04ceea8..68608bd 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