1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

vmspace_fork: preserve wx settings in the child vm map after fork

Noted by:	markj
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Konstantin Belousov 2021-01-12 08:09:59 +02:00
parent ff1a307801
commit 9402bb44f1

View File

@ -4303,7 +4303,8 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_charge)
}
new_map->anon_loc = old_map->anon_loc;
new_map->flags |= old_map->flags & (MAP_ASLR | MAP_ASLR_IGNSTART);
new_map->flags |= old_map->flags & (MAP_ASLR | MAP_ASLR_IGNSTART |
MAP_WXORX);
VM_MAP_ENTRY_FOREACH(old_entry, old_map) {
if ((old_entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0)