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

BPatch_binaryEdit::writeFile() fails for stack diversification #311

Closed
morehouse opened this issue Jan 17, 2017 · 4 comments
Closed

BPatch_binaryEdit::writeFile() fails for stack diversification #311

morehouse opened this issue Jan 17, 2017 · 4 comments
Assignees
Labels

Comments

@morehouse
Copy link
Contributor

morehouse commented Jan 17, 2017

Starting at commit 31fcb13, BPatch_binaryEdit::writeFile() returns false and fails to instrument with StackMods when using stack diversification. Probing further reveals that writeFile() is returning false because AddressSpace::patch() is returning false.

Note that the problematic commit originally fixed #111, so we wouldn't want to just revert it. It is also possible that the problem originated with earlier changes to codegen-x86.C but was hidden by issue #111 until this commit.

Steps to reproduce
Needed files:

  • Everything in /p/paradyn/development/mm/projects/performStackMods
  • Everything in /p/paradyn/development/mm/projects/utils
  • /p/paradyn/development/mm/projects/bashrc

How to compile:

  1. Copy necessary folders/files to your own machine. Keep the relative locations of the performStackMods folder and the utils folder the same.
  2. Modify bashrc to point DYNINST_ROOT to your Dyninst install directory and TOOLS_ROOT to the directory containing the performStackMods and utils folders.
  3. Execute . bashrc
  4. Run make clean && make inside utils/getExecutableProcedures, utils/getFunction, and performStackMods/

How to run:
./performStackMods -b tonto-orig -o tonto-rewrite -v -d

@jdetter
Copy link
Contributor

jdetter commented Jan 17, 2017

Thank you for the detailed issue. I will start looking at this today!

@jdetter
Copy link
Contributor

jdetter commented Jan 19, 2017

I can confirm this issue still exists at 7803215, I think it's likely the issue actually was introduced at the merge fae68e6. Also I'm not sure why but the reproducer is running really really slow on these older commits (runs taking about 20 minutes). @morehouse are there any smaller binaries that you can find that reproduce this issue?

@jdetter
Copy link
Contributor

jdetter commented Jan 24, 2017

@morehouse Any more issues here?

@morehouse
Copy link
Contributor Author

Looks good to merge. The issues I'm having now are related to StackMod. This issue is fixed by your pull request.

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

No branches or pull requests

2 participants