diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2016-09-06 21:32:47 +0200 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2016-09-06 21:37:49 +0200 |
commit | 42f559ed70897a7b74dd3e6293b42e6d2e511eaa (patch) | |
tree | 93366019d5e01b991171766568430107b16d3728 /target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch | |
parent | 81dfbfb069c3c8f3e5499f55b02b1f320208707d (diff) | |
download | mtk-20170518-42f559ed70897a7b74dd3e6293b42e6d2e511eaa.zip mtk-20170518-42f559ed70897a7b74dd3e6293b42e6d2e511eaa.tar.gz mtk-20170518-42f559ed70897a7b74dd3e6293b42e6d2e511eaa.tar.bz2 |
kernel: backport upstream overlayfs fixes
First two patches weren't marked for stable but are dependencies for
laters ones. The rest of patches was marked for stable but most likely
will be backported to 4.5+ only so we need to get them on our own.
An important fix is eea2fb4851e9d ("ovl: proper cleanup of workdir") as
it allows mounting overlayfs with dirty workdir, e.g. after power cut.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch')
-rw-r--r-- | target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch b/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch new file mode 100644 index 0000000..1785c9a --- /dev/null +++ b/target/linux/generic/patches-4.4/051-0004-ovl-remove-posix_acl_default-from-workdir.patch @@ -0,0 +1,49 @@ +From c11b9fdd6a612f376a5e886505f1c54c16d8c380 Mon Sep 17 00:00:00 2001 +From: Miklos Szeredi <mszeredi@redhat.com> +Date: Thu, 1 Sep 2016 11:11:59 +0200 +Subject: [PATCH] ovl: remove posix_acl_default from workdir + +Clear out posix acl xattrs on workdir and also reset the mode after +creation so that an inherited sgid bit is cleared. + +Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> +Cc: <stable@vger.kernel.org> +--- + fs/overlayfs/super.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +--- a/fs/overlayfs/super.c ++++ b/fs/overlayfs/super.c +@@ -773,6 +773,10 @@ retry: + struct kstat stat = { + .mode = S_IFDIR | 0, + }; ++ struct iattr attr = { ++ .ia_valid = ATTR_MODE, ++ .ia_mode = stat.mode, ++ }; + + if (work->d_inode) { + err = -EEXIST; +@@ -788,6 +792,21 @@ retry: + err = ovl_create_real(dir, work, &stat, NULL, NULL, true); + if (err) + goto out_dput; ++ ++ err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_DEFAULT); ++ if (err && err != -ENODATA) ++ goto out_dput; ++ ++ err = vfs_removexattr(work, XATTR_NAME_POSIX_ACL_ACCESS); ++ if (err && err != -ENODATA) ++ goto out_dput; ++ ++ /* Clear any inherited mode bits */ ++ mutex_lock(&work->d_inode->i_mutex); ++ err = notify_change(work, &attr, NULL); ++ mutex_unlock(&work->d_inode->i_mutex); ++ if (err) ++ goto out_dput; + } + out_unlock: + mutex_unlock(&dir->i_mutex); |