Re: [RFC PATCH v2 0/2] Randomization of address chosen by mmap.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Matthew Wilcox <willy@xxxxxxxxxxxxx>, Rich Felker <dalias@xxxxxxxx>
- Subject: Re: [RFC PATCH v2 0/2] Randomization of address chosen by mmap.
- From: Rob Landley <rob@xxxxxxxxxxx>
- Date: Tue, 27 Mar 2018 23:50:02 -0500
- Cc: Ilya Smith <blackzert@xxxxxxxxx>, rth@xxxxxxxxxxx, ink@xxxxxxxxxxxxxxxxxxxx, mattst88@xxxxxxxxx, vgupta@xxxxxxxxxxxx, linux@xxxxxxxxxxxxxxx, tony.luck@xxxxxxxxx, fenghua.yu@xxxxxxxxx, jhogan@xxxxxxxxxx, ralf@xxxxxxxxxxxxxx, jejb@xxxxxxxxxxxxxxxx, deller@xxxxxx, benh@xxxxxxxxxxxxxxxxxxx, paulus@xxxxxxxxx, mpe@xxxxxxxxxxxxxx, schwidefsky@xxxxxxxxxx, heiko.carstens@xxxxxxxxxx, ysato@xxxxxxxxxxxxxxxxxxxx, davem@xxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, hpa@xxxxxxxxx, x86@xxxxxxxxxx, nyc@xxxxxxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, arnd@xxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, deepa.kernel@xxxxxxxxx, mhocko@xxxxxxxx, hughd@xxxxxxxxxx, kstewart@xxxxxxxxxxxxxxxxxxx, pombredanne@xxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, steve.capper@xxxxxxx, punit.agrawal@xxxxxxx, paul.burton@xxxxxxxx, aneesh.kumar@xxxxxxxxxxxxxxxxxx, npiggin@xxxxxxxxx, keescook@xxxxxxxxxxxx, bhsharma@xxxxxxxxxx, riel@xxxxxxxxxx, nitin.m.gupta@xxxxxxxxxx, kirill.shutemov@xxxxxxxxxxxxxxx, dan.j.williams@xxxxxxxxx, jack@xxxxxxx, ross.zwisler@xxxxxxxxxxxxxxx, jglisse@xxxxxxxxxx, aarcange@xxxxxxxxxx, oleg@xxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-metag@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx
- In-reply-to: <20180323190618.GA23763@bombadil.infradead.org>
- References: <1521736598-12812-1-git-send-email-blackzert@gmail.com> <20180323124806.GA5624@bombadil.infradead.org> <20180323180024.GB1436@brightrain.aerifal.cx> <20180323190618.GA23763@bombadil.infradead.org>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
On 03/23/2018 02:06 PM, Matthew Wilcox wrote:
> On Fri, Mar 23, 2018 at 02:00:24PM -0400, Rich Felker wrote:
>> On Fri, Mar 23, 2018 at 05:48:06AM -0700, Matthew Wilcox wrote:
>>> On Thu, Mar 22, 2018 at 07:36:36PM +0300, Ilya Smith 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. This patch make
>>>> randomization of address on any mmap call.
>>>
>>> Why should this be done in the kernel rather than libc? libc is perfectly
>>> capable of specifying random numbers in the first argument of mmap.
>>
>> Generally libc does not have a view of the current vm maps, and thus
>> in passing "random numbers", they would have to be uniform across the
>> whole vm space and thus non-uniform once the kernel rounds up to avoid
>> existing mappings.
>
> I'm aware that you're the musl author, but glibc somehow manages to
> provide etext, edata and end, demonstrating that it does know where at
> least some of the memory map lies.
You can parse /proc/self/maps, but it's really expensive and disgusting.
Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]