Re: [PATCH 3/7] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-11 Thread Vivek Goyal
to the wrong git tree, please drop us a note to > help improve the system] These patches should be applied on top of overlayfs-next branch of miklos's vfs tree. git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-next > > url: > https://github.com/0day-ci/li

Re: [PATCH 3/7] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-11 Thread Vivek Goyal
to the wrong git tree, please drop us a note to > help improve the system] These patches should be applied on top of overlayfs-next branch of miklos's vfs tree. git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-next > > url: > https://github.com/0day-ci/li

[PATCH 6/7] security, overlayfs: Provide hook to correctly label newly created files

2016-07-08 Thread Vivek Goyal
of creds appropriately. Caller makes use of these new creds for file creation. Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- fs/overlayfs/dir.c| 10 ++ include/linux/lsm_hooks.h | 15 +++ include/linux/security.h | 12 security/security.c

[PATCH 6/7] security, overlayfs: Provide hook to correctly label newly created files

2016-07-08 Thread Vivek Goyal
of creds appropriately. Caller makes use of these new creds for file creation. Signed-off-by: Vivek Goyal --- fs/overlayfs/dir.c| 10 ++ include/linux/lsm_hooks.h | 15 +++ include/linux/security.h | 12 security/security.c | 11 +++ 4

[PATCH 7/7] selinux: Implement dentry_create_files_as() hook

2016-07-08 Thread Vivek Goyal
Calculate what would be the label of newly created file and set that secid in the passed creds. Context of the task which is actually creating file is retrieved from set of creds passed in. (old->security). Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- security/selinux/hoo

[PATCH 3/7] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-08 Thread Vivek Goyal
. If 0 or -EOPNOTSUPP is returned, xattr will be copied up, if 1 is returned, xattr will not be copied up and if negative error code is returned, copy up will be aborted. Signed-off-by: David Howells <dhowe...@redhat.com> Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- fs/overlay

[PATCH 7/7] selinux: Implement dentry_create_files_as() hook

2016-07-08 Thread Vivek Goyal
Calculate what would be the label of newly created file and set that secid in the passed creds. Context of the task which is actually creating file is retrieved from set of creds passed in. (old->security). Signed-off-by: Vivek Goyal --- security/selinux/hooks.c | 22 ++

[PATCH 3/7] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-08 Thread Vivek Goyal
. If 0 or -EOPNOTSUPP is returned, xattr will be copied up, if 1 is returned, xattr will not be copied up and if negative error code is returned, copy up will be aborted. Signed-off-by: David Howells Signed-off-by: Vivek Goyal --- fs/overlayfs/copy_up.c| 7 +++ include/linux/lsm_hooks.h

[PATCH 4/7] selinux: Implementation for inode_copy_up_xattr() hook

2016-07-08 Thread Vivek Goyal
. Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- security/selinux/hooks.c | 16 1 file changed, 16 insertions(+) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index c82ee54..4fda548 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/h

[PATCH 4/7] selinux: Implementation for inode_copy_up_xattr() hook

2016-07-08 Thread Vivek Goyal
. Signed-off-by: Vivek Goyal --- security/selinux/hooks.c | 16 1 file changed, 16 insertions(+) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index c82ee54..4fda548 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3290,6 +3290,21

[RFC PATCH 0/7][V2] Overlayfs SELinux Support

2016-07-08 Thread Vivek Goyal
So this hooks helps avoiding all these issues. When a new file is created in upper/, it gets its label based on transition rules. For the case of context mount, it gets the label from context= option. Any feedback is welcome. Thanks Vivek Vivek Goyal (7): security, overlayfs: provide copy

[PATCH 5/7] selinux: Pass security pointer to determine_inode_label()

2016-07-08 Thread Vivek Goyal
Right now selinux_determine_inode_label() works on security pointer of current task. Soon I need this to work on a security pointer retrieved from a set of creds. So start passing in a pointer and caller can decide where to fetch security pointer from. Signed-off-by: Vivek Goyal <

[RFC PATCH 0/7][V2] Overlayfs SELinux Support

2016-07-08 Thread Vivek Goyal
So this hooks helps avoiding all these issues. When a new file is created in upper/, it gets its label based on transition rules. For the case of context mount, it gets the label from context= option. Any feedback is welcome. Thanks Vivek Vivek Goyal (7): security, overlayfs: provide copy

[PATCH 5/7] selinux: Pass security pointer to determine_inode_label()

2016-07-08 Thread Vivek Goyal
Right now selinux_determine_inode_label() works on security pointer of current task. Soon I need this to work on a security pointer retrieved from a set of creds. So start passing in a pointer and caller can decide where to fetch security pointer from. Signed-off-by: Vivek Goyal --- security

[PATCH 2/7] selinux: Implementation for inode_copy_up() hook

2016-07-08 Thread Vivek Goyal
the label of lower file and in case of context mount, overlay inode will have the label from context= mount option. Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- security/selinux/hooks.c | 21 + 1 file changed, 21 insertions(+) diff --git a/security/selinux/hooks.c b/se

[PATCH 2/7] selinux: Implementation for inode_copy_up() hook

2016-07-08 Thread Vivek Goyal
the label of lower file and in case of context mount, overlay inode will have the label from context= mount option. Signed-off-by: Vivek Goyal --- security/selinux/hooks.c | 21 + 1 file changed, 21 insertions(+) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c

[PATCH 1/7] security, overlayfs: provide copy up security hook for unioned files

2016-07-08 Thread Vivek Goyal
to old creds and release new creds. Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- fs/overlayfs/copy_up.c| 18 ++ include/linux/lsm_hooks.h | 11 +++ include/linux/security.h | 6 ++ security/security.c | 8 4 files changed, 43 inse

[PATCH 1/7] security, overlayfs: provide copy up security hook for unioned files

2016-07-08 Thread Vivek Goyal
to old creds and release new creds. Signed-off-by: Vivek Goyal --- fs/overlayfs/copy_up.c| 18 ++ include/linux/lsm_hooks.h | 11 +++ include/linux/security.h | 6 ++ security/security.c | 8 4 files changed, 43 insertions(+) diff --git a/fs

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-08 Thread Vivek Goyal
On Fri, Jul 08, 2016 at 08:45:34AM -0400, Vivek Goyal wrote: [..] > > >>> I don't much care for the way part of the credential manipulation > > >>> is done in the caller and part is done the the security module. > > >>> If the caller is goin

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-08 Thread Vivek Goyal
On Fri, Jul 08, 2016 at 08:45:34AM -0400, Vivek Goyal wrote: [..] > > >>> I don't much care for the way part of the credential manipulation > > >>> is done in the caller and part is done the the security module. > > >>> If the caller is goin

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-08 Thread Vivek Goyal
On Fri, Jul 08, 2016 at 09:21:13AM +0200, Miklos Szeredi wrote: > On Thu, Jul 7, 2016 at 11:44 PM, Casey Schaufler <ca...@schaufler-ca.com> > wrote: > > On 7/7/2016 1:33 PM, Vivek Goyal wrote: > >> On Tue, Jul 05, 2016 at 12:36:17PM -0700, Casey Schaufler wrote: >

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-08 Thread Vivek Goyal
On Fri, Jul 08, 2016 at 09:21:13AM +0200, Miklos Szeredi wrote: > On Thu, Jul 7, 2016 at 11:44 PM, Casey Schaufler > wrote: > > On 7/7/2016 1:33 PM, Vivek Goyal wrote: > >> On Tue, Jul 05, 2016 at 12:36:17PM -0700, Casey Schaufler wrote: > >>> On 7/

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-07 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 12:36:17PM -0700, Casey Schaufler wrote: > > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > Provide a security hook to label new file correctly when a file is copied > > up from lower layer to upper layer of a overlay/union mount. > > > > Th

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-07 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 12:36:17PM -0700, Casey Schaufler wrote: > > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > Provide a security hook to label new file correctly when a file is copied > > up from lower layer to upper layer of a overlay/union mount. > > > > Th

Re: [PATCH 5/5] overlayfs: Use vfs_getxattr_noperm() for real inode

2016-07-07 Thread Vivek Goyal
On Wed, Jul 06, 2016 at 04:58:37PM +0200, Miklos Szeredi wrote: > On Wed, Jul 6, 2016 at 12:54 PM, Vivek Goyal <vgo...@redhat.com> wrote: > > On Wed, Jul 06, 2016 at 06:36:49AM +0200, Miklos Szeredi wrote: > >> On Tue, Jul 5, 2016 at 11:16 PM, Vivek Goyal <vgo...@redha

Re: [PATCH 5/5] overlayfs: Use vfs_getxattr_noperm() for real inode

