process_madvise(), pidfd capabilities, and the revenge of the PIDs
process_madvise(), pidfd capabilities, and the revenge of the PIDs
Posted Jan 21, 2020 15:50 UTC (Tue) by cyphar (subscriber, #110703)Parent article: process_madvise(), pidfd capabilities, and the revenge of the PIDs
While I do understand wanting to maintain support for PIDs in newer syscalls (after all, in some cases you only get a PID from a user or other program), I don't think that a tracer program would be written in the way described. It's far more likely that the tracer would already have a pidfd open for each process it is tracing. But then again, since ptrace (and ptrace-related syscalls) doesn't use pidfds, it would also be fair to say that the interface mismatch would make the code ugly no matter what.
Posted Jan 21, 2020 19:32 UTC (Tue)
by rvolgers (guest, #63218)
[Link] (4 responses)
Of course, porting it would take quite a lot of effort probably, nevermind deprecating the old interface so all the cruft can be removed, but one can dream.
Posted Jan 21, 2020 19:52 UTC (Tue)
by roc (subscriber, #30627)
[Link]
Posted Jan 21, 2020 19:58 UTC (Tue)
by roc (subscriber, #30627)
[Link] (2 responses)
I would really like the ability to hand-off ptrace control to other processes by passing them a pidfd, but that would require lots more work. Something like:
Posted Jan 21, 2020 22:52 UTC (Tue)
by Paf (subscriber, #91811)
[Link] (1 responses)
I’m not really familiar with that part of ptrace, but I have had to look at the signal handling dance and it is a *mess*. (Not incorrect in any way, just... messy)
Posted Jan 22, 2020 2:44 UTC (Wed)
by roc (subscriber, #30627)
[Link]
process_madvise(), pidfd capabilities, and the revenge of the PIDs
process_madvise(), pidfd capabilities, and the revenge of the PIDs
process_madvise(), pidfd capabilities, and the revenge of the PIDs
* Make sure pidfd_wait or whatever can read the special ptrace status events.
* When pidfds are used, break the "ptrace parent" relationship in the kernel so *any* process with a pidfd for the tracee can ptrace() it or get the ptrace status events. (I bet this is *really* hard.)
But it would make much-requested rr features, like the ability to start debugging an in-progress rr recording without interrupting it, much more tractable.
process_madvise(), pidfd capabilities, and the revenge of the PIDs
process_madvise(), pidfd capabilities, and the revenge of the PIDs