Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-22 Thread Eric W. Biederman
Konstantin Khlebnikov writes: > On 21.09.2015 17:22, Serge E. Hallyn wrote: >> >> So please implement it, as Eric suggested, using the ns inode fds >> instead of racy pid_t hints for namespaces. >> > > I don't want to loose simple way to use it. > Sometimes caller cannot prevent races (task its

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-22 Thread Konstantin Khlebnikov
On 21.09.2015 17:22, Serge E. Hallyn wrote: On Mon, Sep 21, 2015 at 10:49:39AM +0800, Chen Fan wrote: On 09/17/2015 12:31 AM, Serge E. Hallyn wrote: On Wed, Sep 16, 2015 at 09:49:02AM -0500, Eric W. Biederman wrote: "Serge E. Hallyn" writes: On Wed, Sep 16, 2015 at 10:37:33AM +0300,

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-22 Thread Eric W. Biederman
Konstantin Khlebnikov writes: > On 21.09.2015 17:22, Serge E. Hallyn wrote: >> >> So please implement it, as Eric suggested, using the ns inode fds >> instead of racy pid_t hints for namespaces. >> > > I don't want to loose simple way to use it. > Sometimes caller

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-22 Thread Konstantin Khlebnikov
On 21.09.2015 17:22, Serge E. Hallyn wrote: On Mon, Sep 21, 2015 at 10:49:39AM +0800, Chen Fan wrote: On 09/17/2015 12:31 AM, Serge E. Hallyn wrote: On Wed, Sep 16, 2015 at 09:49:02AM -0500, Eric W. Biederman wrote: "Serge E. Hallyn" writes: On Wed, Sep 16, 2015 at

Re: Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-21 Thread Serge E. Hallyn
On Mon, Sep 21, 2015 at 10:49:39AM +0800, Chen Fan wrote: > > On 09/17/2015 12:31 AM, Serge E. Hallyn wrote: > >On Wed, Sep 16, 2015 at 09:49:02AM -0500, Eric W. Biederman wrote: > >>"Serge E. Hallyn" writes: > >> > >>>On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin Khlebnikov wrote: >

Re: Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-21 Thread Serge E. Hallyn
On Mon, Sep 21, 2015 at 10:49:39AM +0800, Chen Fan wrote: > > On 09/17/2015 12:31 AM, Serge E. Hallyn wrote: > >On Wed, Sep 16, 2015 at 09:49:02AM -0500, Eric W. Biederman wrote: > >>"Serge E. Hallyn" writes: > >> > >>>On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin

Re: Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-20 Thread Chen Fan
On 09/17/2015 12:31 AM, Serge E. Hallyn wrote: On Wed, Sep 16, 2015 at 09:49:02AM -0500, Eric W. Biederman wrote: "Serge E. Hallyn" writes: On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin Khlebnikov wrote: On 15.09.2015 20:41, Serge Hallyn wrote: Quoting Stéphane Graber

Re: Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-20 Thread Chen Fan
On 09/17/2015 12:31 AM, Serge E. Hallyn wrote: On Wed, Sep 16, 2015 at 09:49:02AM -0500, Eric W. Biederman wrote: "Serge E. Hallyn" writes: On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin Khlebnikov wrote: On 15.09.2015 20:41, Serge Hallyn wrote: Quoting Stéphane

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-16 Thread Serge E. Hallyn
On Wed, Sep 16, 2015 at 09:49:02AM -0500, Eric W. Biederman wrote: > "Serge E. Hallyn" writes: > > > On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin Khlebnikov wrote: > >> On 15.09.2015 20:41, Serge Hallyn wrote: > >> >Quoting Stéphane Graber (stgra...@ubuntu.com): > >> >>On Tue, Sep 15,

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-16 Thread Eric W. Biederman
"Serge E. Hallyn" writes: > On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin Khlebnikov wrote: >> On 15.09.2015 20:41, Serge Hallyn wrote: >> >Quoting Stéphane Graber (stgra...@ubuntu.com): >> >>On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: >> >>>On 15.09.2015 17:27,

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-16 Thread Serge E. Hallyn
On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin Khlebnikov wrote: > On 15.09.2015 20:41, Serge Hallyn wrote: > >Quoting Stéphane Graber (stgra...@ubuntu.com): > >>On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: > >>>On 15.09.2015 17:27, Eric W. Biederman wrote: >

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-16 Thread Konstantin Khlebnikov
On 15.09.2015 20:41, Serge Hallyn wrote: Quoting Stéphane Graber (stgra...@ubuntu.com): On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: On 15.09.2015 17:27, Eric W. Biederman wrote: Konstantin Khlebnikov writes: pid_t getvpid(pid_t pid, pid_t source, pid_t target);

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-16 Thread Konstantin Khlebnikov
On 15.09.2015 20:41, Serge Hallyn wrote: Quoting Stéphane Graber (stgra...@ubuntu.com): On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: On 15.09.2015 17:27, Eric W. Biederman wrote: Konstantin Khlebnikov writes: pid_t getvpid(pid_t pid,

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-16 Thread Serge E. Hallyn
On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin Khlebnikov wrote: > On 15.09.2015 20:41, Serge Hallyn wrote: > >Quoting Stéphane Graber (stgra...@ubuntu.com): > >>On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: > >>>On 15.09.2015 17:27, Eric W. Biederman wrote: >

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-16 Thread Eric W. Biederman
"Serge E. Hallyn" writes: > On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin Khlebnikov wrote: >> On 15.09.2015 20:41, Serge Hallyn wrote: >> >Quoting Stéphane Graber (stgra...@ubuntu.com): >> >>On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: >> >>>On

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-16 Thread Serge E. Hallyn
On Wed, Sep 16, 2015 at 09:49:02AM -0500, Eric W. Biederman wrote: > "Serge E. Hallyn" writes: > > > On Wed, Sep 16, 2015 at 10:37:33AM +0300, Konstantin Khlebnikov wrote: > >> On 15.09.2015 20:41, Serge Hallyn wrote: > >> >Quoting Stéphane Graber (stgra...@ubuntu.com): > >>

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: > > On 15.09.2015 17:27, Eric W. Biederman wrote: > > >Konstantin Khlebnikov writes: > > > > > >>pid_t getvpid(pid_t pid, pid_t source, pid_t target); > > >> > > >>This syscall

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Konstantin Khlebnikov
On 15.09.2015 18:17, Stéphane Graber wrote: On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: On 15.09.2015 17:27, Eric W. Biederman wrote: Konstantin Khlebnikov writes: pid_t getvpid(pid_t pid, pid_t source, pid_t target); This syscall converts pid from one pid-ns

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Stéphane Graber
On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: > On 15.09.2015 17:27, Eric W. Biederman wrote: > >Konstantin Khlebnikov writes: > > > >>pid_t getvpid(pid_t pid, pid_t source, pid_t target); > >> > >>This syscall converts pid from one pid-ns into pid in another pid-ns: >

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Konstantin Khlebnikov
On 15.09.2015 17:27, Eric W. Biederman wrote: Konstantin Khlebnikov writes: pid_t getvpid(pid_t pid, pid_t source, pid_t target); This syscall converts pid from one pid-ns into pid in another pid-ns: it takes @pid in namespace of @source task (zero for current) and returns related pid in

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Eric W. Biederman
Konstantin Khlebnikov writes: > pid_t getvpid(pid_t pid, pid_t source, pid_t target); > > This syscall converts pid from one pid-ns into pid in another pid-ns: > it takes @pid in namespace of @source task (zero for current) and > returns related pid in namespace of @target task (zero for current

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Oleg Nesterov
On 09/15, Konstantin Khlebnikov wrote: > > +SYSCALL_DEFINE3(getvpid, pid_t, pid, pid_t, source, pid_t, target) > +{ > +#ifdef CONFIG_PID_NS > + struct pid_namespace *current_ns = task_active_pid_ns(current); > + struct pid_namespace *source_ns = current_ns, *target_ns = current_ns; > +

[PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Konstantin Khlebnikov
pid_t getvpid(pid_t pid, pid_t source, pid_t target); This syscall converts pid from one pid-ns into pid in another pid-ns: it takes @pid in namespace of @source task (zero for current) and returns related pid in namespace of @target task (zero for current too). If pid is unreachable from target

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Serge Hallyn
Quoting Stéphane Graber (stgra...@ubuntu.com): > On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: > > On 15.09.2015 17:27, Eric W. Biederman wrote: > > >Konstantin Khlebnikov writes: > > > > > >>pid_t getvpid(pid_t pid, pid_t source, pid_t target);

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Konstantin Khlebnikov
On 15.09.2015 18:17, Stéphane Graber wrote: On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: On 15.09.2015 17:27, Eric W. Biederman wrote: Konstantin Khlebnikov writes: pid_t getvpid(pid_t pid, pid_t source, pid_t target); This syscall

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Konstantin Khlebnikov
On 15.09.2015 17:27, Eric W. Biederman wrote: Konstantin Khlebnikov writes: pid_t getvpid(pid_t pid, pid_t source, pid_t target); This syscall converts pid from one pid-ns into pid in another pid-ns: it takes @pid in namespace of @source task (zero for current) and

[PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Konstantin Khlebnikov
pid_t getvpid(pid_t pid, pid_t source, pid_t target); This syscall converts pid from one pid-ns into pid in another pid-ns: it takes @pid in namespace of @source task (zero for current) and returns related pid in namespace of @target task (zero for current too). If pid is unreachable from target

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Stéphane Graber
On Tue, Sep 15, 2015 at 06:01:38PM +0300, Konstantin Khlebnikov wrote: > On 15.09.2015 17:27, Eric W. Biederman wrote: > >Konstantin Khlebnikov writes: > > > >>pid_t getvpid(pid_t pid, pid_t source, pid_t target); > >> > >>This syscall converts pid from one pid-ns into

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Oleg Nesterov
On 09/15, Konstantin Khlebnikov wrote: > > +SYSCALL_DEFINE3(getvpid, pid_t, pid, pid_t, source, pid_t, target) > +{ > +#ifdef CONFIG_PID_NS > + struct pid_namespace *current_ns = task_active_pid_ns(current); > + struct pid_namespace *source_ns = current_ns, *target_ns = current_ns; > +

Re: [PATCH RFC] pidns: introduce syscall getvpid

2015-09-15 Thread Eric W. Biederman
Konstantin Khlebnikov writes: > pid_t getvpid(pid_t pid, pid_t source, pid_t target); > > This syscall converts pid from one pid-ns into pid in another pid-ns: > it takes @pid in namespace of @source task (zero for current) and > returns related pid in namespace of