How to disable address space randomization for a binary on Linux?

心已入冬 提交于 2019-11-28 21:23:13

Presumably you have some kind of daemon which invokes your parallel programs on the nodes. If so, you can make this common parent disable ASLR for any child processes it creates.

Look in GDB sources (7.0 or CVS Head) for how to do that. The gist of it is to call personality(orig_personality|ADDR_NO_RANDOMIZE) after fork and before exec.

Is there some reason you can't map a shared memory space or use a named FIFO?

At least some earlier versions of ASLR in the Linux kernel preserved offsets when forking. Rather than disabling randomization for your processes, might you simply be able to arrange them under a parent/child process hierarchy that kept the offsets the same between instances of the binary forked by the same parent?

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