[RFC PATCH v4 09/12] nfs - cache_lib use namespace if not executing in init namespace

2015-03-16 Thread Ian Kent
From: Ian Kent If pipefs is registered within a namespace other than the root init namespace subsequent pipefs requests should be run within the init namespace of registration. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond

[RFC PATCH v4 10/12] nfs - objlayout use namespace if not executing in init namespace

2015-03-16 Thread Ian Kent
From: Ian Kent If the caller is running within a container then execute the usermode helper callback within the init namespace of the container. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc

[RFC PATCH v4 12/12] KEYS: exec request-key within the requesting task's init namespace

2015-03-16 Thread Ian Kent
From: Ian Kent Containerized request key helper callbacks need the ability to execute a binary in a container's context. To do this calling an in kernel equivalent of setns(2) should be sufficient since the user mode helper execution kernel thread ultimately calls do_execve(). Signed-off

[RFC PATCH v4 07/12] kmod - add call_usermodehelper_ns()

2015-03-16 Thread Ian Kent
From: Ian Kent Add function call_usermodehelper_ns() to allow passing a namespace token to lookup previously stored namespace information for usermode helper execution. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc

[RFC PATCH v4 08/12] nfsd - use namespace if not executing in init namespace

2015-03-16 Thread Ian Kent
From: Ian Kent If nfsd is running within a container the client tracking operations should run within the originating container also. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc: Eric W

[RFC PATCH v4 11/12] KEYS - use correct memory allocation flag in call_usermodehelper_keys()

2015-03-16 Thread Ian Kent
From: Ian Kent When call_usermodehelper_keys() is called it assumes it won't be called with the flag UMH_NO_WAIT. Currently that's always the case. Change this to check the flag and use the correct kernel memory allocation flag to guard against future changes. Signed-off-by: Ian Kent Cc

[RFC PATCH v4 06/12] kmod - add namespace info store

2015-03-16 Thread Ian Kent
From: Ian Kent Persistent use of namespace information is needed where contained execution is needed in a namespace other than the current namespace. Use a simple random token as a key to store namespace information in a hashed list for later usermode helper execution. Signed-off-by: Ian Kent

[RFC PATCH v4 00/12] Second attempt at contained helper execution

2015-03-16 Thread Ian Kent
this in a sensible way but the token does need to be accessible at helper execution time which is why I've done it this way. I definitely need advice here too. --- Ian Kent (12): nsproxy - make create_new_namespaces() non-static kmod - rename call_usermodehelper() flags parameter vfs

[RFC PATCH v4 03/12] vfs - move mnt_namespace definition to linux/mount.h

2015-03-16 Thread Ian Kent
From: Ian Kent The mnt_namespace definition will be needed by the usermode helper contained execution implementation, move it to include/linux/mount.h. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov

[RFC PATCH v4 01/12] nsproxy - make create_new_namespaces() non-static

2015-03-16 Thread Ian Kent
From: Ian Kent create_new_namespaces() will be needed by usermodehelper namespace restricted execution. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Stanislav Kinsbursky Cc: Oleg Nesterov Cc: Eric W. Biederman

[RFC PATCH v4 02/12] kmod - rename call_usermodehelper() flags parameter

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com The wait parameter of call_usermodehelper() is not quite a parameter that describes the wait behaviour alone and will later be used to request execution within the current namespaces. This flag is tied to the wait field of the subprocess_info structure which

[RFC PATCH v4 03/12] vfs - move mnt_namespace definition to linux/mount.h

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com The mnt_namespace definition will be needed by the usermode helper contained execution implementation, move it to include/linux/mount.h. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J

[RFC PATCH v4 06/12] kmod - add namespace info store

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com Persistent use of namespace information is needed where contained execution is needed in a namespace other than the current namespace. Use a simple random token as a key to store namespace information in a hashed list for later usermode helper execution. Signed

[RFC PATCH v4 00/12] Second attempt at contained helper execution

2015-03-16 Thread Ian Kent
this in a sensible way but the token does need to be accessible at helper execution time which is why I've done it this way. I definitely need advice here too. --- Ian Kent (12): nsproxy - make create_new_namespaces() non-static kmod - rename call_usermodehelper() flags parameter vfs

