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
-