When creating a shadow vm_object in vmspace_fork(), only one
reference count was transferred to the new object, but both the new and the old map entries had pointers to the new object. Correct this by transferring the second reference. This fixes a panic that can occur when mmap(2) is used with the MAP_INHERIT flag. PR: i386/25603 Reviewed by: dillon, alc
This commit is contained in:
parent
3f610476ac
commit
d30344bdfa
@ -2155,6 +2155,10 @@ vmspace_fork(vm1)
|
||||
&old_entry->offset,
|
||||
atop(old_entry->end - old_entry->start));
|
||||
old_entry->eflags &= ~MAP_ENTRY_NEEDS_COPY;
|
||||
/* Transfer the second reference too. */
|
||||
vm_object_reference(
|
||||
old_entry->object.vm_object);
|
||||
vm_object_deallocate(object);
|
||||
object = old_entry->object.vm_object;
|
||||
}
|
||||
vm_object_clear_flag(object, OBJ_ONEMAPPING);
|
||||
|
Loading…
x
Reference in New Issue
Block a user