linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm: Fix personality(ADDR_NO_RANDOMIZE)
@ 2017-08-14 15:57 Kirill A. Shutemov
  2017-08-14 16:13 ` Cyrill Gorcunov
  0 siblings, 1 reply; 6+ messages in thread
From: Kirill A. Shutemov @ 2017-08-14 15:57 UTC (permalink / raw)
  To: Linus Torvalds, x86, Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: Andrew Morton, Andy Lutomirski, Dmitry Safonov, Cyrill Gorcunov,
	Borislav Petkov, linux-mm, linux-kernel, Kirill A. Shutemov,
	stable

In v4.12, during rework of infrastructure around mmap_base, disable-ASLR
personality flag got accidentally broken.

Let's make it work again.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Fixes: 1b028f784e8c ("x86/mm: Introduce mmap_compat_base() for 32-bit mmap()")
Cc: stable <stable@vger.kernel.org> [4.12+]
---
 arch/x86/mm/mmap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index 229d04a83f85..779bdbe5e424 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -127,6 +127,8 @@ static unsigned long mmap_legacy_base(unsigned long rnd,
 static void arch_pick_mmap_base(unsigned long *base, unsigned long *legacy_base,
 		unsigned long random_factor, unsigned long task_size)
 {
+	if (!(current->flags & PF_RANDOMIZE))
+		random_factor = 0;
 	*legacy_base = mmap_legacy_base(random_factor, task_size);
 	if (mmap_is_legacy())
 		*base = *legacy_base;
-- 
2.14.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-08-14 16:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14 15:57 [PATCH] x86/mm: Fix personality(ADDR_NO_RANDOMIZE) Kirill A. Shutemov
2017-08-14 16:13 ` Cyrill Gorcunov
2017-08-14 16:20   ` Oleg Nesterov
2017-08-14 16:26     ` Kirill A. Shutemov
2017-08-14 16:28     ` Cyrill Gorcunov
2017-08-14 16:22   ` Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox