diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2024-03-28 09:40:50 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-03-29 00:32:46 +0100 |
commit | df19628b2b6665468e698e290dfd1568720ba042 (patch) | |
tree | f021003706eb8cd45f95e7be96953a230e246334 /kern/bootstrap.c | |
parent | ced537ad297754e08b19536102712c692c949f44 (diff) | |
download | gnumach-df19628b2b6665468e698e290dfd1568720ba042.tar.gz gnumach-df19628b2b6665468e698e290dfd1568720ba042.tar.bz2 gnumach-df19628b2b6665468e698e290dfd1568720ba042.zip |
elf-load: Respect PT_GNU_STACK
If a bootstrap ELF contains a PT_GNU_STACK phdr, take stack protection
from there. Otherwise, default to VM_PROT_ALL.
Diffstat (limited to 'kern/bootstrap.c')
-rw-r--r-- | kern/bootstrap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c index 49358ac6..0470e1b6 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -620,10 +620,10 @@ build_args_and_stack(struct exec_info *boot_exec_info, stack_size = round_page(STACK_SIZE); stack_base = user_stack_low(stack_size); - (void) vm_allocate(current_task()->map, - &stack_base, - stack_size, - FALSE); + (void) vm_map(current_map(), &stack_base, stack_size, + 0, FALSE, IP_NULL, 0, FALSE, + boot_exec_info->stack_prot, VM_PROT_ALL, + VM_INHERIT_DEFAULT); arg_pos = (char *) set_user_regs(stack_base, stack_size, boot_exec_info, arg_len); |