Re: [PATCH] mm: optionally disable brk()

2020-11-01 Thread Topi Miettinen
On 5.10.2020 15.18, David Hildenbrand wrote: On 05.10.20 13:21, David Laight wrote: From: David Hildenbrand Sent: 05 October 2020 10:55 ... If hardening and compatibility are seen as tradeoffs, perhaps there could be a top level config choice (CONFIG_HARDENING_TRADEOFF) for this. It would

Re: [PATCH] mm: optionally disable brk()

2020-10-07 Thread Topi Miettinen
On 5.10.2020 15.25, David Laight wrote: From: David Hildenbrand Sent: 05 October 2020 13:19 On 05.10.20 13:21, David Laight wrote: From: David Hildenbrand Sent: 05 October 2020 10:55 ... If hardening and compatibility are seen as tradeoffs, perhaps there could be a top level config choice

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread Topi Miettinen
On 5.10.2020 17.12, Jonathan Corbet wrote: On Mon, 5 Oct 2020 11:11:35 +0300 Topi Miettinen wrote: The point is not to shrink the kernel (it will shrink by one small function) or get rid of complexity. The point is to disable an inferior interface. Memory returned by mmap() is at a random

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread Jonathan Corbet
On Mon, 5 Oct 2020 11:11:35 +0300 Topi Miettinen wrote: > The point is not to shrink the kernel (it will shrink by one small > function) or get rid of complexity. The point is to disable an inferior > interface. Memory returned by mmap() is at a random location but with > brk() it is located

RE: [PATCH] mm: optionally disable brk()

2020-10-05 Thread David Laight
From: David Hildenbrand > Sent: 05 October 2020 13:19 > > On 05.10.20 13:21, David Laight wrote: > > From: David Hildenbrand > >> Sent: 05 October 2020 10:55 > > ... > >>> If hardening and compatibility are seen as tradeoffs, perhaps there > >>> could be a top level config choice

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread David Hildenbrand
On 05.10.20 13:21, David Laight wrote: > From: David Hildenbrand >> Sent: 05 October 2020 10:55 > ... >>> If hardening and compatibility are seen as tradeoffs, perhaps there >>> could be a top level config choice (CONFIG_HARDENING_TRADEOFF) for this. >>> It would have options >>> - "compatibility"

RE: [PATCH] mm: optionally disable brk()

2020-10-05 Thread David Laight
From: David Hildenbrand > Sent: 05 October 2020 10:55 ... > > If hardening and compatibility are seen as tradeoffs, perhaps there > > could be a top level config choice (CONFIG_HARDENING_TRADEOFF) for this. > > It would have options > > - "compatibility" (default) to gear questions for maximum

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread David Hildenbrand
On 05.10.20 11:47, Topi Miettinen wrote: > On 5.10.2020 12.13, David Hildenbrand wrote: >> On 05.10.20 08:12, Michal Hocko wrote: >>> On Sat 03-10-20 00:44:09, Topi Miettinen wrote: On 2.10.2020 20.52, David Hildenbrand wrote: > On 02.10.20 19:19, Topi Miettinen wrote: >> The brk()

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread Topi Miettinen
On 5.10.2020 12.13, David Hildenbrand wrote: On 05.10.20 08:12, Michal Hocko wrote: On Sat 03-10-20 00:44:09, Topi Miettinen wrote: On 2.10.2020 20.52, David Hildenbrand wrote: On 02.10.20 19:19, Topi Miettinen wrote: The brk() system call allows to change data segment size (heap). This is

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread Michal Hocko
On Mon 05-10-20 11:13:48, David Hildenbrand wrote: > On 05.10.20 08:12, Michal Hocko wrote: > > On Sat 03-10-20 00:44:09, Topi Miettinen wrote: > >> On 2.10.2020 20.52, David Hildenbrand wrote: > >>> On 02.10.20 19:19, Topi Miettinen wrote: > The brk() system call allows to change data

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread David Hildenbrand
On 05.10.20 08:12, Michal Hocko wrote: > On Sat 03-10-20 00:44:09, Topi Miettinen wrote: >> On 2.10.2020 20.52, David Hildenbrand wrote: >>> On 02.10.20 19:19, Topi Miettinen wrote: The brk() system call allows to change data segment size (heap). This is mainly used by glibc for memory

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread Topi Miettinen
On 5.10.2020 11.22, Michal Hocko wrote: On Mon 05-10-20 11:11:35, Topi Miettinen wrote: [...] I think hardened, security oriented systems should disable brk() completely because it will increase the randomization of the process address space (ASLR). This wouldn't be a good option to enable for

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread Michal Hocko
On Mon 05-10-20 11:11:35, Topi Miettinen wrote: [...] > I think hardened, security oriented systems should disable brk() completely > because it will increase the randomization of the process address space > (ASLR). This wouldn't be a good option to enable for systems where maximum > compatibility

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread Topi Miettinen
On 5.10.2020 9.12, Michal Hocko wrote: On Sat 03-10-20 00:44:09, Topi Miettinen wrote: On 2.10.2020 20.52, David Hildenbrand wrote: On 02.10.20 19:19, Topi Miettinen wrote: The brk() system call allows to change data segment size (heap). This is mainly used by glibc for memory allocation, but

Re: [PATCH] mm: optionally disable brk()

2020-10-05 Thread Michal Hocko
On Sat 03-10-20 00:44:09, Topi Miettinen wrote: > On 2.10.2020 20.52, David Hildenbrand wrote: > > On 02.10.20 19:19, Topi Miettinen wrote: > > > The brk() system call allows to change data segment size (heap). This > > > is mainly used by glibc for memory allocation, but it can use mmap() > > >

Re: [PATCH] mm: optionally disable brk()

2020-10-02 Thread Topi Miettinen
On 2.10.2020 20.52, David Hildenbrand wrote: On 02.10.20 19:19, Topi Miettinen wrote: The brk() system call allows to change data segment size (heap). This is mainly used by glibc for memory allocation, but it can use mmap() and that results in more randomized memory mappings since the heap is

RE: [PATCH] mm: optionally disable brk()

2020-10-02 Thread David Laight
From: David Hildenbrand > Sent: 02 October 2020 18:52 > > On 02.10.20 19:19, Topi Miettinen wrote: > > The brk() system call allows to change data segment size (heap). This > > is mainly used by glibc for memory allocation, but it can use mmap() > > and that results in more randomized memory

Re: [PATCH] mm: optionally disable brk()

2020-10-02 Thread David Hildenbrand
On 02.10.20 19:19, Topi Miettinen wrote: > The brk() system call allows to change data segment size (heap). This > is mainly used by glibc for memory allocation, but it can use mmap() > and that results in more randomized memory mappings since the heap is > always located at fixed offset to

[PATCH] mm: optionally disable brk()

2020-10-02 Thread Topi Miettinen
The brk() system call allows to change data segment size (heap). This is mainly used by glibc for memory allocation, but it can use mmap() and that results in more randomized memory mappings since the heap is always located at fixed offset to program while mmap()ed memory is randomized.