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]
Date:	Sat, 23 Feb 2008 16:14:05 +0800
From:	WANG Cong <xiyou.wangcong@...il.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	WANG Cong <xiyou.wangcong@...il.com>,
	Christoph Hellwig <hch@...radead.org>,
	Christoph Lameter <clameter@....com>
Subject: [PATCH 02/16] mm: use get_personality()

Use get_personality() macro instead of explicit reference
for mm/ code.

Signed-off-by: WANG Cong <xiyou.wangcong@...il.com>
Cc: Christoph Hellwig <hch@...radead.org>
Cc: Christoph Lameter <clameter@....com> 

---
 mm/mmap.c     |    2 +-
 mm/mprotect.c |    2 +-
 mm/nommu.c    |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index a32d28c..42d647f 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -910,7 +910,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
 	 * (the exception is when the underlying filesystem is noexec
 	 *  mounted, in which case we dont add PROT_EXEC.)
 	 */
-	if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC))
+	if ((prot & PROT_READ) && (get_personality() & READ_IMPLIES_EXEC))
 		if (!(file && (file->f_path.mnt->mnt_flags & MNT_NOEXEC)))
 			prot |= PROT_EXEC;
 
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 4de5468..620b8db 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -237,7 +237,7 @@ sys_mprotect(unsigned long start, size_t len, unsigned long prot)
 	/*
 	 * Does the application expect PROT_READ to imply PROT_EXEC:
 	 */
-	if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC))
+	if ((prot & PROT_READ) && (get_personality() & READ_IMPLIES_EXEC))
 		prot |= PROT_EXEC;
 
 	vm_flags = calc_vm_prot_bits(prot);
diff --git a/mm/nommu.c b/mm/nommu.c
index 5d8ae08..a1c6162 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -665,7 +665,7 @@ static int validate_mmap_request(struct file *file,
 		}
 		else if ((prot & PROT_READ) && !(prot & PROT_EXEC)) {
 			/* handle implication of PROT_EXEC by PROT_READ */
-			if (current->personality & READ_IMPLIES_EXEC) {
+			if (get_personality() & READ_IMPLIES_EXEC) {
 				if (capabilities & BDI_CAP_EXEC_MAP)
 					prot |= PROT_EXEC;
 			}
@@ -686,7 +686,7 @@ static int validate_mmap_request(struct file *file,
 
 		/* handle PROT_EXEC implication by PROT_READ */
 		if ((prot & PROT_READ) &&
-		    (current->personality & READ_IMPLIES_EXEC))
+		    (get_personality() & READ_IMPLIES_EXEC))
 			prot |= PROT_EXEC;
 	}
 
-- 
1.5.3.8

--
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