[RFC PATCH v4 01/12] nsproxy - make create_new_namespaces() non-static

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com create_new_namespaces() will be needed by usermodehelper namespace restricted execution. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc: David

[RFC PATCH v4 12/12] KEYS: exec request-key within the requesting task's init namespace

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com Containerized request key helper callbacks need the ability to execute a binary in a container's context. To do this calling an in kernel equivalent of setns(2) should be sufficient since the user mode helper execution kernel thread ultimately calls do_execve

[RFC PATCH v4 07/12] kmod - add call_usermodehelper_ns()

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com Add function call_usermodehelper_ns() to allow passing a namespace token to lookup previously stored namespace information for usermode helper execution. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v

[RFC PATCH v4 08/12] nfsd - use namespace if not executing in init namespace

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com If nfsd is running within a container the client tracking operations should run within the originating container also. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie

[RFC PATCH v4 10/12] nfs - objlayout use namespace if not executing in init namespace

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com If the caller is running within a container then execute the usermode helper callback within the init namespace of the container. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce

[RFC PATCH v4 05/12] kmod - teach call_usermodehelper() to use a namespace

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com The call_usermodehelper() function executes all binaries in the global init root context. This doesn't allow a binary to be run within a namespace (eg. the namespaces of a container). The init process of the callers environment is used to setup the namespaces

[RFC PATCH v4 04/12] kmod - add namespace aware thread runner

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com Make usermode helper thread runner namespace aware. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc: David Howells dhowe...@redhat.com Cc: Trond

[RFC PATCH v4 11/12] KEYS - use correct memory allocation flag in call_usermodehelper_keys()

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com When call_usermodehelper_keys() is called it assumes it won't be called with the flag UMH_NO_WAIT. Currently that's always the case. Change this to check the flag and use the correct kernel memory allocation flag to guard against future changes. Signed-off

[RFC PATCH v4 09/12] nfs - cache_lib use namespace if not executing in init namespace

