public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, Pavel Emelyanov <xemul@openvz.org>,
	Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] ptrace: do_notify_parent_cldstop: fix the wrong ->nsproxy usage
Date: Tue, 26 May 2009 23:33:47 +0200	[thread overview]
Message-ID: <20090526213346.GA7073@redhat.com> (raw)
In-Reply-To: <20090526210514.C1C91FC2BD@magilla.sf.frob.com>

On 05/26, Roland McGrath wrote:
>
> Acked-by: Roland McGrath <roland@redhat.com>
>
> Yes, all cases setting .si_pid should set it using the pid_ns of the
> recipient.  Numerous other cases look wrong too, though maybe Sukadev has
> outstanding patches for those already?  (It's been a while since we went
> around on this, and I am fuzzy on some of the details.)  ptrace_notify,
> ptrace_signal,

Yes. Perhaps it would be nice to add a helper,

	task_pid_xxx(struct task_struct child, struct task_struct *parent)
	{
		rcu_read_lock();
		ret = task_pid_nr_ns(tsk, parent->nsproxy->pid_ns);
		rcu_read_unlock();

		return ret;
	}

ptrace_notify/ptrace_signal can race with untrace + clear ->nsproxy,
probably we don't care.

> sys_kill, do_tkill all look wrong to me.

They should be fine, note the

	if (from_ancestor_ns)
		q->info.si_pid = 0;

in __send_signal(). If we send the signal "down" to the sub-namespace,
si_pid == 0 is correct. And, unlike do_notify_parent/ptrace_notify/etc
kill/tkill can't send the signal "up".

Oleg.


  reply	other threads:[~2009-05-26 21:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-25 18:55 [PATCH 1/1] ptrace: do_notify_parent_cldstop: fix the wrong ->nsproxy usage Oleg Nesterov
2009-05-25 19:39 ` Oleg Nesterov
2009-05-27  1:06   ` Roland McGrath
2009-05-27 23:24     ` Oleg Nesterov
2009-05-26 21:05 ` Roland McGrath
2009-05-26 21:33   ` Oleg Nesterov [this message]
2009-05-27  0:55     ` Roland McGrath
2009-06-02  4:54       ` Sukadev Bhattiprolu
2009-06-05 15:43         ` naresh kamboju
2009-06-06  0:19           ` Roland McGrath
2009-06-06  6:47           ` open_posix_testsuite: STOP + CONT + wait hang? Oleg Nesterov
2009-06-17  8:35             ` naresh kamboju
2009-06-17 13:29               ` Oleg Nesterov
2009-06-17 14:34                 ` naresh kamboju
2009-05-27 21:32   ` [PATCH 1/1] ptrace: do_notify_parent_cldstop: fix the wrong ->nsproxy usage Oleg Nesterov
2009-05-27 22:23     ` Roland McGrath
2009-05-27 23:12       ` Oleg Nesterov
2009-05-27 23:26         ` Roland McGrath
2009-05-27 23:43           ` Oleg Nesterov
2009-05-27 23:51             ` Roland McGrath
2009-05-28  0:05               ` Oleg Nesterov
2009-06-02  4:48 ` Sukadev Bhattiprolu

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=20090526213346.GA7073@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=sukadev@linux.vnet.ibm.com \
    --cc=xemul@openvz.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox