问题
I need to do some brute-force searching in process VA space for my study and hence would like limit my heap area's virtual address range. OS course told me that heap is anywhere between data and stack pages. So I want to shrink my process VA range by doing the following:
- Have a custom linker script that gave start and end of data somewhere very high in address range (0x7f45f88a6000)
- Tweak fs/binfmt_elf.c to have stack top as (0x8f45f88a6000) instead of randomly picking.
- Assume my program uses only mmap with NULL as addresses
Can I safely assume that my heap(brk) will be between this address range. Also can I assume all mmap(NULL, other args) calls will return between this address range?
If not what is the fix for this? I am willing to change kernel source code, but where?
来源:https://stackoverflow.com/questions/32905284/limiting-the-heap-areas-virtual-address-range