From patchwork Sun Sep 3 12:07:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9936163 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 EF34D6037D for ; Sun, 3 Sep 2017 12:12:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1446286A9 for ; Sun, 3 Sep 2017 12:12:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4ADA286B3; Sun, 3 Sep 2017 12:12:39 +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 0C540286A9 for ; Sun, 3 Sep 2017 12:12:38 +0000 (UTC) Received: (qmail 17996 invoked by uid 550); 3 Sep 2017 12:09:38 -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 17899 invoked from network); 3 Sep 2017 12:09:37 -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=BjdoO2mnrAVyI4mpyzw2kQcE8qc8mQNJAyj9mEoUYO0erIHFlPZIidl0iOh48Z7k/N 8cc/2qK4Jk+TrQpbA9DDNTvylpxzkUQ5F6uRKOo6IokMX0WZb3hhRp6WG5uIflx7Msqy 4V9ww6VOvsLr1IH31D8o3AGn0jTTjM7CSYqqI= 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=FEMGe5cWQ5baZlUpIC1i5d0S5nZfnkYsNnWgX/jqYgimkpNVqK6AC7Loes9F/nJKmH njZR6Q8LW+EJmR7EChfzbzuMrU/64y3cveDBJs+KMy7RLAwa8J3HsiN4mJYgcZL3t/lm PJuiELKnJ19Hi+IwPY+yw3ezlqIWjV/gP3ynYbbwL3l2DCJO8wIktNY8UfFfXjF0KYPL 8hVDAxDyUIX+AagUaZ/dOchTZwoCXE2xAz+zwGbO8WXswNAU5DLeJjfp/UC1BnQk4gDG uOu3TI+Lkm+82zUr0GQkFvyT4cHyl0qoCsRy0ZUe6zS3VeDYuSm8b6YuHlOxgu1i0+RT D57A== X-Gm-Message-State: AHPjjUhXDHJljhOmwLpINBVe/4tFns/rlWz3O/XQohcpvVMnBPiDOE4J drWDLARE2kJ+yvkH X-Google-Smtp-Source: ADKCNb6HmAwV7A7ztlCPFUxv8xjcPLS4jYEK4c4chu65UW31kYvTJR/12F/kSWHM949XkNL3tXgMLw== X-Received: by 10.223.155.156 with SMTP id d28mr3823088wrc.14.1504440566464; Sun, 03 Sep 2017 05:09:26 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com Cc: Ard Biesheuvel , Arnd Bergmann , Nicolas Pitre , Russell King , Kees Cook , Thomas Garnier , Marc Zyngier , Mark Rutland , Tony Lindgren , Matt Fleming , Dave Martin Date: Sun, 3 Sep 2017 13:07:50 +0100 Message-Id: <20170903120757.14968-23-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170903120757.14968-1-ard.biesheuvel@linaro.org> References: <20170903120757.14968-1-ard.biesheuvel@linaro.org> Subject: [kernel-hardening] [PATCH v2 22/29] 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 Acked-by: Nicolas Pitre --- 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'