diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-06 08:52:53 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-06 08:52:53 -0700 |
commit | 8d4ef4e15ec57eec5d24fb109fbc220eea9f0caf (patch) | |
tree | a3e047f8f3670b06a367a211d1bb5f1785302736 /fs/namespace.c | |
parent | 1249b571ba2a44a929f3053fd0a90b36a8535c55 (diff) | |
parent | 85fdee1eef1a9e48ad5716916677e0c5fbc781e3 (diff) | |
download | linux-8d4ef4e15ec57eec5d24fb109fbc220eea9f0caf.tar.gz linux-8d4ef4e15ec57eec5d24fb109fbc220eea9f0caf.tar.xz |
Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs
Pull overlayfs fixes from Miklos Szeredi:
"Fix a regression in 4.14 and one in 4.13. The latter is a case when
Docker is doing something it really shouldn't and gets away with it.
We now print a warning instead of erroring out.
There are also fixes to several error paths"
* 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
ovl: fix regression caused by exclusive upper/work dir protection
ovl: fix missing unlock_rename() in ovl_do_copy_up()
ovl: fix dentry leak in ovl_indexdir_cleanup()
ovl: fix dput() of ERR_PTR in ovl_cleanup_index()
ovl: fix error value printed in ovl_lookup_index()
ovl: fix may_write_real() for overlayfs directories
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 54059b142d6b..3b601f115b6c 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -468,7 +468,9 @@ static inline int may_write_real(struct file *file) /* File refers to upper, writable layer? */ upperdentry = d_real(dentry, NULL, 0, D_REAL_UPPER); - if (upperdentry && file_inode(file) == d_inode(upperdentry)) + if (upperdentry && + (file_inode(file) == d_inode(upperdentry) || + file_inode(file) == d_inode(dentry))) return 0; /* Lower layer: can't write to real file, sorry... */ |