2016-07-07 Thread Vivek Goyal
On Wed, Jul 06, 2016 at 04:58:37PM +0200, Miklos Szeredi wrote: > On Wed, Jul 6, 2016 at 12:54 PM, Vivek Goyal wrote: > > On Wed, Jul 06, 2016 at 06:36:49AM +0200, Miklos Szeredi wrote: > >> On Tue, Jul 5, 2016 at 11:16 PM, Vivek Goyal wrote: > >> > On Tue, Ju

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-06 Thread Vivek Goyal
On Wed, Jul 06, 2016 at 01:09:00PM -0400, Vivek Goyal wrote: [..] > > >> The return should be -EOPNOTSUPP from security modules that don't > > >> support the attribute "name". This will make it possible to support > > >> multiple modules that p

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-06 Thread Vivek Goyal
On Wed, Jul 06, 2016 at 01:09:00PM -0400, Vivek Goyal wrote: [..] > > >> The return should be -EOPNOTSUPP from security modules that don't > > >> support the attribute "name". This will make it possible to support > > >> multiple modules that p

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-06 Thread Vivek Goyal
On Wed, Jul 06, 2016 at 01:09:00PM -0400, Vivek Goyal wrote: > On Tue, Jul 05, 2016 at 02:34:43PM -0700, Casey Schaufler wrote: > > On 7/5/2016 2:15 PM, Vivek Goyal wrote: > > > On Tue, Jul 05, 2016 at 01:22:22PM -0700, Casey Schaufler wrote: > > >> On 7/5/2

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-06 Thread Vivek Goyal
On Wed, Jul 06, 2016 at 01:09:00PM -0400, Vivek Goyal wrote: > On Tue, Jul 05, 2016 at 02:34:43PM -0700, Casey Schaufler wrote: > > On 7/5/2016 2:15 PM, Vivek Goyal wrote: > > > On Tue, Jul 05, 2016 at 01:22:22PM -0700, Casey Schaufler wrote: > > >> On 7/5/2

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-06 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 02:34:43PM -0700, Casey Schaufler wrote: > On 7/5/2016 2:15 PM, Vivek Goyal wrote: > > On Tue, Jul 05, 2016 at 01:22:22PM -0700, Casey Schaufler wrote: > >> On 7/5/2016 8:50 AM, Vivek Goyal wrote: > >>> Provide a security hook which is called w

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-06 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 02:34:43PM -0700, Casey Schaufler wrote: > On 7/5/2016 2:15 PM, Vivek Goyal wrote: > > On Tue, Jul 05, 2016 at 01:22:22PM -0700, Casey Schaufler wrote: > >> On 7/5/2016 8:50 AM, Vivek Goyal wrote: > >>> Provide a security hook which is called w

Re: [PATCH 5/5] overlayfs: Use vfs_getxattr_noperm() for real inode

2016-07-06 Thread Vivek Goyal
On Wed, Jul 06, 2016 at 06:36:49AM +0200, Miklos Szeredi wrote: > On Tue, Jul 5, 2016 at 11:16 PM, Vivek Goyal <vgo...@redhat.com> wrote: > > On Tue, Jul 05, 2016 at 01:29:39PM -0700, Casey Schaufler wrote: > >> On 7/5/2016 8:50 AM, Vivek Goyal wrote: > >>

Re: [PATCH 5/5] overlayfs: Use vfs_getxattr_noperm() for real inode

2016-07-06 Thread Vivek Goyal
On Wed, Jul 06, 2016 at 06:36:49AM +0200, Miklos Szeredi wrote: > On Tue, Jul 5, 2016 at 11:16 PM, Vivek Goyal wrote: > > On Tue, Jul 05, 2016 at 01:29:39PM -0700, Casey Schaufler wrote: > >> On 7/5/2016 8:50 AM, Vivek Goyal wrote: > >> > ovl_getxattr() currently us

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 05:45:25PM -0400, Paul Moore wrote: > On Tue, Jul 5, 2016 at 11:50 AM, Vivek Goyal <vgo...@redhat.com> wrote: > > Provide a security hook which is called when xattrs of a file are being > > copied up. This hook is called once for each xattr and one

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 05:45:25PM -0400, Paul Moore wrote: > On Tue, Jul 5, 2016 at 11:50 AM, Vivek Goyal wrote: > > Provide a security hook which is called when xattrs of a file are being > > copied up. This hook is called once for each xattr and one can either > > accept

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 05:35:22PM -0400, Paul Moore wrote: > On Tue, Jul 5, 2016 at 11:50 AM, Vivek Goyal <vgo...@redhat.com> wrote: > > Provide a security hook to label new file correctly when a file is copied > > up from lower layer to upper layer of a overlay/union mount.

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 05:35:22PM -0400, Paul Moore wrote: > On Tue, Jul 5, 2016 at 11:50 AM, Vivek Goyal wrote: > > Provide a security hook to label new file correctly when a file is copied > > up from lower layer to upper layer of a overlay/union mount. > > > > This

Re: [PATCH 5/5] overlayfs: Use vfs_getxattr_noperm() for real inode

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 01:29:39PM -0700, Casey Schaufler wrote: > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > ovl_getxattr() currently uses vfs_getxattr() on realinode. This fails > > if mounter does not have DAC/MAC permission to access getxattr. > > > > Specifically

Re: [PATCH 5/5] overlayfs: Use vfs_getxattr_noperm() for real inode

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 01:29:39PM -0700, Casey Schaufler wrote: > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > ovl_getxattr() currently uses vfs_getxattr() on realinode. This fails > > if mounter does not have DAC/MAC permission to access getxattr. > > > > Specifically

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 01:22:22PM -0700, Casey Schaufler wrote: > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > Provide a security hook which is called when xattrs of a file are being > > copied up. This hook is called once for each xattr and one can either > > accept

Re: [PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 01:22:22PM -0700, Casey Schaufler wrote: > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > Provide a security hook which is called when xattrs of a file are being > > copied up. This hook is called once for each xattr and one can either > > accept

Re: [PATCH 3/5] selinux: Pass security pointer to determine_inode_label()

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 01:25:22PM -0700, Casey Schaufler wrote: > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > Right now selinux_determine_inode_label() works on security pointer of > > current task. Soon I need this to work on a security pointer retrieved > > from a set of cr

Re: [PATCH 3/5] selinux: Pass security pointer to determine_inode_label()

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 01:25:22PM -0700, Casey Schaufler wrote: > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > Right now selinux_determine_inode_label() works on security pointer of > > current task. Soon I need this to work on a security pointer retrieved > > from a set of cr

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 12:36:17PM -0700, Casey Schaufler wrote: > > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > Provide a security hook to label new file correctly when a file is copied > > up from lower layer to upper layer of a overlay/union mount. > > > > Th

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-05 Thread Vivek Goyal
On Tue, Jul 05, 2016 at 12:36:17PM -0700, Casey Schaufler wrote: > > On 7/5/2016 8:50 AM, Vivek Goyal wrote: > > Provide a security hook to label new file correctly when a file is copied > > up from lower layer to upper layer of a overlay/union mount. > > > > Th

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-05 Thread Vivek Goyal
e system] > > url: > https://github.com/0day-ci/linux/commits/Vivek-Goyal/Overlayfs-SELinux-Support/20160706-37 > base: https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git > overlayfs-next > config: i386-randconfig-s0-201627 (attached as .config) > compiler

Re: [PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-05 Thread Vivek Goyal
e system] > > url: > https://github.com/0day-ci/linux/commits/Vivek-Goyal/Overlayfs-SELinux-Support/20160706-37 > base: https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git > overlayfs-next > config: i386-randconfig-s0-201627 (attached as .config) > compiler

[PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-05 Thread Vivek Goyal
, copy up will be aborted. In SELinux, label of lower file is not copied up. File already has been set with right label at the time of creation and we don't want to overwrite that label. Signed-off-by: David Howells <dhowe...@redhat.com> Signed-off-by: Vivek Goyal <vgo...@redhat.com> ---

[PATCH 3/5] selinux: Pass security pointer to determine_inode_label()

2016-07-05 Thread Vivek Goyal
Right now selinux_determine_inode_label() works on security pointer of current task. Soon I need this to work on a security pointer retrieved from a set of creds. So start passing in a pointer and caller can decide where to fetch security pointer from. Signed-off-by: Vivek Goyal <

[PATCH 2/5] security,overlayfs: Provide security hook for copy up of xattrs for overlay file

2016-07-05 Thread Vivek Goyal
, copy up will be aborted. In SELinux, label of lower file is not copied up. File already has been set with right label at the time of creation and we don't want to overwrite that label. Signed-off-by: David Howells Signed-off-by: Vivek Goyal --- fs/overlayfs/copy_up.c| 8 include

[PATCH 3/5] selinux: Pass security pointer to determine_inode_label()

2016-07-05 Thread Vivek Goyal
Right now selinux_determine_inode_label() works on security pointer of current task. Soon I need this to work on a security pointer retrieved from a set of creds. So start passing in a pointer and caller can decide where to fetch security pointer from. Signed-off-by: Vivek Goyal --- security

[PATCH 5/5] overlayfs: Use vfs_getxattr_noperm() for real inode

2016-07-05 Thread Vivek Goyal
tr_noperm(). Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- fs/overlayfs/inode.c | 7 +-- fs/xattr.c| 28 +++- include/linux/xattr.h | 1 + 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.

[PATCH 5/5] overlayfs: Use vfs_getxattr_noperm() for real inode

2016-07-05 Thread Vivek Goyal
tr_noperm(). Signed-off-by: Vivek Goyal --- fs/overlayfs/inode.c | 7 +-- fs/xattr.c| 28 +++- include/linux/xattr.h | 1 + 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 36dfd86..a5d33

[PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-05 Thread Vivek Goyal
creation. In SELinux, newly copied up file gets same label as lower file for non-context mounts. But it gets label specified in mount option context= for context mounts. Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- fs/overlayfs/copy_up.c| 8 include/linux/lsm_hooks.

[PATCH 1/5] security, overlayfs: provide copy up security hook for unioned files

2016-07-05 Thread Vivek Goyal
creation. In SELinux, newly copied up file gets same label as lower file for non-context mounts. But it gets label specified in mount option context= for context mounts. Signed-off-by: Vivek Goyal --- fs/overlayfs/copy_up.c| 8 include/linux/lsm_hooks.h | 13 + include/linux

[PATCH 0/5][RFC] Overlayfs SELinux Support

2016-07-05 Thread Vivek Goyal
ome. Thanks Vivek Vivek Goyal (5): security, overlayfs: provide copy up security hook for unioned files security,overlayfs: Provide security hook for copy up of xattrs for overlay file selinux: Pass security pointer to determine_inode_label() overlayfs: Correctly label newly created file o

[PATCH 4/5] overlayfs: Correctly label newly created file over whiteout

2016-07-05 Thread Vivek Goyal
be such that as if task had created file in upper/. This patch introduces a new hook which determines the label dentry will get if it had been created by task in upper and sets the secid of label in passed set of creds. Caller makes use of these new creds for file creation. Signed-off-by: Vivek Goyal

[PATCH 0/5][RFC] Overlayfs SELinux Support

2016-07-05 Thread Vivek Goyal
ome. Thanks Vivek Vivek Goyal (5): security, overlayfs: provide copy up security hook for unioned files security,overlayfs: Provide security hook for copy up of xattrs for overlay file selinux: Pass security pointer to determine_inode_label() overlayfs: Correctly label newly created file o

[PATCH 4/5] overlayfs: Correctly label newly created file over whiteout

2016-07-05 Thread Vivek Goyal
be such that as if task had created file in upper/. This patch introduces a new hook which determines the label dentry will get if it had been created by task in upper and sets the secid of label in passed set of creds. Caller makes use of these new creds for file creation. Signed-off-by: Vivek Goyal

[PATCH] overlayfs: Warn instead of error if d_type is not supported

2016-07-01 Thread Vivek Goyal
it. This should allow existing docker setups to continue working after kernel upgrade. Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- fs/overlayfs/super.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) Index: rhvgoyal-linux/fs/overlayfs/s

[PATCH] overlayfs: Warn instead of error if d_type is not supported

2016-07-01 Thread Vivek Goyal
it. This should allow existing docker setups to continue working after kernel upgrade. Signed-off-by: Vivek Goyal --- fs/overlayfs/super.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) Index: rhvgoyal-linux/fs/overlayfs/super.c

Re: [PATCH] ovl: fix uid/gid when creating over whiteout

2016-06-15 Thread Vivek Goyal
On Wed, Jun 15, 2016 at 04:09:47PM +0200, Miklos Szeredi wrote: > On Wed, Jun 15, 2016 at 4:01 PM, Vivek Goyal <vgo...@redhat.com> wrote: > > On Wed, Jun 15, 2016 at 03:30:02PM +0200, Miklos Szeredi wrote: > > >> --- a/fs/overlayfs/dir.c > >> +++ b/fs/ove

Re: [PATCH] ovl: fix uid/gid when creating over whiteout

2016-06-15 Thread Vivek Goyal
On Wed, Jun 15, 2016 at 04:09:47PM +0200, Miklos Szeredi wrote: > On Wed, Jun 15, 2016 at 4:01 PM, Vivek Goyal wrote: > > On Wed, Jun 15, 2016 at 03:30:02PM +0200, Miklos Szeredi wrote: > > >> --- a/fs/overlayfs/dir.c > >> +++ b/fs/overlayfs/dir.c > &g

Re: [PATCH] ovl: fix uid/gid when creating over whiteout

2016-06-15 Thread Vivek Goyal
On Wed, Jun 15, 2016 at 03:30:02PM +0200, Miklos Szeredi wrote: > Hi Vivek, > > I've tested this to fix the regresion that Stephen reported. I think this > also is a good base for the selinux fix. > > Pushed to overlayfs-linus and overlayfs-next branches of > >

Re: [PATCH] ovl: fix uid/gid when creating over whiteout

2016-06-15 Thread Vivek Goyal
On Wed, Jun 15, 2016 at 03:30:02PM +0200, Miklos Szeredi wrote: > Hi Vivek, > > I've tested this to fix the regresion that Stephen reported. I think this > also is a good base for the selinux fix. > > Pushed to overlayfs-linus and overlayfs-next branches of > >

Re: [PATCH] ovl: xattr filter fix

2016-06-02 Thread Vivek Goyal
t; > For listxattrs it might be measurable in pathological cases, but I very > much hope nobody cares. If they do, we'll fix it then. > > Reported-by: Vivek Goyal <vgo...@redhat.com> > Signed-off-by: Miklos Szeredi <mszer...@redhat.com> > Fixes: b96809173e94 ("security_d_insta

Re: [PATCH] ovl: xattr filter fix

2016-06-02 Thread Vivek Goyal
t; > For listxattrs it might be measurable in pathological cases, but I very > much hope nobody cares. If they do, we'll fix it then. > > Reported-by: Vivek Goyal > Signed-off-by: Miklos Szeredi > Fixes: b96809173e94 ("security_d_instantiate(): move to the point prior to > attac

Re: [PATCH] MAINTAINERS: Kdump maintainers update

2016-05-25 Thread Vivek Goyal
On Wed, May 25, 2016 at 06:24:10AM -0700, Joe Perches wrote: > On Wed, 2016-05-25 at 09:16 -0400, Vivek Goyal wrote: > > I am proposing following updates to kdump maintainership. I have got > > busy in other things and not getting time to spend on kdump.  > > > > Rem

Re: [PATCH] MAINTAINERS: Kdump maintainers update

2016-05-25 Thread Vivek Goyal
On Wed, May 25, 2016 at 06:24:10AM -0700, Joe Perches wrote: > On Wed, 2016-05-25 at 09:16 -0400, Vivek Goyal wrote: > > I am proposing following updates to kdump maintainership. I have got > > busy in other things and not getting time to spend on kdump.  > > > > Rem

[PATCH] MAINTAINERS: Kdump maintainers update

2016-05-25 Thread Vivek Goyal
as they have been contributing to kdump for a long time now and they are in a much better position to spend time on this than me. Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS

[PATCH] MAINTAINERS: Kdump maintainers update

2016-05-25 Thread Vivek Goyal
as they have been contributing to kdump for a long time now and they are in a much better position to spend time on this than me. Signed-off-by: Vivek Goyal --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 9c567a4..c030267 100644

[PATCH] overlayfs: Do d_type check only if work dir creation was successful

2016-05-20 Thread Vivek Goyal
failed in previous step. Signed-off-by: Vivek Goyal <vgo...@redhat.com> --- fs/overlayfs/super.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 791235e..48234425 100644 --- a/fs/overlayfs/super.c ++

[PATCH] overlayfs: Do d_type check only if work dir creation was successful

2016-05-20 Thread Vivek Goyal
failed in previous step. Signed-off-by: Vivek Goyal --- fs/overlayfs/super.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 791235e..48234425 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c

Re: [PATCH 00/10]block-throttle: add low/high limit

2016-05-18 Thread Vivek Goyal
On Fri, May 13, 2016 at 03:59:50PM -0700, Shaohua Li wrote: > On Fri, May 13, 2016 at 03:12:45PM -0400, Vivek Goyal wrote: > > On Tue, May 10, 2016 at 05:16:30PM -0700, Shaohua Li wrote: > > > Hi, > > > > > > This patch set adds low/high limit fo

Re: [PATCH 00/10]block-throttle: add low/high limit

2016-05-18 Thread Vivek Goyal
On Fri, May 13, 2016 at 03:59:50PM -0700, Shaohua Li wrote: > On Fri, May 13, 2016 at 03:12:45PM -0400, Vivek Goyal wrote: > > On Tue, May 10, 2016 at 05:16:30PM -0700, Shaohua Li wrote: > > > Hi, > > > > > > This patch set adds low/high limit fo

Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker

2016-05-17 Thread Vivek Goyal
On Tue, May 17, 2016 at 10:15:21AM +0200, Miklos Szeredi wrote: > On Tue, May 17, 2016 at 8:28 AM, Al Viro <v...@zeniv.linux.org.uk> wrote: > > On Mon, May 16, 2016 at 09:07:27AM -0400, Vivek Goyal wrote: > >> So it became clear that we need a check at mount time

Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker

2016-05-17 Thread Vivek Goyal
On Tue, May 17, 2016 at 10:15:21AM +0200, Miklos Szeredi wrote: > On Tue, May 17, 2016 at 8:28 AM, Al Viro wrote: > > On Mon, May 16, 2016 at 09:07:27AM -0400, Vivek Goyal wrote: > >> So it became clear that we need a check at mount time to make sure > >> d_type is su

Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker

2016-05-16 Thread Vivek Goyal
On Mon, May 16, 2016 at 04:45:09PM +1000, Daniel Axtens wrote: > Hi, > > I installed a fresh 4.6.0 kernel on my ppc64le system, and tried to run > a docker container. It failed. > > Docker gave me errors like this: > > docker: Error response from daemon: error creating overlay mount to >

Re: 45aebeaf4f67 "ovl: Ensure upper filesystem supports d_type" breaking Docker

