HomeFreeBSD

Avoid unnecessary calls to vm_map_protect() in elf_load_section().

Description

Avoid unnecessary calls to vm_map_protect() in elf_load_section().

Typically, when elf_load_section() unconditionally passed VM_PROT_ALL to
elf_map_insert(), it was needlessly enabling execute access on the
mapping, and it would later have to call vm_map_protect() to correct the
mapping's access rights. Now, instead, elf_load_section() always passes
its parameter "prot" to elf_map_insert(). So, elf_load_section() must
only call vm_map_protect() if it needs to remove the write access that
was temporarily granted to perform a copyout().

Reviewed by: kib
MFC after: 1 week

Details

Provenance
alcAuthored on
Reviewer
kib
Parents
rS315517: MFC r308339:
Branches
Unknown
Tags
Unknown