mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Aquire vm mutex when releasing sysv shm segments.
Obtained from: Dima Dorfman <dima@unixfreak.org>
This commit is contained in:
parent
387acdd9ff
commit
67d1f21cbe
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76908
@ -182,7 +182,9 @@ shm_deallocate_segment(shmseg)
|
||||
size_t size;
|
||||
|
||||
shm_handle = shmseg->shm_internal;
|
||||
mtx_lock(&vm_mtx);
|
||||
vm_object_deallocate(shm_handle->shm_object);
|
||||
mtx_unlock(&vm_mtx);
|
||||
free((caddr_t)shm_handle, M_SHM);
|
||||
shmseg->shm_internal = NULL;
|
||||
size = round_page(shmseg->shm_segsz);
|
||||
@ -203,7 +205,9 @@ shm_delete_mapping(p, shmmap_s)
|
||||
segnum = IPCID_TO_IX(shmmap_s->shmid);
|
||||
shmseg = &shmsegs[segnum];
|
||||
size = round_page(shmseg->shm_segsz);
|
||||
mtx_lock(&vm_mtx);
|
||||
result = vm_map_remove(&p->p_vmspace->vm_map, shmmap_s->va, shmmap_s->va + size);
|
||||
mtx_unlock(&vm_mtx);
|
||||
if (result != KERN_SUCCESS)
|
||||
return EINVAL;
|
||||
shmmap_s->shmid = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user