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

前端 未结 3 1963
攒了一身酷
攒了一身酷 2020-12-14 18:56

I\'m working on a runtime system for parallel programs that can take advantage of a common address space layout across multiple processes, potentially spread over several (t

相关标签:
3条回答
  • 2020-12-14 19:25

    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?

    0 讨论(0)
  • 2020-12-14 19:32

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

    0 讨论(0)
  • 2020-12-14 19:45

    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.

    0 讨论(0)
提交回复
热议问题