lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211011143150.318239-2-sxwjean@me.com>
Date:   Mon, 11 Oct 2021 22:31:45 +0800
From:   sxwjean@...com
To:     linux-mm@...ck.org, x86@...nel.org
Cc:     Xiongwei Song <sxwjean@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Kees Cook <keescook@...omium.org>,
        "H. Peter Anvin" <hpa@...or.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Andy Lutomirski <luto@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Arnd Bergmann <arnd@...db.de>,
        Al Viro <viro@...iv.linux.org.uk>,
        Gabriel Krisman Bertazi <krisman@...labora.com>,
        Lai Jiangshan <laijs@...ux.alibaba.com>,
        Huang Rui <ray.huang@....com>,
        Yazen Ghannam <yazen.ghannam@....com>,
        Kim Phillips <kim.phillips@....com>,
        Oleg Nesterov <oleg@...hat.com>,
        Balbir Singh <sblbir@...zon.com>,
        "David S. Miller" <davem@...emloft.net>, sxwjean@...com,
        linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/6] mm/util: Assign a meaningful value to mmap_legacy_base

From: Xiongwei Song <sxwjean@...il.com>

Let's assign a value to mmap_legacy_base in case the mmap() of some
archs needs mmap_legacy_base, like x86.

Signed-off-by: Xiongwei Song <sxwjean@...il.com>
---
 mm/util.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/util.c b/mm/util.c
index e58151a61255..40b1a8837c0b 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -414,7 +414,8 @@ void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack)
 		random_factor = arch_mmap_rnd();
 
 	if (mmap_is_legacy(rlim_stack)) {
-		mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
+		mm->mmap_legacy_base = TASK_UNMAPPED_BASE + random_factor;
+		mm->mmap_base = mm->mmap_legacy_base;
 		mm->get_unmapped_area = arch_get_unmapped_area;
 	} else {
 		mm->mmap_base = mmap_base(random_factor, rlim_stack);
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