login
Header Space

 
 

Re: [PATCH] do_task_stat: don't use task_pid_nr_ns() lockless

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Oleg Nesterov <oleg@...>
Cc: Andrew Morton <akpm@...>, Pavel Emelyanov <xemul@...>, <linux-kernel@...>
Date: Saturday, November 17, 2007 - 4:11 pm

Oleg Nesterov <oleg@tv-sign.ru> writes:


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;

Otherwise we will have file descriptor passing races and the like.

We could also do: proc_pid(inode) to get the pid, which is a little
more race free, and will prevent us from returning pid == 0.

In either event it looks like we need to implement some proper
file operations for these proc files, maybe even going to seq file
status.

Eric
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] do_task_stat: don't use task_pid_nr_ns() lockless, Oleg Nesterov, (Sat Nov 17, 2:31 pm)
[PATCH] proc: Proper pidns handling for /proc/self, Eric W. Biederman, (Mon Nov 19, 6:30 pm)
Re: [PATCH] do_task_stat: don't use task_pid_nr_ns() lockless, Eric W. Biederman, (Sat Nov 17, 4:11 pm)
Re: [PATCH] do_task_stat: don't use task_pid_nr_ns() lockless, Eric W. Biederman, (Mon Nov 19, 2:04 pm)
[PATCH 0/4] proc: Cleanup status files., Eric W. Biederman, (Mon Nov 19, 5:59 pm)
Re: [PATCH 0/4] proc: Cleanup status files., Pavel Emelyanov, (Tue Nov 20, 6:34 am)
[PATCH 1/4] proc: Implement proc_single_file_operations, Eric W. Biederman, (Mon Nov 19, 6:04 pm)
[PATCH 2/4] proc: Rewrite do_task_stat to correctly handle p..., Eric W. Biederman, (Mon Nov 19, 6:06 pm)
[PATCH 3/4] proc: seqfile convert proc_pid_status to properl..., Eric W. Biederman, (Mon Nov 19, 6:10 pm)
[PATCH] proc: seqfile convert proc_pid_statm, Eric W. Biederman, (Mon Nov 19, 6:13 pm)
speck-geostationary