Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Oct 2009 17:51:46 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197712 - head/sys/vm
Message-ID:  <200910021751.n92Hpkrk008597@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Fri Oct  2 17:51:46 2009
New Revision: 197712
URL: http://svn.freebsd.org/changeset/base/197712

Log:
  Back out the functional parts from r197537.  After r197711, affecting all
  user mappings, mmap no longer needs special treatment.

Modified:
  head/sys/vm/vm_mmap.c

Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c	Fri Oct  2 17:48:51 2009	(r197711)
+++ head/sys/vm/vm_mmap.c	Fri Oct  2 17:51:46 2009	(r197712)
@@ -97,14 +97,6 @@ SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap,
     "Maximum number of memory-mapped files per process");
 
 /*
- * 'mmap_zero' determines whether or not MAP_FIXED mmap() requests for
- * virtual address zero are permitted.
- */
-static int mmap_zero;
-SYSCTL_INT(_security_bsd, OID_AUTO, mmap_zero, CTLFLAG_RW, &mmap_zero, 0,
-    "Processes may map an object at virtual address zero");
-
-/*
  * Set the maximum number of vm_map_entry structures per process.  Roughly
  * speaking vm_map_entry structures are tiny, so allowing them to eat 1/100
  * of our KVM malloc space still results in generous limits.  We want a
@@ -277,13 +269,6 @@ mmap(td, uap)
 		if (addr & PAGE_MASK)
 			return (EINVAL);
 
-		/*
-		 * Mapping to address zero is only permitted if
-		 * mmap_zero is enabled.
-		 */
-		if (addr == 0 && !mmap_zero)
-			return (EINVAL);
-
 		/* Address range must be all in user VM space. */
 		if (addr < vm_map_min(&vms->vm_map) ||
 		    addr + size > vm_map_max(&vms->vm_map))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910021751.n92Hpkrk008597>