mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
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
1 changed files with 1 additions and 3 deletions
|
|
@ -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 a new issue