linux/fs/overlayfs
Konstantin Khlebnikov 84889d4933 ovl: check dentry positiveness in ovl_cleanup_whiteouts()
This patch fixes kernel crash at removing directory which contains
whiteouts from lower layers.

Cache of directory content passed as "list" contains entries from all
layers, including whiteouts from lower layers. So, lookup in upper dir
(moved into work at this stage) will return negative entry. Plus this
cache is filled long before and we can race with external removal.

Example:
 mkdir -p lower0/dir lower1/dir upper work overlay
 touch lower0/dir/a lower0/dir/b
 mknod lower1/dir/a c 0 0
 mount -t overlay none overlay -o lowerdir=lower1:lower0,upperdir=upper,workdir=work
 rm -fr overlay/dir

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Cc: <stable@vger.kernel.org> # 3.18+
2015-12-11 16:30:49 +01:00
..
copy_up.c ovl: use a minimal buffer in ovl_copy_xattr 2015-11-10 17:08:42 +01:00
dir.c ovl: mount read-only if workdir can't be created 2015-05-19 14:30:12 +02:00
inode.c ovl: setattr: check permissions before copy-up 2015-12-11 16:30:49 +01:00
Kconfig ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
Makefile ovl: rename filesystem type to "overlay" 2014-11-20 16:39:59 +01:00
overlayfs.h ovl: default permissions 2015-10-12 17:11:44 +02:00
readdir.c ovl: check dentry positiveness in ovl_cleanup_whiteouts() 2015-12-11 16:30:49 +01:00
super.c ovl: setattr: check permissions before copy-up 2015-12-11 16:30:49 +01:00