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. Reviewed by: kib X-MFC after: r231526
This commit is contained in:
parent
3e2f30f6dd
commit
7dc0ace10e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=231904
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user