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 deployment API and injection API on linux #840

Open
derekbruening opened this issue Nov 28, 2014 · 5 comments
Open

implement deployment API and injection API on linux #840

derekbruening opened this issue Nov 28, 2014 · 5 comments

Comments

@derekbruening
Copy link
Contributor

From [email protected] on July 11, 2012 20:18:22

on Windows there are 2 APIs that are completely missing on Linux: the
deployment API (core/lib/dr_config.h) and the injection API
(core/lib/dr_inject.h)

on Windows, drdeploy, drrun, and the Dr. Memory front-end use both API's

on Linux, once we have better injection than just LD_PRELOAD-based, it
would be nice to match the same API's to allow for programmatic front-ends
and get away from layers of scripts.

xref issue #47 : early injection on Linux
xref issue #37 : targeted injection on Linux via ptrace

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=840

@derekbruening
Copy link
Contributor Author

From [email protected] on August 25, 2012 13:42:16

Are there any aspects of the API that we'd like to change? How many existing clients of it are there? I've been looking at this and I feel like there are two pain points:

  1. Linux doesn't have OS support for creating a suspended process, but the config API takes pids everywhere. To implement this API, we'd have to teach DR how to suspend itself on startup, or return a fake pid.
  2. This API is really stateful. You can see some of the pain points in the code under ifndef PARAMS_IN_REGISTRY, where the config file is read and shifted up so drconfiglib can write a single config variable in place.

Between these two issues, is that enough to warrant changing the API? I'm imagining something where we create an opaque "config" object that the caller updates with the process name, client list, options, mode, etc, and then explicitly saves the config when they are done with it.

@derekbruening
Copy link
Contributor Author

From [email protected] on August 26, 2012 10:55:57

I realized that for creating a suspended process, we can use fork() and then send SIGSTOP to ourselves before doing the exec. That should be good enough for matching the drinject API without too much trouble.

@derekbruening
Copy link
Contributor Author

From [email protected] on October 05, 2012 11:48:55

Most of drconfig and drinject were implemented in r1588 , r1591 , and r1620 .

What's left to port is:

  • dr_nudge_*()
  • dr_registered_process_iterator*()
  • syswide registration

The nudge API and the iterator shouldn't be too hard, but I may split out the syswide registration as another issue.

Owner: [email protected]

@derekbruening
Copy link
Contributor Author

From [email protected] on March 26, 2014 13:45:41

We need dr_nudge_pid() for Dr. Memory issue #1130

Owner: ---

@derekbruening
Copy link
Contributor Author

To make it clearer, one remaining action item here is merging the nudgeunix tool into drdeploy.c to provide nudge support from drconfig. This would include a detach nudge once #95 is complete (along with a detach nudge on Windows which used to be only in the deprecated drcontrol: part of #725).

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

No branches or pull requests

1 participant