From patchwork Mon Apr 10 01:52:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Bin X-Patchwork-Id: 9671865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4EE5601EA for ; Mon, 10 Apr 2017 01:57:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A061227CF3 for ; Mon, 10 Apr 2017 01:57:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9194827FA8; Mon, 10 Apr 2017 01:57:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E369727CF3 for ; Mon, 10 Apr 2017 01:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=X9n0UBlIQV4zoWQHRmuIuiiV9oBJAyntQ0wAh7D21bA=; b=nsp7ZmDYZPdGpe 3XM40sqr124wuHyP3tebO6BktmZkyB4i4h9R+8fIQD6UG5vkBJaCXtR2WnFT/1EKUa6kxmqHecXYX aEVrV1tcppTz9HiaPDI3G9NwTlwcwOWdy/gXuYYATKgl2Q2lsp/C/ZTn5toeFlSee8GCjcEedK1+s 6hrPIzrrXJrW+IGgZ30xX9vmZ/WfXyRCRVfkexmRmHWVn04gRHFqwUaN/Yv3hTKwVewDRC2+xd8U+ IkUwxmPI9fYslS+ub96r8PeYRCba5KkcDxq+IP9ROFCE5TYnZKqHfIRuKMOMGhllAjzlMaWKExQDx QluPChcsQHzJelkktZXg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cxOa8-0007RM-Vp; Mon, 10 Apr 2017 01:57:28 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187] helo=dggrg01-dlp.huawei.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cxOa4-0007LY-97 for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2017 01:57:26 +0000 Received: from 172.30.72.54 (EHLO DGGEML401-HUB.china.huawei.com) ([172.30.72.54]) by dggrg01-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AMG67921; Mon, 10 Apr 2017 09:56:45 +0800 (CST) Received: from huawei.com (10.175.102.37) by DGGEML401-HUB.china.huawei.com (10.3.17.32) with Microsoft SMTP Server id 14.3.301.0; Mon, 10 Apr 2017 09:56:34 +0800 From: Li Bin To: , , , Subject: [PATCH] arm64: kaslr: fix ARM64_MODULE_PLTS dependency Date: Mon, 10 Apr 2017 09:52:12 +0800 Message-ID: <1491789132-18933-1-git-send-email-huawei.libin@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.58EAE65E.0049, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 5ac0f68335864df7cb1e7aaf5467ece0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170409_185724_495209_A5E57878 X-CRM114-Status: GOOD ( 11.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huawei.libin@huawei.com, guohanjun@huawei.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There is a bug that when RANDOMIZE_BASE enabled and RANDOMIZE_MODULE_REGION_FULL disabled, and assume that there are many modules, and module space is not enabled, module_alloc code now will alloc space in vmalloc space, and the patch "fe88a4 arm64: kaslr: keep modules close to the kernel when DYNAMIC_FTRACE=y" will be invalid. In fact, we only need plt when RANDOMIZE_MODULE_REGION_FULL enabled, so fix the dependency, that only RANDOMIZE_MODULE_REGION_FULL select ARM64_MODULE_PLTS. Signed-off-by: Li Bin --- arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 3741859..40692bb 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -952,7 +952,6 @@ config RELOCATABLE config RANDOMIZE_BASE bool "Randomize the address of the kernel image" - select ARM64_MODULE_PLTS if MODULES select RELOCATABLE help Randomizes the virtual address at which the kernel image is @@ -972,6 +971,7 @@ config RANDOMIZE_BASE config RANDOMIZE_MODULE_REGION_FULL bool "Randomize the module region independently from the core kernel" depends on RANDOMIZE_BASE && !DYNAMIC_FTRACE + select ARM64_MODULE_PLTS if MODULES default y help Randomizes the location of the module region without considering the