Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1277712

Re: [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base ASLR.

From Daniel Cashman <dcashman@android.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base ASLR.
Date 2015-11-25 20:20 +0100
Message-ID <qyNLH-1Zv-3@gated-at.bofh.it> (permalink)
References <qwkkO-1pG-7@gated-at.bofh.it> <qwkkO-1pG-9@gated-at.bofh.it> <qywrv-75M-1@gated-at.bofh.it> <qywrv-75M-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 11/24/2015 04:47 PM, Kees Cook wrote:
> On Tue, Nov 24, 2015 at 4:40 PM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
>> On Wed, 18 Nov 2015 15:20:05 -0800 Daniel Cashman <dcashman@android.com> 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?
> 
> I'm on the fence. Things like kernel/randomize_va_space is 644. But
> since I don't see a benefit in exposing them, let's make them all 600
> instead -- it's a new interface, better to keep it narrower now.

Is there any harm in allowing the attacker to read these values? Nothing
immediately comes to mind.  It is a form of information leakage, and I
guess a local attacker could use this information to calibrate an attack
or decide whether or not brute-forcing is a worthy approach, but this
easily could be leaked in other ways as well.

Is there a benefit to allowing non-attackers to read them?  Possibly
could be used in tests seeking to verify the system environment, but
again, this could be discovered in other ways.

I like Kees' suggestion of starting narrow and granting if need arises.

>>>
>>> +#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...
> 
> The _min and _max values should be const, actually, since they're
> build-time selected. The _bits could easily be __read_mostly, yeah.

Yes, one would generally expect these to never be touched, and even if
they were, the threshold of __read_mostly would certainly be crossed.

-Dan

--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/4] Allow customizable random offset to mmap_base address. Daniel Cashman <dcashman@android.com> - 2015-11-19 00:30 +0100
  [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base ASLR. Daniel Cashman <dcashman@android.com> - 2015-11-19 00:30 +0100
    Re: [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base  ASLR. Daniel Cashman <dcashman@android.com> - 2015-11-19 01:20 +0100
    Re: [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base  ASLR. Andrew Morton <akpm@linux-foundation.org> - 2015-11-25 01:50 +0100
      Re: [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base ASLR. Kees Cook <keescook@chromium.org> - 2015-11-25 01:50 +0100
        Re: [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base  ASLR. Daniel Cashman <dcashman@android.com> - 2015-11-25 20:20 +0100
    Re: [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base  ASLR. Michael Ellerman <mpe@ellerman.id.au> - 2015-11-25 05:50 +0100
      Re: [PATCH v3 1/4] mm: mmap: Add new /proc tunable for mmap_base  ASLR. Daniel Cashman <dcashman@android.com> - 2015-11-25 20:40 +0100
  Re: [PATCH v3 0/4] Allow customizable random offset to mmap_base  address. Andrew Morton <akpm@linux-foundation.org> - 2015-11-25 01:40 +0100
    Re: [PATCH v3 0/4] Allow customizable random offset to mmap_base  address. Daniel Cashman <dcashman@android.com> - 2015-11-25 20:10 +0100
      Re: [PATCH v3 0/4] Allow customizable random offset to mmap_base  address. Martin Schwidefsky <schwidefsky@de.ibm.com> - 2015-11-26 16:20 +0100
    Re: [PATCH v3 0/4] Allow customizable random offset to mmap_base  address. Michael Ellerman <mpe@ellerman.id.au> - 2015-11-26 08:10 +0100

csiph-web