Messages in this thread | | | Date | Tue, 30 Apr 2013 19:51:38 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH 6/6] ptrace: PTRACE_DETACH should do flush_ptrace_hw_breakpoint(child) |
| |
On 04/30, Frederic Weisbecker wrote: > > On Mon, Apr 29, 2013 at 06:40:38PM +0200, Oleg Nesterov wrote: > > > No, I think this (minor) problem is very old... At least, when I look > > at 2.6.26 code I do not see anything which coould clear db regs on > > detach. > > Ok, if so then the conversion to perf hasn't changed much the picture I think.
God knows ;) afaik there are not too much users.
But fyi, this conversion fixed some problems. For example, the content of db registers we copied by copy_process iirc.
And, I didn't verify this, it seems that the old code didn't set _RF bit so PTRACE_CONT should probably trigger the same bp again...
> The breakpoints have just stayed persistent across > tracers.
Yes.
And. This conversion allows us to implement the generic arch-independent PTRACE_GET/SET_HWBP api, the current PTRACE_{PEEK,POKE}USR(u_debugreg) api is really awkward.
> > Btw. perhaps flush_ptrace_hw_breakpoint() should also clear the > > virtual registers like thread.debugreg7 ? Even without this patch, > > flush_ is also called exec. > > Yeah makes sense.
OK, and probably debugreg6 too, but I need to recheck.
Thanks Frederic for your review!
Oleg.
| |