2016-05-16 Thread Vivek Goyal
On Mon, May 16, 2016 at 04:45:09PM +1000, Daniel Axtens wrote: > Hi, > > I installed a fresh 4.6.0 kernel on my ppc64le system, and tried to run > a docker container. It failed. > > Docker gave me errors like this: > > docker: Error response from daemon: error creating overlay mount to >

Re: [PATCH 00/10]block-throttle: add low/high limit

2016-05-13 Thread Vivek Goyal
On Tue, May 10, 2016 at 05:16:30PM -0700, Shaohua Li wrote: > Hi, > > This patch set adds low/high limit for blk-throttle cgroup. The interface is > io.low and io.high. > > low limit implements best effort bandwidth/iops protection. If one cgroup > doesn't reach its low limit, no other cgroups

Re: [PATCH 00/10]block-throttle: add low/high limit

2016-05-13 Thread Vivek Goyal
On Tue, May 10, 2016 at 05:16:30PM -0700, Shaohua Li wrote: > Hi, > > This patch set adds low/high limit for blk-throttle cgroup. The interface is > io.low and io.high. > > low limit implements best effort bandwidth/iops protection. If one cgroup > doesn't reach its low limit, no other cgroups

Re: [PATCH v2 1/1] OverlayFS: Fix checking permissions during lookup.

2016-02-29 Thread Vivek Goyal
On Sat, Feb 27, 2016 at 01:40:02PM +0300, Nazarov Sergey wrote: > 26.02.2016, 22:41, "Vivek Goyal" <vgo...@redhat.com>: > > > > So what's the problem we are trying to solve. Why should we able to > > override the DAC checks of lower layer if same director

Re: [PATCH v2 1/1] OverlayFS: Fix checking permissions during lookup.

2016-02-29 Thread Vivek Goyal
On Sat, Feb 27, 2016 at 01:40:02PM +0300, Nazarov Sergey wrote: > 26.02.2016, 22:41, "Vivek Goyal" : > > > > So what's the problem we are trying to solve. Why should we able to > > override the DAC checks of lower layer if same directory in upper > > is searcha

Re: [PATCH v2 1/1] OverlayFS: Fix checking permissions during lookup.

2016-02-29 Thread Vivek Goyal
On Sun, Feb 28, 2016 at 12:09:42PM +0100, Ignacy Gawędzki wrote: > On Fri, Feb 26, 2016 at 02:41:43PM -0500, thus spake Vivek Goyal: > > CCing linux-fsdevel as it is a wider issue. > > > > > > On Wed, Feb 24, 2016 at 02:55:52PM +0100, Ignacy Gawędzki

Re: [PATCH v2 1/1] OverlayFS: Fix checking permissions during lookup.

2016-02-29 Thread Vivek Goyal
On Sun, Feb 28, 2016 at 12:09:42PM +0100, Ignacy Gawędzki wrote: > On Fri, Feb 26, 2016 at 02:41:43PM -0500, thus spake Vivek Goyal: > > CCing linux-fsdevel as it is a wider issue. > > > > > > On Wed, Feb 24, 2016 at 02:55:52PM +0100, Ignacy Gawędzki

Re: [PATCH v2 1/1] OverlayFS: Fix checking permissions during lookup.

2016-02-26 Thread Vivek Goyal
CCing linux-fsdevel as it is a wider issue. On Wed, Feb 24, 2016 at 02:55:52PM +0100, Ignacy Gawędzki wrote: > Add alternate lookup_one_len_check function to fs/namei.c which does > what lookup_one_len did until now with a boolean argument telling > whether to check that the base directory is

Re: [PATCH v2 1/1] OverlayFS: Fix checking permissions during lookup.

2016-02-26 Thread Vivek Goyal
CCing linux-fsdevel as it is a wider issue. On Wed, Feb 24, 2016 at 02:55:52PM +0100, Ignacy Gawędzki wrote: > Add alternate lookup_one_len_check function to fs/namei.c which does > what lookup_one_len did until now with a boolean argument telling > whether to check that the base directory is

Re: [PATCH] ovl: ignore lower entries when checking purity of non-directory entries

2016-02-03 Thread Vivek Goyal
On Mon, Feb 01, 2016 at 06:43:19PM +0300, Konstantin Khlebnikov wrote: [..] > > Hi Konstantin, > > > > Thanks for the patch. This patch works for me also does not break > > unionmount-testsuite. > > Interesting. I haven't heard about this testsuite. Never read Documentation. > =) > > I've send

Re: [PATCH] ovl: ignore lower entries when checking purity of non-directory entries

2016-02-03 Thread Vivek Goyal
On Mon, Feb 01, 2016 at 06:43:19PM +0300, Konstantin Khlebnikov wrote: [..] > > Hi Konstantin, > > > > Thanks for the patch. This patch works for me also does not break > > unionmount-testsuite. > > Interesting. I haven't heard about this testsuite. Never read Documentation. > =) > > I've send

Re: [PATCH] ovl: ignore lower entries when checking purity of non-directory entries

2016-02-01 Thread Vivek Goyal
per hence whiteout is left. > > So why file was not PURE_UPPER in this case? I think because dentry is > still carrying some leftover state which was valid before rename. For example, > od->numlower was set to 1 as it was a lower file. After rename, this state > is not valid anymore

Re: [PATCH] ovl: ignore lower entries when checking purity of non-directory entries

2016-02-01 Thread Vivek Goyal
anymore as there is no such file in lower. > > Signed-off-by: Konstantin Khlebnikov <koc...@gmail.com> > Reported-by: Viktor Stanchev <m...@viktorstanchev.com> > Diagnosed-by: Vivek Goyal <vgo...@redhat.com> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=109611 Hi

Re: [RFC 0/3] block: proportional based blk-throttling

2016-01-22 Thread Vivek Goyal
On Fri, Jan 22, 2016 at 11:45:51AM -0800, Shaohua Li wrote: > On Fri, Jan 22, 2016 at 02:09:10PM -0500, Vivek Goyal wrote: > > On Fri, Jan 22, 2016 at 10:00:19AM -0800, Shaohua Li wrote: > > > On Fri, Jan 22, 2016 at 10:52:36AM -0500, Vivek Goyal wrote: > > > > On F

Re: [RFC 0/3] block: proportional based blk-throttling

2016-01-22 Thread Vivek Goyal
On Fri, Jan 22, 2016 at 10:00:19AM -0800, Shaohua Li wrote: > On Fri, Jan 22, 2016 at 10:52:36AM -0500, Vivek Goyal wrote: > > On Fri, Jan 22, 2016 at 09:48:22AM -0500, Tejun Heo wrote: > > > Hello, Shaohua. > > > > > > On Thu, Jan 21, 2016 a

Re: [RFC 0/3] block: proportional based blk-throttling

2016-01-22 Thread Vivek Goyal
On Fri, Jan 22, 2016 at 09:48:22AM -0500, Tejun Heo wrote: > Hello, Shaohua. > > On Thu, Jan 21, 2016 at 04:00:16PM -0800, Shaohua Li wrote: > > > The thing is that most of the possible contentions can be removed by > > > implementing per-cpu cache which shouldn't be too difficult. 10% > > >

Re: [RFC 0/3] block: proportional based blk-throttling

2016-01-22 Thread Vivek Goyal
On Thu, Jan 21, 2016 at 05:41:57PM -0500, Tejun Heo wrote: [..] > A simple approximation of IO cost such as fixed cost > per IO + cost proportional to IO size would do a far better job than > just depending on bandwidth or iops and that requires approximating > two variables over time. I'm not

Re: [RFC 0/3] block: proportional based blk-throttling

2016-01-22 Thread Vivek Goyal
On Fri, Jan 22, 2016 at 11:45:51AM -0800, Shaohua Li wrote: > On Fri, Jan 22, 2016 at 02:09:10PM -0500, Vivek Goyal wrote: > > On Fri, Jan 22, 2016 at 10:00:19AM -0800, Shaohua Li wrote: > > > On Fri, Jan 22, 2016 at 10:52:36AM -0500, Vivek Goyal wrote: > > > > On F

Re: [RFC 0/3] block: proportional based blk-throttling

2016-01-22 Thread Vivek Goyal
On Fri, Jan 22, 2016 at 10:00:19AM -0800, Shaohua Li wrote: > On Fri, Jan 22, 2016 at 10:52:36AM -0500, Vivek Goyal wrote: > > On Fri, Jan 22, 2016 at 09:48:22AM -0500, Tejun Heo wrote: > > > Hello, Shaohua. > > > > > > On Thu, Jan 21, 2016 a

Re: [RFC 0/3] block: proportional based blk-throttling

2016-01-22 Thread Vivek Goyal
On Fri, Jan 22, 2016 at 09:48:22AM -0500, Tejun Heo wrote: > Hello, Shaohua. > > On Thu, Jan 21, 2016 at 04:00:16PM -0800, Shaohua Li wrote: > > > The thing is that most of the possible contentions can be removed by > > > implementing per-cpu cache which shouldn't be too difficult. 10% > > >

Re: [RFC 0/3] block: proportional based blk-throttling

2016-01-22 Thread Vivek Goyal
On Thu, Jan 21, 2016 at 05:41:57PM -0500, Tejun Heo wrote: [..] > A simple approximation of IO cost such as fixed cost > per IO + cost proportional to IO size would do a far better job than > just depending on bandwidth or iops and that requires approximating > two variables over time. I'm not

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