Re: [PATCH] Introduce Vpid: in /proc/self/status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2011-06-11 at 18:46 -0700, Eric W. Biederman wrote:
> Greg Kurz <gkurz@xxxxxxxxxx> writes:
> 
> > Since pid namespaces were introduced, there's a recurring demand: how one
> > can correlate a pid from a child pid ns with a pid from a parent pid ns ?
> > The need arises in the LXC community when one wants to send a signal from
> > the host (aka. init_pid_ns context) to a container process for which one
> > only knows the pid inside the container.
> 

Eric,

Thanks for your comments.

> You are missing taking the sighand lock which is needed to make
> task_active_pid_ns safe when called on something other than current.
> 

Ohh... to prevent __exit_signal()->__unhash_process() to detach the pids
in our back, correct ? A comment in <linux/pid_namespace.h> would be
appreciated... 

> I really don't like the name VPid, perhaps Process Pid.  There is
> nothing more or less virtual about any pid, so calling any of the
> virtual is not clear, and misleading.
> 

Or 'Active Pid', since we're relying on task_active_pid_ns(). IOW the
output is what the process gets when calling getpid().

> I'm not exactly certain that /proc/self/status is the right place
> for this but this does seem reasonable.
> 

Well... I didn't want to add another file and status is the easier one
to patch without breaking anything. It seemed reasonable indeed.

> For what it's worth if you are communicating through anything except
> a pid file unix domain sockets will give you a race free to get the
> pid of the process on the other end.
> 

I'm in a pid file scenario for the moment... but this could change, so
I'll give a try to the SCM_CREDENTIALS stuff.

Cheers.

-- 
Gregory Kurz                                     gkurz@xxxxxxxxxx
Software Engineer @ IBM/Meiosys                  http://www.ibm.com
Tel +33 (0)534 638 479                           Fax +33 (0)561 400 420

"Anarchy is about taking complete responsibility for yourself."
        Alan Moore.

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers


[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux