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

2018-04-02 Thread Ilya Smith
> On 29 Mar 2018, at 00:07, Luck, Tony wrote: > >> The default limit of only 65536 VMAs will also quickly come into play >> if consecutive anon mmaps don't get merged. Of course this can be >> raised, but it has significant resource and performance (fork) costs. > > Could

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

2018-03-30 Thread Ilya Smith
Hi > On 30 Mar 2018, at 10:55, Pavel Machek wrote: > > Hi! > >> 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.

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

2018-03-28 Thread Ilya Smith
> On 28 Mar 2018, at 02:49, Matthew Wilcox wrote: > > On Tue, Mar 27, 2018 at 03:53:53PM -0700, Kees Cook wrote: >> I agree: pushing this off to libc leaves a lot of things unprotected. >> I think this should live in the kernel. The question I have is about >> making it

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

2018-03-28 Thread Ilya Smith
> On 28 Mar 2018, at 01:16, Theodore Y. Ts'o <ty...@mit.edu> wrote: > > On Tue, Mar 27, 2018 at 04:51:08PM +0300, Ilya Smith wrote: >>> /dev/[u]random is not sufficient? >> >> Using /dev/[u]random makes 3 syscalls - open, read, close. This is a >> perfo

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

2018-03-28 Thread Ilya Smith
> On 27 Mar 2018, at 17:38, Michal Hocko <mho...@kernel.org> wrote: > > On Tue 27-03-18 16:51:08, Ilya Smith wrote: >> >>> On 27 Mar 2018, at 10:24, Michal Hocko <mho...@kernel.org> wrote: >>> >>> On Mon 26-03-18 22:45:31, Ilya Smith wro

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

2018-03-23 Thread Ilya Smith
> On 23 Mar 2018, at 15:48, Matthew Wilcox <wi...@infradead.org> 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

Re: [RFC PATCH v2 2/2] Architecture defined limit on memory region random shift.

2018-03-23 Thread Ilya Smith
> On 22 Mar 2018, at 23:54, Andrew Morton wrote: > > > Please add changelogs. An explanation of what a "limit on memory > region random shift" is would be nice ;) Why does it exist, why are we > doing this, etc. Surely there's something to be said - at present this

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

2018-03-23 Thread Ilya Smith
Hello, Andrew Thanks for reading this patch. > On 22 Mar 2018, at 23:57, Andrew Morton <a...@linux-foundation.org> wrote: > > On Thu, 22 Mar 2018 19:36:36 +0300 Ilya Smith <blackz...@gmail.com> wrote: > >> Current implementation doesn't randomize address return

[RFC PATCH v2 1/2] Randomization of address chosen by mmap.

2018-03-22 Thread Ilya Smith
Signed-off-by: Ilya Smith <blackz...@gmail.com> --- include/linux/mm.h | 16 -- mm/mmap.c | 164 + 2 files changed, 175 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index ad06d42..c

[RFC PATCH v2 2/2] Architecture defined limit on memory region random shift.

2018-03-22 Thread Ilya Smith
Signed-off-by: Ilya Smith <blackz...@gmail.com> --- arch/alpha/kernel/osf_sys.c | 1 + arch/arc/mm/mmap.c | 1 + arch/arm/mm/mmap.c | 2 ++ arch/frv/mm/elf-fdpic.c | 1 + arch/ia64/kernel/sys_ia64.c | 1 + arch/ia64/mm/hugetlb

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

2018-03-22 Thread Ilya Smith
.969s echo 4 > /proc/sys/kernel/randomize_va_space make mrproper && make defconfig && time make real 11m12.806s user10m18.305s sys 1m4.281s Ilya Smith (2): Randomization of address chosen by mmap. Architecture defined limit on memory region random shift. arch/alpha/k