c++ - 两个进程可以通过 ptrace 附加到同一个 PID
问题描述
所以,标题说明了一切。
一个进程有可能有两个跟踪器吗?
我正在玩 ptrace,我可以看到每当有人附加到进程时,然后在 TracerPID 下的 /proc//status 中将是跟踪器的 PID。但是,是否可以有两个示踪剂?
我有两个程序(tracer 和 tracee)。我在调试模式下运行 tracee,然后运行 tracer,并得到错误 Operation not allowed(即使具有 root 权限)。
问候,戈洛比奇
解决方案
他们不能。在 ptrace 手册页中间接确认了这一点:
EPERM The specified process cannot be traced. This could be because
the tracer has insufficient privileges (the required capability
is CAP_SYS_PTRACE); unprivileged processes cannot trace pro‐
cesses that they cannot send signals to or those running set-
user-ID/set-group-ID programs, for obvious reasons. Alterna‐
tively, the process may already be being traced, or (on kernels
before 2.6.26) be init(1) (PID 1).
推荐阅读
- java - 跨多个服务器的每个客户端的 API 命中数
- python - 如何限制从 txt 文件中读取的总字数
- powershell - 测试路径,检查文件是否存在
- angular - 时间格式,如角度 8 中的 (hh:mm)
- aws-lambda - 如何在 Cloudformation 脚本执行期间将 Cognito UserPoolID、客户端密码传递给 AWS Lambda?
- wso2 - WSO2 bps:如何从 BPS 上的 BPEL 流程调用不在 ESB 上运行的 REST 服务
- pandas - 附加功能不适用于DataFrame
- excel - 在 excel VBA 中使用 Shell cmd 返回错误 53
- ios - 安装存档版本时无法安装应用程序
- javascript - 谷歌云函数与多个获取请求异步