From patchwork Sat Dec 21 15:18:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 182359 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp1919394ilf; Sat, 21 Dec 2019 07:19:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyUpHZZA0XjOrORvJE8pYAOMz7LOmf153xdzCO9fXIMAoeH/6YXvJr6C0mGU8l32pS5pjmy X-Received: by 2002:a54:4085:: with SMTP id i5mr5252648oii.17.1576941554652; Sat, 21 Dec 2019 07:19:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576941554; cv=none; d=google.com; s=arc-20160816; b=uw3pTbn0le95wOAgI1Czuob5+8FJGi1CPGo1lY8Vm/0SNtWTldg2sc8t+jsceDPMB0 usEfvF0ofyGinaC9KdeAEPO0Jsr22mf0pQ+R+7a0b3lmXBDuHmaVNtBBIoCFuWRX4ZKh r9xSMkMudR4+NlmUp8zmX3HvU9Wc1xu8t7PgEufXv5yft30klvIRMtu07jHJXvwLgEEW OM4odDe3hqRk7+hBMYsz9BAcaVJth8jUCddrBFMD85+XEasN9cOQCJM1UcOhhkVzEp46 5ZxOHUeL1Yxd/qRoH6FRM8xd9XJRC59CQEo9wS1DSNaJzdHCQRVMuxXGTcBuRo8+0cck 8MkA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=IalKy0cIDykcqIOovYMNggMAbyERadJBeyOCwn69dUI=; b=JVCvTzmspttGPKgVcq8J99a5qOi4pZyqt2X7R6ILTKkhqF2qufoJhgqiu2NQ5wWnjH zB85oMU6QPSA66ViZgpfBQfxXDUc6IacZflNga5LUdZblu3MwrZAAHEuVNzgeYyum5Zl 2aw6mCqeUyKLpLJqWRCuKNJ6xr0mC85iRVnSCInIh98nLQ3DO+Bmh4ZGngC7ssmu3hqT NEVS+C0V/ZK2pDglJ34l5nAdjcLgQ0SrqVfL3dc4jPVe6eSe1xkXAkob1e5xjQRqKCjp Dfu00My3j4lUCjV8A8KNMxlMDnImws2qBRUQldmgvjj4u9t2f+cDm3SVtB0cLz6WACbm ONBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rI/yCLRW"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si6723447oij.270.2019.12.21.07.19.14; Sat, 21 Dec 2019 07:19:14 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="rI/yCLRW"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727097AbfLUPSx (ORCPT + 27 others); Sat, 21 Dec 2019 10:18:53 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39591 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfLUPSx (ORCPT ); Sat, 21 Dec 2019 10:18:53 -0500 Received: by mail-pf1-f195.google.com with SMTP id q10so6875291pfs.6 for ; Sat, 21 Dec 2019 07:18:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IalKy0cIDykcqIOovYMNggMAbyERadJBeyOCwn69dUI=; b=rI/yCLRW1ThOuyKlWa7kZYOiWbm1zu6K68+an8IKhVLuNvGgnWfpgFnH4UDCGl3fYg icPykowvK+rzcD5torv5jOkqTGxAvzA4IXkGKQcFBrP8RZ8VTPoxcBzZ7CmaVbOHF0hx eqP3eLTp8TXwnYRDu23M7ytsmL5TXh12UbNjrSQaIb/4Ok3UBNjtTgAn5LSn00MNM6e+ VITjl3Er4YJM2hzPi9jay6JF58oel4H7eUHbxvPnE/ZKTNA9g8jiSZjVJSl+mqYHjQXC 7l6i6Al18JcyPrEIDjGmWCgLyBkLAD6uO+Wehnm2dspIL4AKMDDGg0KlIPec8WjrUK6F n6Gw== 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:mime-version :content-transfer-encoding; bh=IalKy0cIDykcqIOovYMNggMAbyERadJBeyOCwn69dUI=; b=uASjPRi+NSg0a9bpBYGM2KzLaeKELZ/c/eK/8yxU6+7Mdmka3e4U3m1YEtMJlhBfRE mNvbAK+1zfiWYBay03aOJQMXJLA6ybLG4pHSpbhh26L7uVZ2awXmzzgZY+cw6K8aQ9os GMkCKi2DRWDcyRt/67WR8xCDuSAeR1sozYSLSIEtBwggknxjRCe7fPV3CKhNxoO7NmDb U9oPytNOmM71N8arf3ha4h88pjnOgIboJK/4D67WQV68dtlJFhCaMJ6qBVHSNqs72tb0 /QurqQFibISEinfCQ4K67PS/8nkxM0kSdiijXE9/CwaNUvC6KifLBeK6pCU7vFaXF/DE 4uyQ== X-Gm-Message-State: APjAAAXNlMb3L0upk1+VQIjKBDNxpnq3VqWd5zwFIY+P1Ijqh587YFsc o3fpU9Fqn/AHrEkElOu29ISRP4Kb7LU= X-Received: by 2002:a63:181:: with SMTP id 123mr20844550pgb.36.1576941532049; Sat, 21 Dec 2019 07:18:52 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:4e0::36e9]) by smtp.gmail.com with ESMTPSA id t187sm17233646pfd.21.2019.12.21.07.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 07:18:51 -0800 (PST) From: Khem Raj To: linux-kernel@vger.kernel.org Cc: Khem Raj , "Kirill A . Shutemov" , Kees Cook , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , x86-ml , Arnd Bergmann Subject: [PATCH] x86/boot/compressed/64: Define __force_order only when CONFIG_RANDOMIZE_BASE is unset Date: Sat, 21 Dec 2019 07:18:13 -0800 Message-Id: <20191221151813.1573450-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kaslr_64.c also defines the same variable, however when both files are included into final link, linker complains about multiple definition of `__force_order' which is coming from kaslr_64.o and pgtable_64.o, its possible that kaslr_64.o is disabled via CONFIG_RANDOMIZE_BASE config option, therefore define it conditionally only when CONFIG_RANDOMIZE_BASE is not set Since arch/x86/boot/compressed/Makefile overrides global CFLAGS it loses -fno-common option which would have caught this Signed-off-by: Khem Raj Cc: Kirill A. Shutemov Cc: Kees Cook Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Thomas Gleixner Cc: x86-ml Cc: Arnd Bergmann --- arch/x86/boot/compressed/pgtable_64.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.24.1 diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c index c8862696a47b..077d19268b0b 100644 --- a/arch/x86/boot/compressed/pgtable_64.c +++ b/arch/x86/boot/compressed/pgtable_64.c @@ -12,7 +12,9 @@ * It is not referenced from the code, but GCC < 5 with -fPIE would fail * due to an undefined symbol. Define it to make these ancient GCCs work. */ +#ifndef CONFIG_RANDOMIZE_BASE unsigned long __force_order; +#endif #define BIOS_START_MIN 0x20000U /* 128K, less than this is insane */ #define BIOS_START_MAX 0x9f000U /* 640K, absolute maximum */