Ignore the P_SYSTEM process flag, and do not request

VM_MAP_WIRE_SYSTEM mode when wiring the newly grown stack.

System maps do not create auto-grown stack.  Any stack we handled,
even for P_SYSTEM, must be for user address space.  P_SYSTEM processes
with mapped user space is either init(8) or an aio worker attached to
other user process with aio buffer pointing into stack area.  In either
case, VM_MAP_WIRE_USER mode should be used.

Noted and reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2017-06-19 20:40:59 +00:00
parent 254a06e0b3
commit 212e02c836

View File

@ -3891,9 +3891,7 @@ Retry:
vm_map_wire(map,
(stack_entry == next_entry) ? addr : addr - grow_amount,
(stack_entry == next_entry) ? stack_entry->start : addr,
(p->p_flag & P_SYSTEM)
? VM_MAP_WIRE_SYSTEM|VM_MAP_WIRE_NOHOLES
: VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES);
VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES);
}
out: