]> www.infradead.org Git - users/jedix/linux-maple.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)
committerAnand Jain <anand.jain@oracle.com>
Thu, 26 Oct 2017 08:15:29 +0000 (16:15 +0800)
commit8d11f28e89a4f18e90ad718d6b03785b84011435
tree8fa5cbc06f4c37231bba95c7edeafdca31250202
parent1b37805890aaa6edfa38c79ea7aeaddf9b3c037f
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>
Orabug: 25684456

(backport upstream commit 8eac98b8beb4711c4ab61822cac077fd6660e820)

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Acked-by: James Morris <james.l.morris@oracle.com>
Reviewed-by: James Morris <james.l.morris@oracle.com>
fs/overlayfs/copy_up.c
fs/overlayfs/inode.c