Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jun 2013 04:32:54 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251285 - head/sys/kern
Message-ID:  <201306030432.r534WsnH007971@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Jun  3 04:32:53 2013
New Revision: 251285
URL: http://svnweb.freebsd.org/changeset/base/251285

Log:
  Do not map the shared page COW.  If the process wired its address
  space, fork(2) would cause shadowing of the physical object and
  copying of the shared page into private copy, effectively preventing
  updates for the exported timehands structure and stopping the clock.
  
  Specify the maximum allowed permissions for the page to be read and
  execute, preventing write from the user mode.
  
  Reported and tested by:	<huanghwh@yahoo.com>
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Mon Jun  3 04:22:42 2013	(r251284)
+++ head/sys/kern/kern_exec.c	Mon Jun  3 04:32:53 2013	(r251285)
@@ -1050,8 +1050,9 @@ exec_new_vmspace(imgp, sv)
 		vm_object_reference(obj);
 		error = vm_map_fixed(map, obj, 0,
 		    sv->sv_shared_page_base, sv->sv_shared_page_len,
-		    VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_ALL,
-		    MAP_COPY_ON_WRITE | MAP_ACC_NO_CHARGE);
+		    VM_PROT_READ | VM_PROT_EXECUTE,
+		    VM_PROT_READ | VM_PROT_EXECUTE,
+		    MAP_INHERIT_SHARE | MAP_ACC_NO_CHARGE);
 		if (error) {
 			vm_object_deallocate(obj);
 			return (error);



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