]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: during copy up, switch to mounter's creds early
authorVivek Goyal <vgoyal@redhat.com>
Tue, 6 Sep 2016 17:40:32 +0000 (13:40 -0400)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 19 Sep 2016 14:50:59 +0000 (16:50 +0200)
commit678e00ac40a6f914a1e14f337677d8347a40de91
tree00f99d86265b7bae9c622c90fa4b72f0c1f6e788
parent517c84172c9356ce19d6396c42f109f2434503ea
ovl: during copy up, switch to mounter's creds early

Now, we have the notion that copy up of a file is done with the creds
of mounter of overlay filesystem (as opposed to task). Right now before
we switch creds, we do some vfs_getattr() operations in the context of
task and that itself can fail. We should do that getattr() using the
creds of mounter instead.

So this patch switches to mounter's creds early during copy up process so
that even vfs_getattr() is done with mounter's creds.

Do not call revert_creds() unless we have already called
ovl_override_creds(). [Reported by Arnd Bergmann]

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/copy_up.c
fs/overlayfs/inode.c