Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932638AbbKYAkG (ORCPT ); Tue, 24 Nov 2015 19:40:06 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:58210 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932226AbbKYAkC (ORCPT ); Tue, 24 Nov 2015 19:40:02 -0500 Date: Tue, 24 Nov 2015 16:40:01 -0800 From: Andrew Morton To: Daniel Cashman Cc: linux-kernel@vger.kernel.org, linux@arm.linux.org.uk, keescook@chromium.org, mingo@kernel.org, linux-arm-kernel@lists.infradead.org, corbet@lwn.net, dzickus@redhat.com, ebiederm@xmission.com, xypron.glpk@gmx.de, jpoimboe@redhat.com, kirill.shutemov@linux.intel.com, n-horiguchi@ah.jp.nec.com, aarcange@redhat.com, mgorman@suse.de, tglx@linutronix.de, rientjes@google.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, salyzyn@android.com, jeffv@google.com, nnk@google.com, catalin.marinas@arm.com, will.deacon@arm.com, hpa@zytor.com, x86@kernel.org, hecmargi@upv.es, bp@suse.de, dcashman@google.com Subject: Re: [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base ASLR. Message-Id: <20151124164001.71844bcfb4d7a500cd25d9c6@linux-foundation.org> In-Reply-To: <1447888808-31571-2-git-send-email-dcashman@android.com> References: <1447888808-31571-1-git-send-email-dcashman@android.com> <1447888808-31571-2-git-send-email-dcashman@android.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1991 Lines: 59 On Wed, 18 Nov 2015 15:20:05 -0800 Daniel Cashman wrote: > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -1568,6 +1568,28 @@ static struct ctl_table vm_table[] = { > .mode = 0644, > .proc_handler = proc_doulongvec_minmax, > }, > +#ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS > + { > + .procname = "mmap_rnd_bits", > + .data = &mmap_rnd_bits, > + .maxlen = sizeof(mmap_rnd_bits), > + .mode = 0644, Is there any harm in permitting the attacker to read these values? And is there any benefit in permitting non-attackers to read them? > + .proc_handler = proc_dointvec_minmax, > + .extra1 = &mmap_rnd_bits_min, > + .extra2 = &mmap_rnd_bits_max, > + }, > +#endif > +#ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS > + { > + .procname = "mmap_rnd_compat_bits", > + .data = &mmap_rnd_compat_bits, > + .maxlen = sizeof(mmap_rnd_compat_bits), > + .mode = 0644, > + .proc_handler = proc_dointvec_minmax, > + .extra1 = &mmap_rnd_compat_bits_min, > + .extra2 = &mmap_rnd_compat_bits_max, > + }, > +#endif > > ... > > +#ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS > +int mmap_rnd_bits_min = CONFIG_ARCH_MMAP_RND_BITS_MIN; > +int mmap_rnd_bits_max = CONFIG_ARCH_MMAP_RND_BITS_MAX; > +int mmap_rnd_bits = CONFIG_ARCH_MMAP_RND_BITS; > +#endif > +#ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS > +int mmap_rnd_compat_bits_min = CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN; > +int mmap_rnd_compat_bits_max = CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX; > +int mmap_rnd_compat_bits = CONFIG_ARCH_MMAP_RND_COMPAT_BITS; These could be __read_mostly. If one believes in such things. One effect of __read_mostly is to clump the write-often stuff into the same cachelines and I've never been convinced that one outweighs the other... -- 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/