Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-12-03 Thread Joseph Myers
On Thu, 3 Dec 2020, Florian Weimer wrote: > My knowledge of probability theory is quite limited, so I have to rely > on simulations. But I think you would see a 40 GiB gap somewhere for a > 47-bit address space with 32K allocations, most of the time. Which is > not too bad. This is very close

Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-12-03 Thread Matthew Wilcox
On Thu, Dec 03, 2020 at 09:42:54AM -0800, Andy Lutomirski wrote: > I suspect that something much more clever could be done in which the heap is > divided up into a few independently randomized sections and heap pages are > randomized within the sections might do much better. There should

Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-12-03 Thread Andy Lutomirski
> On Dec 3, 2020, at 9:29 AM, Florian Weimer wrote: > > * Andy Lutomirski: > >> If you want a 4GB allocation to succeed, you can only divide the >> address space into 32k fragments. Or, a little more precisely, if you >> want a randomly selected 4GB region to be empty, any other allocation

Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-12-03 Thread Florian Weimer
* Andy Lutomirski: > If you want a 4GB allocation to succeed, you can only divide the > address space into 32k fragments. Or, a little more precisely, if you > want a randomly selected 4GB region to be empty, any other allocation > has a 1/32k chance of being in the way. (Rough numbers — I’m

Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-12-03 Thread Andy Lutomirski
> On Dec 3, 2020, at 4:06 AM, Topi Miettinen wrote: > > On 3.12.2020 11.47, Florian Weimer wrote: >> * Topi Miettinen: >>> +3 Additionally enable full randomization of memory mappings created >>> +with mmap(NULL, ...). With 2, the base of the VMA used for such >>> +mappings is

Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-12-03 Thread Topi Miettinen
On 3.12.2020 11.47, Florian Weimer wrote: * Topi Miettinen: +3 Additionally enable full randomization of memory mappings created +with mmap(NULL, ...). With 2, the base of the VMA used for such +mappings is random, but the mappings are created in predictable +places within the

Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-12-03 Thread Florian Weimer
* Topi Miettinen: > +3 Additionally enable full randomization of memory mappings created > +with mmap(NULL, ...). With 2, the base of the VMA used for such > +mappings is random, but the mappings are created in predictable > +places within the VMA and in sequential order. With 3,

Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-11-30 Thread Topi Miettinen
On 30.11.2020 19.57, Andy Lutomirski wrote: On Sun, Nov 29, 2020 at 1:20 PM Topi Miettinen wrote: Writing a new value of 3 to /proc/sys/kernel/randomize_va_space enables full randomization of memory mappings created with mmap(NULL, ...). With 2, the base of the VMA used for such mappings is

Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-11-30 Thread Andy Lutomirski
On Sun, Nov 29, 2020 at 1:20 PM Topi Miettinen wrote: > > Writing a new value of 3 to /proc/sys/kernel/randomize_va_space > enables full randomization of memory mappings created with mmap(NULL, > ...). With 2, the base of the VMA used for such mappings is random, > but the mappings are created in

Re: [PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-11-29 Thread kernel test robot
Hi Topi, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on aae5ab854e38151e69f261dbf0e3b7e396403178] url: https://github.com/0day-ci/linux/commits/Topi-Miettinen/mm-Optional-full-ASLR-for-mmap-mremap-vdso-and-stack/20201130-051703 base:

[PATCH v5] mm: Optional full ASLR for mmap(), mremap(), vdso and stack

2020-11-29 Thread Topi Miettinen
Writing a new value of 3 to /proc/sys/kernel/randomize_va_space enables full randomization of memory mappings created with mmap(NULL, ...). With 2, the base of the VMA used for such mappings is random, but the mappings are created in predictable places within the VMA and in sequential order. With