2015-03-16 Thread Ian Kent
From: Ian Kent ik...@redhat.com If pipefs is registered within a namespace other than the root init namespace subsequent pipefs requests should be run within the init namespace of registration. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-24 Thread Ian Kent
On Mon, 2015-02-23 at 17:22 -0800, Benjamin Coddington wrote: > On Tue, 24 Feb 2015, Ian Kent wrote: > > > On Mon, 2015-02-23 at 09:52 -0500, J. Bruce Fields wrote: > > > On Sat, Feb 21, 2015 at 11:58:58AM +0800, Ian Kent wrote: > > > > On Fri, 2015-02-20 at 1

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-24 Thread Ian Kent
On Mon, 2015-02-23 at 17:22 -0800, Benjamin Coddington wrote: On Tue, 24 Feb 2015, Ian Kent wrote: On Mon, 2015-02-23 at 09:52 -0500, J. Bruce Fields wrote: On Sat, Feb 21, 2015 at 11:58:58AM +0800, Ian Kent wrote: On Fri, 2015-02-20 at 14:05 -0500, J. Bruce Fields wrote: On Fri

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-23 Thread Ian Kent
On Mon, 2015-02-23 at 09:52 -0500, J. Bruce Fields wrote: > On Sat, Feb 21, 2015 at 11:58:58AM +0800, Ian Kent wrote: > > On Fri, 2015-02-20 at 14:05 -0500, J. Bruce Fields wrote: > > > On Fri, Feb 20, 2015 at 12:07:15PM -0600, Eric W. Biederman wrote: > > >

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-23 Thread Ian Kent
On Mon, 2015-02-23 at 09:52 -0500, J. Bruce Fields wrote: On Sat, Feb 21, 2015 at 11:58:58AM +0800, Ian Kent wrote: On Fri, 2015-02-20 at 14:05 -0500, J. Bruce Fields wrote: On Fri, Feb 20, 2015 at 12:07:15PM -0600, Eric W. Biederman wrote: J. Bruce Fields bfie...@fieldses.org writes

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-20 Thread Ian Kent
On Fri, 2015-02-20 at 14:05 -0500, J. Bruce Fields wrote: > On Fri, Feb 20, 2015 at 12:07:15PM -0600, Eric W. Biederman wrote: > > "J. Bruce Fields" writes: > > > > > On Fri, Feb 20, 2015 at 05:33:25PM +0800, Ian Kent wrote: > > > > >> The cas

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-20 Thread Ian Kent
On Wed, 2015-02-18 at 20:31 -0500, J. Bruce Fields wrote: > On Thu, Feb 19, 2015 at 08:39:01AM +0800, Ian Kent wrote: > > On Wed, 2015-02-18 at 15:59 -0500, J. Bruce Fields wrote: > > > On Wed, Feb 18, 2015 at 12:31:32PM -0500, J. Bruce Fields wrote: > > > > On W

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-20 Thread Ian Kent
On Wed, 2015-02-18 at 20:31 -0500, J. Bruce Fields wrote: On Thu, Feb 19, 2015 at 08:39:01AM +0800, Ian Kent wrote: On Wed, 2015-02-18 at 15:59 -0500, J. Bruce Fields wrote: On Wed, Feb 18, 2015 at 12:31:32PM -0500, J. Bruce Fields wrote: On Wed, Feb 18, 2015 at 12:06:20PM -0500, J

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-20 Thread Ian Kent
On Fri, 2015-02-20 at 14:05 -0500, J. Bruce Fields wrote: On Fri, Feb 20, 2015 at 12:07:15PM -0600, Eric W. Biederman wrote: J. Bruce Fields bfie...@fieldses.org writes: On Fri, Feb 20, 2015 at 05:33:25PM +0800, Ian Kent wrote: The case of nfsd state-recovery might be similar

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-18 Thread Ian Kent
On Wed, 2015-02-18 at 20:31 -0500, J. Bruce Fields wrote: > On Thu, Feb 19, 2015 at 08:39:01AM +0800, Ian Kent wrote: > > On Wed, 2015-02-18 at 15:59 -0500, J. Bruce Fields wrote: > > > On Wed, Feb 18, 2015 at 12:31:32PM -0500, J. Bruce Fields wrote: > > > > On W

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-18 Thread Ian Kent
On Wed, 2015-02-18 at 15:59 -0500, J. Bruce Fields wrote: > On Wed, Feb 18, 2015 at 12:31:32PM -0500, J. Bruce Fields wrote: > > On Wed, Feb 18, 2015 at 12:06:20PM -0500, J. Bruce Fields wrote: > > > On Fri, Feb 06, 2015 at 09:47:25AM +0800, Ian Kent wrote: > > > &g

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-18 Thread Ian Kent
On Wed, 2015-02-18 at 15:59 -0500, J. Bruce Fields wrote: On Wed, Feb 18, 2015 at 12:31:32PM -0500, J. Bruce Fields wrote: On Wed, Feb 18, 2015 at 12:06:20PM -0500, J. Bruce Fields wrote: On Fri, Feb 06, 2015 at 09:47:25AM +0800, Ian Kent wrote: On Thu, 2015-02-05 at 15:14 +, David

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-18 Thread Ian Kent
On Wed, 2015-02-18 at 20:31 -0500, J. Bruce Fields wrote: On Thu, Feb 19, 2015 at 08:39:01AM +0800, Ian Kent wrote: On Wed, 2015-02-18 at 15:59 -0500, J. Bruce Fields wrote: On Wed, Feb 18, 2015 at 12:31:32PM -0500, J. Bruce Fields wrote: On Wed, Feb 18, 2015 at 12:06:20PM -0500, J

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-17 Thread Ian Kent
On Mon, 2015-02-16 at 19:24 +0100, Oleg Nesterov wrote: > On 02/16, Oleg Nesterov wrote: > > > > On 02/16, Ian Kent wrote: > > > > > > On Tue, 2015-02-10 at 17:55 +0100, Oleg Nesterov wrote: > > > > On 02/10, Ian Kent wrote: > > > > >

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-17 Thread Ian Kent
On Mon, 2015-02-16 at 18:13 +0100, Oleg Nesterov wrote: > On 02/16, Ian Kent wrote: > > > > On Tue, 2015-02-10 at 17:55 +0100, Oleg Nesterov wrote: > > > On 02/10, Ian Kent wrote: > > > > > > > > On Mon, 2015-02-09 at 17:03 +0100, Oleg Nesterov wrot

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-17 Thread Ian Kent
On Mon, 2015-02-16 at 19:24 +0100, Oleg Nesterov wrote: On 02/16, Oleg Nesterov wrote: On 02/16, Ian Kent wrote: On Tue, 2015-02-10 at 17:55 +0100, Oleg Nesterov wrote: On 02/10, Ian Kent wrote: On Mon, 2015-02-09 at 17:03 +0100, Oleg Nesterov wrote: I

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-17 Thread Ian Kent
On Mon, 2015-02-16 at 18:13 +0100, Oleg Nesterov wrote: On 02/16, Ian Kent wrote: On Tue, 2015-02-10 at 17:55 +0100, Oleg Nesterov wrote: On 02/10, Ian Kent wrote: On Mon, 2015-02-09 at 17:03 +0100, Oleg Nesterov wrote: I understand. but I still can't understand why we

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-15 Thread Ian Kent
On Tue, 2015-02-10 at 17:55 +0100, Oleg Nesterov wrote: > On 02/10, Ian Kent wrote: > > > > On Mon, 2015-02-09 at 17:03 +0100, Oleg Nesterov wrote: > > > > > > I understand. but I still can't understand why we can't implement > > > something >

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-15 Thread Ian Kent
On Tue, 2015-02-10 at 17:55 +0100, Oleg Nesterov wrote: On 02/10, Ian Kent wrote: On Mon, 2015-02-09 at 17:03 +0100, Oleg Nesterov wrote: I understand. but I still can't understand why we can't implement something like enter_ns(struct nsproxy *p

Re: [PATCH] autofs4: Wrong format for printing dentry

2015-02-11 Thread Ian Kent
On Wed, 2015-02-11 at 21:41 +0100, Rasmus Villemoes wrote: > Ping... The patch looks fine to me. I'll check there are no other instances of this and send it to Al. > > On Fri, Feb 06 2015, Rasmus Villemoes wrote: > > > %pD for struct file*, %pd for struct dentry*. > > > > Fixes: a455589f181e

Re: [PATCH] autofs4: Wrong format for printing dentry

2015-02-11 Thread Ian Kent
On Wed, 2015-02-11 at 21:41 +0100, Rasmus Villemoes wrote: Ping... The patch looks fine to me. I'll check there are no other instances of this and send it to Al. On Fri, Feb 06 2015, Rasmus Villemoes li...@rasmusvillemoes.dk wrote: %pD for struct file*, %pd for struct dentry*. Fixes:

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-10 Thread Ian Kent
On Tue, 2015-02-10 at 17:55 +0100, Oleg Nesterov wrote: > On 02/10, Ian Kent wrote: > > > > On Mon, 2015-02-09 at 17:03 +0100, Oleg Nesterov wrote: > > > > > > I understand. but I still can't understand why we can't implement > > > something >

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-10 Thread Ian Kent
On Tue, 2015-02-10 at 17:55 +0100, Oleg Nesterov wrote: On 02/10, Ian Kent wrote: On Mon, 2015-02-09 at 17:03 +0100, Oleg Nesterov wrote: I understand. but I still can't understand why we can't implement something like enter_ns(struct nsproxy *p

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-09 Thread Ian Kent
On Mon, 2015-02-09 at 17:03 +0100, Oleg Nesterov wrote: > On 02/09, Ian Kent wrote: > > > > On Sun, 2015-02-08 at 20:00 +0100, Oleg Nesterov wrote: > > > > + > > > > + this = file_open_root(mnt->mnt_root, mnt, path, > > > >

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-09 Thread Ian Kent
On Mon, 2015-02-09 at 17:03 +0100, Oleg Nesterov wrote: On 02/09, Ian Kent wrote: On Sun, 2015-02-08 at 20:00 +0100, Oleg Nesterov wrote: + + this = file_open_root(mnt-mnt_root, mnt, path, O_RDONLY); + if (unlikely(IS_ERR

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-08 Thread Ian Kent
On Sun, 2015-02-08 at 20:00 +0100, Oleg Nesterov wrote: > On 02/05, Ian Kent wrote: > > > > +int umh_enter_ns(struct task_struct *tsk, struct cred *new) > > +{ > > + char path[NS_PATH_MAX]; > > + struct vfsmount *mnt; > > + const char *name;

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-08 Thread Ian Kent
On Sun, 2015-02-08 at 20:00 +0100, Oleg Nesterov wrote: On 02/05, Ian Kent wrote: +int umh_enter_ns(struct task_struct *tsk, struct cred *new) +{ + char path[NS_PATH_MAX]; + struct vfsmount *mnt; + const char *name; + pid_t pid; + int err = 0; + + pid = task_pid_nr

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-07 Thread Ian Kent
On Fri, 2015-02-06 at 07:08 -0500, Jeff Layton wrote: > On Thu, 05 Feb 2015 10:34:11 +0800 > Ian Kent wrote: > > > The call_usermodehelper() function executes all binaries in the > > global "init" root context. This doesn't allow a binary to be run > >

Re: [RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-07 Thread Ian Kent
On Fri, 2015-02-06 at 07:08 -0500, Jeff Layton wrote: On Thu, 05 Feb 2015 10:34:11 +0800 Ian Kent ik...@redhat.com wrote: The call_usermodehelper() function executes all binaries in the global init root context. This doesn't allow a binary to be run within a namespace (eg. the namespace

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-05 Thread Ian Kent
On Thu, 2015-02-05 at 15:14 +, David Howells wrote: > > > + /* If running within a container use the container namespace */ > > + if (current->nsproxy->net_ns != _net) > > Is that a viable check? Is it possible to have a container that shares > networking details? That's up for

Re: [RFC PATCH 2/8] kmod - rename call_usermodehelper() flags parameter

2015-02-05 Thread Ian Kent
On Thu, 2015-02-05 at 15:01 +, David Howells wrote: > Ian Kent wrote: > > > -call_usermodehelper(char *path, char **argv, char **envp, int wait); > > +call_usermodehelper(char *path, char **argv, char **envp, int flags); > > Can we make flags unsigned whilst

Re: [RFC PATCH 2/8] kmod - rename call_usermodehelper() flags parameter

2015-02-05 Thread Ian Kent
On Thu, 2015-02-05 at 15:01 +, David Howells wrote: Ian Kent ik...@redhat.com wrote: -call_usermodehelper(char *path, char **argv, char **envp, int wait); +call_usermodehelper(char *path, char **argv, char **envp, int flags); Can we make flags unsigned whilst we're at it? Other than

Re: [RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-05 Thread Ian Kent
On Thu, 2015-02-05 at 15:14 +, David Howells wrote: + /* If running within a container use the container namespace */ + if (current-nsproxy-net_ns != init_net) Is that a viable check? Is it possible to have a container that shares networking details? That's up for discussion.

[RFC PATCH 8/8] nfs - objlayout use namespace if not executing in init namespace

2015-02-04 Thread Ian Kent
If the caller is running within a container then execute the usermode helper callback within the init namespace of the container. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc: Eric W. Biederman

[RFC PATCH 0/8] v3 contained usermode helper execution

2015-02-04 Thread Ian Kent
infrastructure will continue to use a usermode callback so we'll need to wait on that. --- Ian Kent (8): nsproxy - refactor setns() kmod - rename call_usermodehelper() flags parameter kmod - teach call_usermodehelper() to use a namespace KEYS - rename call_usermodehelper_keys

[RFC PATCH 2/8] kmod - rename call_usermodehelper() flags parameter

2015-02-04 Thread Ian Kent
The wait parameter of call_usermodehelper() is not quite a parameter that describes the wait behaviour alone and will later be used to request exec within a namespace. So change its name to flags. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David

[RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-04 Thread Ian Kent
Containerized request key helper callbacks need the ability to execute a binary in a container's context. To do this calling an in kernel equivalent of setns(2) should be sufficient since the user mode helper execution kernel thread ultimately calls do_execve(). Signed-off-by: Ian Kent Cc

[RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-04 Thread Ian Kent
's context. To do this use the init process of the callers environment is used to setup the namespaces in the same way the root init process is used otherwise. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov

[RFC PATCH 7/8] nfs - cache_lib use namespace if not executing in init namespace

2015-02-04 Thread Ian Kent
If the caller is running within a container then execute the usermode helper callback within the init namespace of the container. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc: Eric W. Biederman

[RFC PATCH 4/8] KEYS - rename call_usermodehelper_keys() flags parameter

2015-02-04 Thread Ian Kent
The wait parameter of call_usermodehelper_keys() will later be used to request exec within a namespace. So change its name to flags. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc: Eric W

[RFC PATCH 6/8] nfsd - use namespace if not executing in init namespace

2015-02-04 Thread Ian Kent
If nfsd is running within a container the client tracking operations should run within the container also. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc: Eric W. Biederman Cc: Jeff Layton --- fs

[RFC PATCH 1/8] nsproxy - refactor setns()

2015-02-04 Thread Ian Kent
For usermode helpers to execute within a namspace a slightly different entry point to setns() that takes a namspace inode is needed. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc: Eric W. Biederman

[RFC PATCH 8/8] nfs - objlayout use namespace if not executing in init namespace

2015-02-04 Thread Ian Kent
If the caller is running within a container then execute the usermode helper callback within the init namespace of the container. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc

[RFC PATCH 1/8] nsproxy - refactor setns()

2015-02-04 Thread Ian Kent
For usermode helpers to execute within a namspace a slightly different entry point to setns() that takes a namspace inode is needed. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc

[RFC PATCH 2/8] kmod - rename call_usermodehelper() flags parameter

2015-02-04 Thread Ian Kent
The wait parameter of call_usermodehelper() is not quite a parameter that describes the wait behaviour alone and will later be used to request exec within a namespace. So change its name to flags. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v

[RFC PATCH 5/8] KEYS: exec request-key within the requesting task's init namespace

2015-02-04 Thread Ian Kent
Containerized request key helper callbacks need the ability to execute a binary in a container's context. To do this calling an in kernel equivalent of setns(2) should be sufficient since the user mode helper execution kernel thread ultimately calls do_execve(). Signed-off-by: Ian Kent ik

[RFC PATCH 3/8] kmod - teach call_usermodehelper() to use a namespace

2015-02-04 Thread Ian Kent
this use the init process of the callers environment is used to setup the namespaces in the same way the root init process is used otherwise. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie

[RFC PATCH 7/8] nfs - cache_lib use namespace if not executing in init namespace

2015-02-04 Thread Ian Kent
If the caller is running within a container then execute the usermode helper callback within the init namespace of the container. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc

[RFC PATCH 4/8] KEYS - rename call_usermodehelper_keys() flags parameter

2015-02-04 Thread Ian Kent
The wait parameter of call_usermodehelper_keys() will later be used to request exec within a namespace. So change its name to flags. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org

[RFC PATCH 6/8] nfsd - use namespace if not executing in init namespace

2015-02-04 Thread Ian Kent
If nfsd is running within a container the client tracking operations should run within the container also. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc: David Howells dhowe

[RFC PATCH 0/8] v3 contained usermode helper execution

2015-02-04 Thread Ian Kent
infrastructure will continue to use a usermode callback so we'll need to wait on that. --- Ian Kent (8): nsproxy - refactor setns() kmod - rename call_usermodehelper() flags parameter kmod - teach call_usermodehelper() to use a namespace KEYS - rename call_usermodehelper_keys

Re: [RFC PATCH 1/8] nsproxy - refactor setns()

2015-02-02 Thread Ian Kent
Oops! Please ignore these, mistakenly sent. On Tue, 2015-02-03 at 15:16 +0800, Ian Kent wrote: > For usermode helpers to execute within a namspace a slightly different > entry point to setns() that takes a namspace inode is needed. > > Signed-off-by: Ian Kent > Cc: Benjamin Coddi

[RFC PATCH 1/8] nsproxy - refactor setns()

2015-02-02 Thread Ian Kent
For usermode helpers to execute within a namspace a slightly different entry point to setns() that takes a namspace inode is needed. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc: Eric W. Biederman

[RFC PATCH 2/8] kmod - rename call_usermodehelper() flags parameter

2015-02-02 Thread Ian Kent
The wait parameter of call_usermodehelper() is not quite a parameter that describes the wait behaviour alone and will later be used to request exec within a namespace. So change its name to flags. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David

Re: [RFC PATCH 1/8] nsproxy - refactor setns()

2015-02-02 Thread Ian Kent
Oops! Please ignore these, mistakenly sent. On Tue, 2015-02-03 at 15:16 +0800, Ian Kent wrote: For usermode helpers to execute within a namspace a slightly different entry point to setns() that takes a namspace inode is needed. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin

[RFC PATCH 2/8] kmod - rename call_usermodehelper() flags parameter

2015-02-02 Thread Ian Kent
The wait parameter of call_usermodehelper() is not quite a parameter that describes the wait behaviour alone and will later be used to request exec within a namespace. So change its name to flags. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v

[RFC PATCH 1/8] nsproxy - refactor setns()

2015-02-02 Thread Ian Kent
For usermode helpers to execute within a namspace a slightly different entry point to setns() that takes a namspace inode is needed. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc

Re: [RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-21 Thread Ian Kent
On Wed, 2015-01-21 at 09:38 -0500, J. Bruce Fields wrote: > On Wed, Jan 21, 2015 at 03:05:25PM +0800, Ian Kent wrote: > > On Fri, 2015-01-16 at 10:25 -0500, J. Bruce Fields wrote: > > > On Fri, Jan 16, 2015 at 09:01:13AM +0800, Ian Kent wrote: > > > > On Thu, 2015-

Re: [RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-21 Thread Ian Kent
On Wed, 2015-01-21 at 09:38 -0500, J. Bruce Fields wrote: On Wed, Jan 21, 2015 at 03:05:25PM +0800, Ian Kent wrote: On Fri, 2015-01-16 at 10:25 -0500, J. Bruce Fields wrote: On Fri, Jan 16, 2015 at 09:01:13AM +0800, Ian Kent wrote: On Thu, 2015-01-15 at 11:27 -0500, J. Bruce Fields wrote

Re: [RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-20 Thread Ian Kent
On Fri, 2015-01-16 at 10:25 -0500, J. Bruce Fields wrote: > On Fri, Jan 16, 2015 at 09:01:13AM +0800, Ian Kent wrote: > > On Thu, 2015-01-15 at 11:27 -0500, J. Bruce Fields wrote: > > > On Thu, Jan 15, 2015 at 08:26:12AM +0800, Ian Kent wrote: > > > > On Wed, 2015-

Re: [RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-20 Thread Ian Kent
On Fri, 2015-01-16 at 10:25 -0500, J. Bruce Fields wrote: On Fri, Jan 16, 2015 at 09:01:13AM +0800, Ian Kent wrote: On Thu, 2015-01-15 at 11:27 -0500, J. Bruce Fields wrote: On Thu, Jan 15, 2015 at 08:26:12AM +0800, Ian Kent wrote: On Wed, 2015-01-14 at 17:10 -0500, J. Bruce Fields wrote

Re: [RFC PATCH 3/5] kmod - teach call_usermodehelper() to use a namespace

2015-01-15 Thread Ian Kent
On Thu, 2015-01-15 at 11:45 -0500, Jeff Layton wrote: > On Wed, 14 Jan 2015 17:32:43 +0800 > Ian Kent wrote: > > > The call_usermodehelper() function executes all binaries in the > > global "init" root context. This doesn't allow a binary to be run > >

Re: [RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-15 Thread Ian Kent
On Thu, 2015-01-15 at 11:27 -0500, J. Bruce Fields wrote: > On Thu, Jan 15, 2015 at 08:26:12AM +0800, Ian Kent wrote: > > On Wed, 2015-01-14 at 17:10 -0500, J. Bruce Fields wrote: > > > > On Wed, Jan 14, 2015 at 05:32:22PM +0800, Ian Kent wrote: > > > > > Th

Re: [RFC PATCH 3/5] kmod - teach call_usermodehelper() to use a namespace

2015-01-15 Thread Ian Kent
On Thu, 2015-01-15 at 11:45 -0500, Jeff Layton wrote: On Wed, 14 Jan 2015 17:32:43 +0800 Ian Kent ik...@redhat.com wrote: The call_usermodehelper() function executes all binaries in the global init root context. This doesn't allow a binary to be run within a namespace (eg. the namespace

Re: [RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-15 Thread Ian Kent
On Thu, 2015-01-15 at 11:27 -0500, J. Bruce Fields wrote: On Thu, Jan 15, 2015 at 08:26:12AM +0800, Ian Kent wrote: On Wed, 2015-01-14 at 17:10 -0500, J. Bruce Fields wrote: On Wed, Jan 14, 2015 at 05:32:22PM +0800, Ian Kent wrote: There are other difficulties to tackle as well

Re: [RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-14 Thread Ian Kent
On Wed, 2015-01-14 at 17:10 -0500, J. Bruce Fields wrote: > > On Wed, Jan 14, 2015 at 05:32:22PM +0800, Ian Kent wrote: > > > There are other difficulties to tackle as well, such as how to decide > > > if contained helper execution is needed. For example, if a mount h

[RFC PATCH 3/5] kmod - teach call_usermodehelper() to use a namespace

2015-01-14 Thread Ian Kent
's context. To do this use the init process of the callers environment is used to setup the namespaces in the same way the root init process is used otherwise. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov

[RFC PATCH 2/5] kmod - rename call_usermodehelper() flags parameter

2015-01-14 Thread Ian Kent
The wait parameter of call_usermodehelper() is not quite a parameter that describes the wait behaviour alone and will later be used to request exec within a namespace. So change its name to flags. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David

[RFC PATCH 1/5] nsproxy - refactor setns()

2015-01-14 Thread Ian Kent
For usermode helpers to execute within a namspace a slightly different entry point to setns() that takes a namspace inode is needed. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc: Eric W. Biederman

[RFC PATCH 4/5] KEYS - rename call_usermodehelper_keys() flags parameter

2015-01-14 Thread Ian Kent
The wait parameter of call_usermodehelper_keys() will later be used to request exec within a namespace. So change its name to flags. Signed-off-by: Ian Kent Cc: Benjamin Coddington Cc: Al Viro Cc: J. Bruce Fields Cc: David Howells Cc: Trond Myklebust Cc: Oleg Nesterov Cc: Eric W

[RFC PATCH 5/5] KEYS: exec request-key within the requesting task's init namespace

2015-01-14 Thread Ian Kent
Containerized request key helper callbacks need the ability to execute a binary in a container's context. To do this calling an in kernel equivalent of setns(2) should be sufficient since the user mode helper execution kernel thread ultimately calls do_execve(). Signed-off-by: Ian Kent Cc

[RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-14 Thread Ian Kent
here to enter the target namespace which probably needs work but is out of scope for this series if in fact this approach is even acceptable. Comments please? --- Ian Kent (5): nsproxy - refactor setns() kmod - rename call_usermodehelper() flags parameter kmod - teach call_usermodehe

Re: [RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-14 Thread Ian Kent
On Wed, 2015-01-14 at 17:10 -0500, J. Bruce Fields wrote: On Wed, Jan 14, 2015 at 05:32:22PM +0800, Ian Kent wrote: There are other difficulties to tackle as well, such as how to decide if contained helper execution is needed. For example, if a mount has been propagated to a container

[RFC PATCH 5/5] KEYS: exec request-key within the requesting task's init namespace

2015-01-14 Thread Ian Kent
Containerized request key helper callbacks need the ability to execute a binary in a container's context. To do this calling an in kernel equivalent of setns(2) should be sufficient since the user mode helper execution kernel thread ultimately calls do_execve(). Signed-off-by: Ian Kent ik

[RFC PATCH 0/5] Second attempt at contained helper execution

2015-01-14 Thread Ian Kent
namespace which probably needs work but is out of scope for this series if in fact this approach is even acceptable. Comments please? --- Ian Kent (5): nsproxy - refactor setns() kmod - rename call_usermodehelper() flags parameter kmod - teach call_usermodehelper() to use

[RFC PATCH 1/5] nsproxy - refactor setns()

2015-01-14 Thread Ian Kent
For usermode helpers to execute within a namspace a slightly different entry point to setns() that takes a namspace inode is needed. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org Cc

[RFC PATCH 3/5] kmod - teach call_usermodehelper() to use a namespace

2015-01-14 Thread Ian Kent
this use the init process of the callers environment is used to setup the namespaces in the same way the root init process is used otherwise. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie

[RFC PATCH 4/5] KEYS - rename call_usermodehelper_keys() flags parameter

2015-01-14 Thread Ian Kent
The wait parameter of call_usermodehelper_keys() will later be used to request exec within a namespace. So change its name to flags. Signed-off-by: Ian Kent ik...@redhat.com Cc: Benjamin Coddington bcodd...@redhat.com Cc: Al Viro v...@zeniv.linux.org.uk Cc: J. Bruce Fields bfie...@fieldses.org

<    3   4   5   6   7   8   9   10   11   12   >