Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_mmap.c
| Show First 20 Lines • Show All 347 Lines • ▼ Show 20 Lines | if (addr + size > MAP_32BIT_MAX_ADDR) | ||||
| addr = 0; | addr = 0; | ||||
| #endif | #endif | ||||
| } else { | } else { | ||||
| /* | /* | ||||
| * XXX for non-fixed mappings where no hint is provided or | * XXX for non-fixed mappings where no hint is provided or | ||||
| * the hint would fall in the potential heap space, | * the hint would fall in the potential heap space, | ||||
| * place it after the end of the largest possible heap. | * place it after the end of the largest possible heap. | ||||
| * | * | ||||
| * There should really be a pmap call to determine a reasonable | * For anonymous mappings within the address space of the | ||||
| * location. | * calling process, the absence of a hint is handled at a | ||||
| * lower level in order to implement different clustering | |||||
| * strategies for ASLR. | |||||
| */ | */ | ||||
| if (addr == 0 || | if (((flags & MAP_ANON) == 0 && addr == 0) || | ||||
| (addr >= round_page((vm_offset_t)vms->vm_taddr) && | (addr >= round_page((vm_offset_t)vms->vm_taddr) && | ||||
| addr < round_page((vm_offset_t)vms->vm_daddr + | addr < round_page((vm_offset_t)vms->vm_daddr + | ||||
| lim_max(td, RLIMIT_DATA)))) | lim_max(td, RLIMIT_DATA)))) | ||||
| addr = round_page((vm_offset_t)vms->vm_daddr + | addr = round_page((vm_offset_t)vms->vm_daddr + | ||||
| lim_max(td, RLIMIT_DATA)); | lim_max(td, RLIMIT_DATA)); | ||||
| } | } | ||||
| if (len == 0) { | if (len == 0) { | ||||
| /* | /* | ||||
| ▲ Show 20 Lines • Show All 1,313 Lines • Show Last 20 Lines | |||||