Separate mmap area from program loading (relocation) area

We need to separate the two because the heap of a PIE is created in
the area to which it is mapped.

Related commits:

b1309a5d: PIE is mapped at map_end instead of at
          user_start
c4219655: Interpreter is mapped to map_start to make a
          system call that dereferences a NULL pointer fail

[dominique.martinet@cea.fr: Also add ULONG_MAX and friend macroes,
 used for data_min]
[ken.sato.ty@hitachi-solutions.com: fix execve]
Change-Id: I8ecaf22b7965090ab67bebece57c68283ba23664
This commit is contained in:
Masamichi Takagi
2019-01-15 09:48:28 +00:00
committed by Dominique Martinet
parent 97e0219f50
commit 4d215de641
5 changed files with 31 additions and 19 deletions

View File

@ -2598,6 +2598,11 @@ SYSCALL_DECLARE(execve)
((char *)thread) +
KERNEL_STACK_NR_PAGES * PAGE_SIZE, desc->entry, 0);
/* map_start / map_end is used to track memory area
* to which the program is loaded
*/
vm->region.map_start = vm->region.map_end = LD_TASK_UNMAPPED_BASE;
/* Create virtual memory ranges and update args/envs */
if (prepare_process_ranges_args_envs(thread, desc, desc,
PTATTR_NO_EXECUTE | PTATTR_WRITABLE | PTATTR_FOR_USER,