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: <alpine.LSU.2.00.1001051232530.1055@sister.anvils>
Date:	Tue, 5 Jan 2010 12:37:19 +0000 (GMT)
From:	Hugh Dickins <hugh.dickins@...cali.co.uk>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
cc:	Eric B Munson <ebmunson@...ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Al Viro <viro@...IV.linux.org.uk>,
	David Howells <dhowells@...hat.com>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH] nommu: reject MAP_HUGETLB

We've agreed to restore the rejection of MAP_HUGETLB to nommu.
Mimic what happens with mmu when hugetlb is not configured in:
say -ENOSYS, but -EINVAL if MAP_ANONYMOUS was not given too.

Signed-off-by: Hugh Dickins <hugh.dickins@...cali.co.uk>
---

 mm/nommu.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- 2.6.33-rc2-git/mm/nommu.c	2009-12-31 08:08:16.000000000 +0000
+++ linux/mm/nommu.c	2010-01-05 12:08:01.000000000 +0000
@@ -1405,6 +1405,14 @@ SYSCALL_DEFINE6(mmap_pgoff, unsigned lon
 	struct file *file = NULL;
 	unsigned long retval = -EBADF;
 
+	if (unlikely(flags & MAP_HUGETLB)) {
+		if (flags & MAP_ANONYMOUS)
+			retval = -ENOSYS;	/* like hugetlb_file_setup */
+		else
+			retval = -EINVAL;
+		goto out;
+	}
+
 	if (!(flags & MAP_ANONYMOUS)) {
 		file = fget(fd);
 		if (!file)
--
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