Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp478350yba; Wed, 24 Apr 2019 04:45:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9j2j2QwwWi+KN7+9ecnkYfucB2IRpJU2XHYNHKmyutBpPU0J1VnNBH0BxkDie2wUHuxHI X-Received: by 2002:a17:902:8609:: with SMTP id f9mr30721671plo.32.1556106308130; Wed, 24 Apr 2019 04:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556106308; cv=none; d=google.com; s=arc-20160816; b=aHShbAylQPWTs6txtSaAU1bbe2RBJ3Xr1nxA43H7Is9Z87FHCcarSaTaUc5Ua3T9Y9 jLEBDn6PuquNZl9OU835juE+umBaj0c4sunTaFnq2Zxooz4nhgacd2GFi86BfMq6lSDB itWfqRJ16E2etgeJEQ4MxAgN0u3+euFfULhnAUE+LfovVDyW7MCU07fq693rMbHVONdk d7RuiZyyLUVdX8WFl2hWX9CzJHyFq+iyDRzeBb1km+Hgoh4fGsDhNVHhTZmC5CgPPNIs Bsy5UgEGI59hEND/DzgB//su/Mb7883ypaEydlMMMcZg8iqO0cuEPSxIeCd25183uX7L j0Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=OjWgvd6dKYswwv3npoNjRFVZQ384ZzkiKL3VRt51oVQ=; b=f7MBCG9K2w0jkKH6oIdYvu1DjBjfSs9NoeBw53BmltVsmAR7zMHIpHKPF8pTawR8FD Hkcd4zr3Qjubnt+pjuEQVYMBDSmZXI7gSTyauPyGrmkemmoz6nbMXX9KkdEVFqzeXwfZ 1J7AskqH39v2UJYsB0lMf/oMZKGM6z0MCkeoivBFIvvPcBmaXPfoCbj3R29WYv3vOR5s QnvBq2YmHN+uhs8NzsQb+fW4QctaEI+GMFL4tthuEWrXowmWnpzi2AhdKhXRV4Wq9atd 4DM18F2JoJnwrswpaVub28czGWcEoWN55Z6e3k8jo/4v8capMaJfF7esaMLiWTUNH2P5 FoFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=Iq1hJS99; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s145si17587343pgs.228.2019.04.24.04.44.52; Wed, 24 Apr 2019 04:45:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=Iq1hJS99; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728845AbfDXLNK (ORCPT + 99 others); Wed, 24 Apr 2019 07:13:10 -0400 Received: from terminus.zytor.com ([198.137.202.136]:40469 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726135AbfDXLNJ (ORCPT ); Wed, 24 Apr 2019 07:13:09 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3OBCqGk2549670 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 24 Apr 2019 04:12:53 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x3OBCqGk2549670 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019041745; t=1556104373; bh=OjWgvd6dKYswwv3npoNjRFVZQ384ZzkiKL3VRt51oVQ=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=Iq1hJS99qrozvee6wYWoEDmhipMCrf6O7SLn5O1707IPBBr/PPMdgWfuwXp+3/TXv lpcSHEnm6atENyzsQhsbuKDuujAH9xvbAFbQjYm5m3BZYEidlM0cCxznpGojMTQPKV iPmBU8T2I9lU+ilqyUfQXI4bxnADvoJWStMlEtmY4R4JXeX/He1wpqn5F1TA4MIFTL 4z6cCi5vlpH2XaSxZBOffipcEkO6GS4D+TWMfFw1+zoYMJSNJ5+q+t/NjvOywSSW8S APxgtNyrk4rX9E/cpucwtDB7SpyYSbx4EnoJtHgpUa/mjM/VN1BO41uJBAcq5x+2mU J/Jmv7eWCRsug== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3OBCqfQ2549667; Wed, 24 Apr 2019 04:12:52 -0700 Date: Wed, 24 Apr 2019 04:12:52 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Kees Cook Message-ID: Cc: linux-kernel@vger.kernel.org, bp@suse.de, mingo@kernel.org, hpa@zytor.com, keescook@chromium.org, samitolvanen@google.com, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org Reply-To: peterz@infradead.org, torvalds@linux-foundation.org, bp@suse.de, linux-kernel@vger.kernel.org, tglx@linutronix.de, samitolvanen@google.com, keescook@chromium.org, hpa@zytor.com, mingo@kernel.org In-Reply-To: <20190423183827.GA4012@beast> References: <20190423183827.GA4012@beast> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mm] x86/build: Move _etext to actual end of .text Git-Commit-ID: 392bef709659abea614abfe53cf228e7a59876a4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 392bef709659abea614abfe53cf228e7a59876a4 Gitweb: https://git.kernel.org/tip/392bef709659abea614abfe53cf228e7a59876a4 Author: Kees Cook AuthorDate: Tue, 23 Apr 2019 11:38:27 -0700 Committer: Ingo Molnar CommitDate: Wed, 24 Apr 2019 12:27:47 +0200 x86/build: Move _etext to actual end of .text When building x86 with Clang LTO and CFI, CFI jump regions are automatically added to the end of the .text section late in linking. As a result, the _etext position was being labelled before the appended jump regions, causing confusion about where the boundaries of the executable region actually are in the running kernel, and broke at least the fault injection code. This moves the _etext mark to outside (and immediately after) the .text area, as it already the case on other architectures (e.g. arm64, arm). Reported-and-tested-by: Sami Tolvanen Signed-off-by: Kees Cook Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20190423183827.GA4012@beast Signed-off-by: Ingo Molnar --- arch/x86/kernel/vmlinux.lds.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index bad8c51fee6e..de94da2366e7 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -141,11 +141,11 @@ SECTIONS *(.text.__x86.indirect_thunk) __indirect_thunk_end = .; #endif - - /* End of text section */ - _etext = .; } :text = 0x9090 + /* End of text section */ + _etext = .; + NOTES :text :note EXCEPTION_TABLE(16) :text = 0x9090