-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i#38: Attach injection on Linux (#5019)
Enables attach injection on Linux. Adds an -attach option to drrun. Builds on the existing partial ptrace injection support. Handles the problem of attaching when the target was in the middle of an auto-restart syscall, where the kernel will report to the tracer that PC is at the next instruction after syscall, but will set it back to syscall instruction by subtracting PC (PC -= sizeof(syscall)) after continuation. The default handling waits for the syscall to complete by single-stepping. The -skip_syscall drrun option enables an alternate handling which aborts the syscall and returns -EINTR (adjusting the kernel's ERESTARTSYS). This may break the app as an auto-restart syscall is not expected to return, and is only implemented for x86 for now due to lack of testing in arm/aarch64. A regression test will be added separately. Co-authored-by: Yibai Zhang <[email protected]> Co-authored-by: Derek Bruening <[email protected]>
- Loading branch information
1 parent
e296135
commit bf246bf
Showing
4 changed files
with
291 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.