Skip to content

Bypass PT_DENY_ATTACH entirely#750

Draft
khanhduytran0 wants to merge 1 commit intoopa334:2.xfrom
khanhduytran0:2.x
Draft

Bypass PT_DENY_ATTACH entirely#750
khanhduytran0 wants to merge 1 commit intoopa334:2.xfrom
khanhduytran0:2.x

Conversation

@khanhduytran0
Copy link
Copy Markdown

This PR allows debugserver to attach to processes blocking debugger using ptrace(PT_DENY_ATTACH). It does 2 things:

  • If a process already has PT_DENY_ATTACH, it temporarily clears P_LNOATTACH from p_lflag before calling ptrace and restores it afterwards
  • P_LTRACED flag is cleared from p_lflagso that any calls to ptrace(PT_DENY_ATTACH) take no effect. This might cause issues, so idk whether to keep it or make it a toggle.

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

Successfully merging this pull request may close these issues.

2 participants