svn commit: r232117 - in stable/9/sys: i386/conf kern

Alan Cox alc at FreeBSD.org
Fri Feb 24 17:50:24 UTC 2012


Author: alc
Date: Fri Feb 24 17:50:23 2012
New Revision: 232117
URL: http://svn.freebsd.org/changeset/base/232117

Log:
  MFC r231904
    Close a race due to dropping of the map lock between creating a map entry
    for a shared mapping and marking the entry for inheritance.

Modified:
  stable/9/sys/kern/sysv_shm.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)

Modified: stable/9/sys/kern/sysv_shm.c
==============================================================================
--- stable/9/sys/kern/sysv_shm.c	Fri Feb 24 17:26:06 2012	(r232116)
+++ stable/9/sys/kern/sysv_shm.c	Fri Feb 24 17:50:23 2012	(r232117)
@@ -413,14 +413,12 @@ kern_shmat(td, shmid, shmaddr, shmflg)
 	vm_object_reference(shmseg->object);
 	rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object,
 	    0, &attach_va, size, (flags & MAP_FIXED) ? VMFS_NO_SPACE :
-	    VMFS_ANY_SPACE, prot, prot, 0);
+	    VMFS_ANY_SPACE, prot, prot, MAP_INHERIT_SHARE);
 	if (rv != KERN_SUCCESS) {
 		vm_object_deallocate(shmseg->object);
 		error = ENOMEM;
 		goto done2;
 	}
-	vm_map_inherit(&p->p_vmspace->vm_map,
-		attach_va, attach_va + size, VM_INHERIT_SHARE);
 
 	shmmap_s->va = attach_va;
 	shmmap_s->shmid = shmid;


More information about the svn-src-stable-9 mailing list