From: ebiederm@xmission.com (Eric W. Biederman)
To: Pavel Emelyanov <xemul@openvz.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] do_task_stat: don't use task_pid_nr_ns() lockless
Date: Mon, 19 Nov 2007 11:04:55 -0700 [thread overview]
Message-ID: <m1zlxaun5k.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <474157A7.1060504@openvz.org> (Pavel Emelyanov's message of "Mon, 19 Nov 2007 12:30:15 +0300")
Pavel Emelyanov <xemul@openvz.org> writes:
> Eric W. Biederman wrote:
>> We only get detached in release_task so it is a pretty small window
>> where we can return pid == 0. Usually get_task_pid will fail first
>> and we will return -ESRCH. Still the distance from open to
>>
>> There is another bug in here as well. current->nsproxy->pid_ns is wrong.
>> What we want is: ns = dentry->d_sb->s_fs_info;
>
> Actually I thought about this recently - if we produce the list
> of tasks based on the sb's namespace, then we should fill the
> tasks' files according to the sb's namespace as well, not according
> to the current namespace.
Exactly. That is the problem I was pointing out. Patch in a bit.
In do_proc_stat we are currently referencing current->nsproxy->pid_ns;
>> Otherwise we will have file descriptor passing races and the like.
>
> Can you elaborate?
Just the classic problem that if you use current at other then open
time the contents of the file descriptor may depend on who is reading
it which is problematic.
Eric
next prev parent reply other threads:[~2007-11-19 18:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-17 18:31 Oleg Nesterov
2007-11-17 20:11 ` Eric W. Biederman
2007-11-19 9:30 ` Pavel Emelyanov
2007-11-19 18:04 ` Eric W. Biederman [this message]
2007-11-19 9:31 ` Pavel Emelyanov
2007-11-19 21:59 ` [PATCH 0/4] proc: Cleanup status files Eric W. Biederman
2007-11-19 22:04 ` [PATCH 1/4] proc: Implement proc_single_file_operations Eric W. Biederman
2007-11-19 22:06 ` [PATCH 2/4] proc: Rewrite do_task_stat to correctly handle pid namespaces Eric W. Biederman
2007-11-19 22:10 ` [PATCH 3/4] proc: seqfile convert proc_pid_status to properly " Eric W. Biederman
2007-11-19 22:13 ` [PATCH] proc: seqfile convert proc_pid_statm Eric W. Biederman
2007-11-20 10:34 ` [PATCH 0/4] proc: Cleanup status files Pavel Emelyanov
2007-11-19 22:30 ` [PATCH] proc: Proper pidns handling for /proc/self Eric W. Biederman
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=m1zlxaun5k.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@tv-sign.ru \
--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
all inboxes | Powered by JetHome®