Limiting the heap area's Virtual address range

时光总嘲笑我的痴心妄想 提交于 2021-01-28 02:06:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!