Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMPLEMENT_RANDOMIZE_STACK #2

Open
DavidBurkett opened this issue Aug 23, 2019 · 2 comments
Open

IMPLEMENT_RANDOMIZE_STACK #2

DavidBurkett opened this issue Aug 23, 2019 · 2 comments

Comments

@DavidBurkett
Copy link

I was hoping to see your thoughts on IMPLEMENT_RANDOMIZE_STACK when you documented ThreadOpenConnections, but I saw it was glossed over. It's always been something that bothered me for some reason.

  1. Why not just use built-in ASLR? Pretty sure VS and mingw supported it.
  2. How does it actually work? It doesn't seem like it should, but I'm a bit of a simpleton.
  3. Have you ever seen anyone do anything similar? I've looked at a lot of old C/C++ code, and have never come across anything like it.
@marsmensch
Copy link

marsmensch commented Aug 30, 2019

My educated guess is that he either didn't know or he was aware of the limitations of ASLR back then and decided to "roll-his-own".

Even today when the entire base system in Windows 10 uses ASLR, image randomization on Windows is per-boot, not per-process. This means that attackers can guess the location of code pretty reliably. The stack itself is randomized per-process though.

ASLR was indeed available (w/ the release of Windows Vista in 2007): https://docs.microsoft.com/en-us/cpp/build/reference/dynamicbase-use-address-space-layout-randomization?view=vs-2019

Forgot to add some relevant references:
bitcoin/bitcoin#1130
bitcoin/bitcoin#1603

@jaysonmald35
Copy link

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants