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=-12.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,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 67408C10F13 for ; Tue, 16 Apr 2019 06:25:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 407D320868 for ; Tue, 16 Apr 2019 06:25:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728128AbfDPGZy (ORCPT ); Tue, 16 Apr 2019 02:25:54 -0400 Received: from terminus.zytor.com ([198.137.202.136]:54375 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbfDPGZy (ORCPT ); Tue, 16 Apr 2019 02:25:54 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3G6PLYi3310644 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 15 Apr 2019 23:25:21 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3G6PLxf3310641; Mon, 15 Apr 2019 23:25:21 -0700 Date: Mon, 15 Apr 2019 23:25:21 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Sami Tolvanen Message-ID: Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, mingo@kernel.org, bp@alien8.de, npiggin@gmail.com, tglx@linutronix.de, samitolvanen@google.com, keescook@chromium.org, hpa@zytor.com, peterz@infradead.org, ndesaulniers@google.com Reply-To: torvalds@linux-foundation.org, npiggin@gmail.com, bp@alien8.de, peterz@infradead.org, ndesaulniers@google.com, tglx@linutronix.de, samitolvanen@google.com, mingo@kernel.org, linux-kernel@vger.kernel.org, keescook@chromium.org, hpa@zytor.com In-Reply-To: <20190415164956.124067-1-samitolvanen@google.com> References: <20190415164956.124067-1-samitolvanen@google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/build/lto: Fix truncated .bss with -fdata-sections Git-Commit-ID: 6a03469a1edc94da52b65478f1e00837add869a3 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 6a03469a1edc94da52b65478f1e00837add869a3 Gitweb: https://git.kernel.org/tip/6a03469a1edc94da52b65478f1e00837add869a3 Author: Sami Tolvanen AuthorDate: Mon, 15 Apr 2019 09:49:56 -0700 Committer: Ingo Molnar CommitDate: Tue, 16 Apr 2019 08:20:55 +0200 x86/build/lto: Fix truncated .bss with -fdata-sections With CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y, we compile the kernel with -fdata-sections, which also splits the .bss section. The new section, with a new .bss.* name, which pattern gets missed by the main x86 linker script which only expects the '.bss' name. This results in the discarding of the second part and a too small, truncated .bss section and an unhappy, non-working kernel. Use the common BSS_MAIN macro in the linker script to properly capture and merge all the generated BSS sections. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Cc: Borislav Petkov Cc: Kees Cook Cc: Linus Torvalds Cc: Nicholas Piggin Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20190415164956.124067-1-samitolvanen@google.com [ Extended the changelog. ] Signed-off-by: Ingo Molnar --- arch/x86/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index bad8c51fee6e..a5127b2c195f 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -362,7 +362,7 @@ SECTIONS .bss : AT(ADDR(.bss) - LOAD_OFFSET) { __bss_start = .; *(.bss..page_aligned) - *(.bss) + *(BSS_MAIN) BSS_DECRYPTED . = ALIGN(PAGE_SIZE); __bss_stop = .;