From patchwork Mon Aug 14 12:54:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9898845 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 62D9E602BA for ; Mon, 14 Aug 2017 12:58:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57969285E3 for ; Mon, 14 Aug 2017 12:58:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C650285FD; Mon, 14 Aug 2017 12:58:45 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 5FA5F285E3 for ; Mon, 14 Aug 2017 12:58:44 +0000 (UTC) Received: (qmail 27649 invoked by uid 550); 14 Aug 2017 12:55:51 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 26504 invoked from network); 14 Aug 2017 12:55:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GA4mwOIIIMqixCxF+SXqpba59lAwMT7mX+Yh7X8Q+ac=; b=gtC0nGX0yUwLdPe4eDTqt0Pr0ctlDBRIESRCI47o4FLzt5uFTSTqqK2o77Z4Zt6Dq/ kWfmPbtAO+aOxcDgjvBsHreLKInXdVZSDlsG9AO6KtqZptzlGIqdtpZmmDr8BhILYVIM xlon/yPH1R+DiVfKqvX4bkG893mWD7WFVI4+M= 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:in-reply-to :references; bh=GA4mwOIIIMqixCxF+SXqpba59lAwMT7mX+Yh7X8Q+ac=; b=dqB7D9+9fa1S7Gj8hjjMwHJePXRxn40Lj83jT9ConFyPbaUQ1gXgkBAFXJF4YMHy07 qSdJ635XZszn+udykRHtrbmBiDxQ1FcLKN/rOBuv7pCRLR0pfMSZlxQDSbAGVEhmJtYm qIkcMj7dhUwU5A1gC3oMROx8gSCsQzqA4UT9xxXshAM9k1vRN+UScRUEp2MJpU/q+/t3 9TFdPmoTva8v6e2+fhgDHfjH4DUlogyD40GiOg4qdWdiSaOseyvxx0x7MYl2KUzLTbeU LjtqtInZgcDxpy7NDdqXUuT9aImOMtrZH+a2vu6ztIAQCAXSYPThrEqxnMOm9rdYCSph puWw== X-Gm-Message-State: AHYfb5iQr7+luOz0DOaZ8gXfiiGbvPicjfG2UPhrtWFq9N/O1m6ON9Y/ ti2chDQHlg4CCx7825CXcQ== X-Received: by 10.28.107.69 with SMTP id g66mr4666348wmc.119.1502715335777; Mon, 14 Aug 2017 05:55:35 -0700 (PDT) From: Ard Biesheuvel To: kernel-hardening@lists.openwall.com Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Arnd Bergmann , Nicolas Pitre , Russell King , Kees Cook , Thomas Garnier , Marc Zyngier , Mark Rutland , Tony Lindgren , Matt Fleming , Dave Martin Date: Mon, 14 Aug 2017 13:54:02 +0100 Message-Id: <20170814125411.22604-22-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170814125411.22604-1-ard.biesheuvel@linaro.org> References: <20170814125411.22604-1-ard.biesheuvel@linaro.org> Subject: [kernel-hardening] [PATCH 21/30] ARM: mm: export default vmalloc base address X-Virus-Scanned: ClamAV using ClamSMTP In order for the EFI stub to be able to decide over what range to randomize the load address of the kernel, expose the definition of the default vmalloc base address as VMALLOC_DEFAULT_BASE. Cc: Russell King Signed-off-by: Ard Biesheuvel --- arch/arm/include/asm/pgtable.h | 1 + arch/arm/mm/mmu.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 1c462381c225..a0d4a63a6516 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -45,6 +45,7 @@ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) #define VMALLOC_END 0xff800000UL +#define VMALLOC_DEFAULT_BASE (VMALLOC_END - (240 << 20) - VMALLOC_OFFSET) #define LIBRARY_TEXT_START 0x0c000000 diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index e46a6a446cdd..566f7e657931 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1128,8 +1128,7 @@ void __init debug_ll_io_init(void) } #endif -static void * __initdata vmalloc_min = - (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET); +static void * __initdata vmalloc_min = (void *)VMALLOC_DEFAULT_BASE; /* * vmalloc=size forces the vmalloc area to be exactly 'size'