All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>, Tejun Heo <tj@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Add new PTRACE_O_TRACESTOP option, make it control new ptrace behavior.
Date: Wed, 7 Sep 2011 06:55:05 +0200	[thread overview]
Message-ID: <201109070655.05898.vda.linux@googlemail.com> (raw)
In-Reply-To: <20110906200818.GA28349@redhat.com>

On Tuesday 06 September 2011 22:08, Oleg Nesterov wrote:
> On 09/05, Denys Vlasenko wrote:
> >
> > Add new PTRACE_O_TRACESTOP option, make it control new ptrace behavior.
> >
> > Introduce new ptrace option, PTRACE_O_TRACESTOP. This makes API
> > more symmetric: every PTRACE_EVENT_event has corresponding PTRACE_O_TRACEevent now,
> > as it used to have before PTRACE_SEIZE was introduced.
> >
> > PTRACE_SEIZE does not assume PTRACE_O_TRACESTOP, but with this patch
> > it allows any PTRACE_O_opts to be set at attach time
> 
> Well. This assumes that the only difference with PTRACE_SEIZE is the
> new stop/interrupt behaviour. I am not sure this is "safe" to assume.

I'd say that with this change, PTRACE_SEIZE is just PTRACE_ATTACH
with the possibility to set options on attach. Nothing more.

> Tejun, what do you think?


> >  int ptrace_request(struct task_struct *child, long request,
> >  		   unsigned long addr, unsigned long data)
> >  {
> > -	bool seized = child->ptrace & PT_SEIZED;
> > +	bool stop_events_enabled = child->ptrace & PT_TRACE_STOP;
> 
> May be ptrace_event_enabled(child, PTRACE_EVENT_STOP) looks better...
> The same about other PT_TRACE_STOP checks, although this is cosmetic.

Good idea. I will send a new patch a bit later.

> And. Given that you can set/clear PT_TRACE_STOP in ptrace_setoptions(),
> you need the locking.
>
> Just for example. do_signal_stop() calls ptrace_trap_notify() and hits
> WARN_ON_ONCE(!PT_TRACE_STOP) because it was cleared in between.

PTRACE_SETOPTIONS can be used only on stopped tracees. Can do_signal_stop()
run on a tracee while it is stopped?

-- 
vda

  parent reply	other threads:[~2011-09-07  4:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-04 21:11 RFC: PTRACE_SEIZE needs API cleanup? Denys Vlasenko
2011-09-05  1:15 ` Indan Zupancic
2011-09-05  9:24   ` Denys Vlasenko
2011-09-05 13:08     ` Indan Zupancic
2011-09-05 14:06       ` Denys Vlasenko
2011-09-05 17:21         ` Indan Zupancic
2011-09-06  0:59           ` Denys Vlasenko
2011-09-06 17:08             ` Indan Zupancic
2011-09-07  2:34               ` Denys Vlasenko
2011-09-07 17:15                 ` Indan Zupancic
2011-09-05 17:44         ` Indan Zupancic
2011-09-06  1:05           ` Denys Vlasenko
2011-09-06 17:19             ` Indan Zupancic
2011-09-07  2:47               ` Denys Vlasenko
2011-09-07 14:24                 ` Indan Zupancic
2011-09-05 14:54 ` Denys Vlasenko
2011-09-05 16:51 ` [PATCH 1/2] Fix pollution of task->ptrace if PTRACE_SETOPTIONS fails Denys Vlasenko
2011-09-05 17:01 ` [PATCH 2/2] Denys Vlasenko
2011-09-05 17:06 ` [PATCH 2/2] Add new PTRACE_O_TRACESTOP option, make it control new ptrace behavior Denys Vlasenko
2011-09-06 20:08   ` Oleg Nesterov
2011-09-06 23:06     ` Tejun Heo
2011-09-07  4:55     ` Denys Vlasenko [this message]
2011-09-07 16:37       ` Oleg Nesterov
2011-09-06 16:52 ` [PATCH v2] Fix clearing of task->ptrace if PTRACE_SETOPTIONS fails Denys Vlasenko
2011-09-06 18:43   ` Oleg Nesterov
2011-09-07  4:44     ` Denys Vlasenko
2011-09-07  4:45     ` [PATCH v3] " Denys Vlasenko
2011-09-07 20:35       ` 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=201109070655.05898.vda.linux@googlemail.com \
    --to=vda.linux@googlemail.com \
    --cc=dvlasenk@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.