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>] [day] [month] [year] [list]
Date:	Tue, 14 Jan 2014 18:27:52 +0100
From:	Richard Weinberger <richard@....at>
To:	akpm@...ux-foundation.org
Cc:	viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, pat-lkml@...ey.org,
	Richard Weinberger <richard@....at>
Subject: [PATCH v2] Call arch_pick_mmap_layout() only once

Currently both setup_new_exec() and flush_old_exec() issue
a call to arch_pick_mmap_layout().
As setup_new_exec() and flush_old_exec() are always called
pairwise arch_pick_mmap_layout() is called twice.

This patch removes one call from setup_new_exec() to have
it only called once.

Tested-by: Pat Erley <pat-lkml@...ey.org>
Signed-off-by: Richard Weinberger <richard@....at>
---
Changes between v1 and v2:

Pat reported that v1 broke IA32 emulation on x86_64.
It turned out that we have to keep the second call to
arch_pick_mmap_layout() and are free to remove the first
one. v1 did it the other way around.
This is needed because only the latter call will see all
current->personality flags.

diff --git a/fs/exec.c b/fs/exec.c
index 7ea097f..a733599 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -843,7 +843,6 @@ static int exec_mmap(struct mm_struct *mm)
 	tsk->active_mm = mm;
 	activate_mm(active_mm, mm);
 	task_unlock(tsk);
-	arch_pick_mmap_layout(mm);
 	if (old_mm) {
 		up_read(&old_mm->mmap_sem);
 		BUG_ON(active_mm != old_mm);
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