How to choose a fixed address for shared memory mapping

后端 未结 4 1273
终归单人心
终归单人心 2021-02-13 16:16

I would like to use shared memory between several processes, and would like to be able to keep using raw pointers (and stl containers).

For this purpose, I am using sh

4条回答
  •  粉色の甜心
    2021-02-13 17:14

    Don't use hard-coded absolute addresses as shared memory area for security reasons, even when you don't uses forks or threads. This bypasses all ASLR protections. It enables any attacker predictable locations in the process' address space. It is pretty easy to search for such hard-coded pointers in a binary.

    You've been choosen by http://reversingonwindows.blogspot.sg/2013/12/hardcoded-pointers.html as example how to make software less secure, bypassing ASLR. The 2nd bad example is in the boost library.

    The address space needs to be negotiated between the communicating parties at run-time.

提交回复
热议问题