From 83ca0706a08e2e32c10abf95c27b116c6f923610 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Fri, 13 Dec 2024 19:44:19 +0100 Subject: [PATCH] Revert "mm: randomize lower bits of brk" This reverts commit 2994f3aa26c5cb28981ba2ee4c9d2bdd2ef2bbc1. --- mm/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/util.c b/mm/util.c index 5ab0673cd..70b975249 100755 --- a/mm/util.c +++ b/mm/util.c @@ -372,9 +372,9 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) { /* Is the current task 32bit ? */ if (!IS_ENABLED(CONFIG_64BIT) || is_compat_task()) - return mm->brk + get_random_long() % SZ_32M; + return randomize_page(mm->brk, SZ_32M); - return mm->brk + get_random_long() % SZ_1G; + return randomize_page(mm->brk, SZ_1G); } unsigned long arch_mmap_rnd(void)