summaryrefslogtreecommitdiff
path: root/fs/overlayfs/super.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2015-12-11 16:30:49 +0100
committerMiklos Szeredi <miklos@szeredi.hu>2015-12-11 16:30:49 +0100
commitcf9a6784f7c1b5ee2b9159a1246e327c331c5697 (patch)
tree00479d7bda053b037fe13c7408e3540365f907bf /fs/overlayfs/super.c
parented06e069775ad9236087594a1c1667367e983fb5 (diff)
downloadlwn-cf9a6784f7c1b5ee2b9159a1246e327c331c5697.tar.gz
lwn-cf9a6784f7c1b5ee2b9159a1246e327c331c5697.zip
ovl: setattr: check permissions before copy-up
Without this copy-up of a file can be forced, even without actually being allowed to do anything on the file. [Arnd Bergmann] include <linux/pagemap.h> for PAGE_CACHE_SIZE (used by MAX_LFS_FILESIZE definition). Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <stable@vger.kernel.org>
Diffstat (limited to 'fs/overlayfs/super.c')
-rw-r--r--fs/overlayfs/super.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index ec31711d4886..b08bf4d3a405 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -9,6 +9,7 @@
#include <linux/fs.h>
#include <linux/namei.h>
+#include <linux/pagemap.h>
#include <linux/xattr.h>
#include <linux/security.h>
#include <linux/mount.h>
@@ -936,6 +937,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
}
sb->s_stack_depth = 0;
+ sb->s_maxbytes = MAX_LFS_FILESIZE;
if (ufs->config.upperdir) {
if (!ufs->config.workdir) {
pr_err("overlayfs: missing 'workdir'\n");