Re: [RFC PATCH v2 0/2] Randomization of address chosen by mmap.

Ilya Smith
2018-03-23T17:25:15Z

Hello, Andrew

Thanks for reading this patch.

> On 22 Mar 2018, at 23:57, Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Thu, 22 Mar 2018 19:36:36 +0300 Ilya Smith <blackzert@gmail.com> wrote:
>
>> Current implementation doesn't randomize address returned by mmap.
>> All the entropy ends with choosing mmap_base_addr at the process
>> creation. After that mmap build very predictable layout of address
>> space. It allows to bypass ASLR in many cases.
>
> Perhaps some more effort on the problem description would help. *Are*
> people predicting layouts at present? What problems does this cause?
> How are they doing this and are there other approaches to solving the
> problem?
>
Sorry, I’ve lost it in first version. In short - memory layout could be easily
repaired by single leakage. Also any Out of Bounds error may easily be
exploited according to current implementation. All because mmap choose address
just before previously allocated segment. You can read more about it here:
http://www.openwall.com/lists/oss-security/2018/02/27/5
Some test are available here https://github.com/blackzert/aslur.
To solve the problem Kernel should randomize address on any mmap so
attacker could never easily gain needed addresses.

> Mainly: what value does this patchset have to our users? This reader
> is unable to determine that from the information which you have
> provided. Full details, please.

The value of this patch is to decrease successful rate of exploitation
vulnerable applications.These could be either remote or local vectors.