linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denys Vlasenko <dvlasenk@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Jan Kratochvil <jan.kratochvil@redhat.com>,
	"Dmitry V. Levin" <ldv@altlinux.org>
Subject: Re: [PATCH] ptrace: make PTRACE_DETACH work on non-stopped tracees.
Date: Thu, 20 Jun 2013 01:19:26 +0200	[thread overview]
Message-ID: <51C23C7E.8000400@redhat.com> (raw)
In-Reply-To: <20130619163234.GA12029@redhat.com>

On 06/19/2013 06:32 PM, Oleg Nesterov wrote:
> On 06/19, Denys Vlasenko wrote:
>>
>> This is a user-visible behavior change.
>> Do we really have to introduce a separate
>> PTRACE_NOT_STUPID_DETACH? I hope not.
> 
> Oh, I think yes.
> 
>> @@ -1062,7 +1060,8 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
>>  	}
>>
>>  	ret = ptrace_check_attach(child, request == PTRACE_KILL ||
>> -				  request == PTRACE_INTERRUPT);
>> +				  request == PTRACE_INTERRUPT ||
>> +				  request == PTRACE_DETACH);
> 
> There doesn't look right.
> 
> For example ptrace_disable(). See the comment set_task_blockstep().

I see the comment. I think it implies that TF-induced debug
interrupt may happen on the running task after it is detached,
which will result in SIGTRAP being sent to it.
Correct me if I'm wrong.

If so, do we have the same problem if tracer exits
and implicit detach is performed?

-- 
vda


  reply	other threads:[~2013-06-19 23:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 15:15 [PATCH] ptrace: make PTRACE_DETACH work on non-stopped tracees Denys Vlasenko
2013-06-19 16:09 ` Jan Kratochvil
2013-06-19 16:42   ` Pedro Alves
2013-06-19 16:52     ` Oleg Nesterov
2013-06-19 16:32 ` Oleg Nesterov
2013-06-19 23:19   ` Denys Vlasenko [this message]
2013-06-20 13:41     ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51C23C7E.8000400@redhat.com \
    --to=dvlasenk@redhat.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=ldv@altlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).