Re: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-10 Thread Topi Miettinen
On 3.12.2020 8.58, Mike Rapoport wrote: On Wed, Dec 02, 2020 at 08:49:06PM +0200, Topi Miettinen wrote: On 1.12.2020 23.45, Topi Miettinen wrote: Memory mappings inside kernel allocated with vmalloc() are in predictable order and packed tightly toward the low addresses. With new kernel boot

Re: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-09 Thread Topi Miettinen
On 3.12.2020 8.58, Mike Rapoport wrote: On Wed, Dec 02, 2020 at 08:49:06PM +0200, Topi Miettinen wrote: On 1.12.2020 23.45, Topi Miettinen wrote: Memory mappings inside kernel allocated with vmalloc() are in predictable order and packed tightly toward the low addresses. With new kernel boot

Re: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-04 Thread Topi Miettinen
On 4.12.2020 15.33, David Laight wrote: From: Topi Miettinen Sent: 04 December 2020 10:58 On 4.12.2020 1.15, David Laight wrote: From: Mike Rapoport Sent: 03 December 2020 06:58 On Wed, Dec 02, 2020 at 08:49:06PM +0200, Topi Miettinen wrote: On 1.12.2020 23.45, Topi Miettinen wrote:

RE: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-04 Thread David Laight
From: Topi Miettinen > Sent: 04 December 2020 10:58 > > On 4.12.2020 1.15, David Laight wrote: > > From: Mike Rapoport > >> Sent: 03 December 2020 06:58 > >> > >> On Wed, Dec 02, 2020 at 08:49:06PM +0200, Topi Miettinen wrote: > >>> On 1.12.2020 23.45, Topi Miettinen wrote: > Memory mappings

Re: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-04 Thread Topi Miettinen
On 4.12.2020 1.15, David Laight wrote: From: Mike Rapoport Sent: 03 December 2020 06:58 On Wed, Dec 02, 2020 at 08:49:06PM +0200, Topi Miettinen wrote: On 1.12.2020 23.45, Topi Miettinen wrote: Memory mappings inside kernel allocated with vmalloc() are in predictable order and packed tightly

RE: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-03 Thread David Laight
From: Mike Rapoport > Sent: 03 December 2020 06:58 > > On Wed, Dec 02, 2020 at 08:49:06PM +0200, Topi Miettinen wrote: > > On 1.12.2020 23.45, Topi Miettinen wrote: > > > Memory mappings inside kernel allocated with vmalloc() are in > > > predictable order and packed tightly toward the low

Re: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-02 Thread Mike Rapoport
On Wed, Dec 02, 2020 at 08:49:06PM +0200, Topi Miettinen wrote: > On 1.12.2020 23.45, Topi Miettinen wrote: > > Memory mappings inside kernel allocated with vmalloc() are in > > predictable order and packed tightly toward the low addresses. With > > new kernel boot parameter 'randomize_vmalloc=1',

Re: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-02 Thread Topi Miettinen
On 2.12.2020 20.53, Matthew Wilcox wrote: On Tue, Dec 01, 2020 at 11:45:47PM +0200, Topi Miettinen wrote: + /* Randomize allocation */ + if (randomize_vmalloc) { + voffset = get_random_long() & (roundup_pow_of_two(vend - vstart) - 1); + voffset =

Re: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-02 Thread Matthew Wilcox
On Tue, Dec 01, 2020 at 11:45:47PM +0200, Topi Miettinen wrote: > + /* Randomize allocation */ > + if (randomize_vmalloc) { > + voffset = get_random_long() & (roundup_pow_of_two(vend - > vstart) - 1); > + voffset = PAGE_ALIGN(voffset); > + if (voffset +

Re: [PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-02 Thread Topi Miettinen
On 1.12.2020 23.45, Topi Miettinen wrote: Memory mappings inside kernel allocated with vmalloc() are in predictable order and packed tightly toward the low addresses. With new kernel boot parameter 'randomize_vmalloc=1', the entire area is used randomly to make the allocations less predictable

[PATCH] mm/vmalloc: randomize vmalloc() allocations

2020-12-01 Thread Topi Miettinen
Memory mappings inside kernel allocated with vmalloc() are in predictable order and packed tightly toward the low addresses. With new kernel boot parameter 'randomize_vmalloc=1', the entire area is used randomly to make the allocations less predictable and harder to guess for attackers. Without