Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161809Ab3DEHez (ORCPT ); Fri, 5 Apr 2013 03:34:55 -0400 Received: from mail-bk0-f54.google.com ([209.85.214.54]:38331 "EHLO mail-bk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752048Ab3DEHey (ORCPT ); Fri, 5 Apr 2013 03:34:54 -0400 Date: Fri, 5 Apr 2013 09:34:50 +0200 From: Ingo Molnar To: Kees Cook Cc: linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Jarkko Sakkinen , Matthew Garrett , Matt Fleming , Eric Northup , Dan Rosenberg , Julien Tinnes , Will Drewry , Linus Torvalds Subject: Re: [PATCH 3/3] x86: kernel base offset ASLR Message-ID: <20130405073449.GE26889@gmail.com> References: <1365106055-22939-1-git-send-email-keescook@chromium.org> <1365106055-22939-4-git-send-email-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1365106055-22939-4-git-send-email-keescook@chromium.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1458 Lines: 40 * Kees Cook wrote: > +config RANDOMIZE_BASE_MAX_OFFSET > + hex "Maximum ASLR offset allowed" > + depends on RANDOMIZE_BASE > + default "0x10000000" > + range 0x0 0x10000000 > + ---help--- > + Determines the maximal offset in bytes that will be applied to the > + kernel when Address Space Layout Randomization (ASLR) is active. > + Physical memory layout and kernel size may limit this further. > + This must be a power of two. I'm not sure this configuration option should be exposed. Is there any reason that if the feature is enabled, to not set this to the highest possible value? Furthermore, when randomization is enabled, I'd suggest to default kptr_restrict to 1 [if the user does not override it] - currently the bootup default is 0. I.e. make it easy to enable effective KASLR with a single configuration step, without "forgot about kptr_restrict" gotchas. I'd also suggest to rename RANDOMIZE_BASE to something like RANDOMIZE_KBASE. The 'kbase' makes it really clear that this is about some kernel base address randomization. 'Randomize base' sounds too generic, and could be misunderstood to mean something about our random pool for example. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/