android_kernel_oneplus_msm8998/fs/overlayfs
Miklos Szeredi dbf72a4d45 ovl: verify upper dentry before unlink and rename
commit 11f3710417d026ea2f4fcf362d866342c5274185 upstream.

Unlink and rename in overlayfs checked the upper dentry for staleness by
verifying upper->d_parent against upperdir.  However the dentry can go
stale also by being unhashed, for example.

Expand the verification to actually look up the name again (under parent
lock) and check if it matches the upper dentry.  This matches what the VFS
does before passing the dentry to filesytem's unlink/rename methods, which
excludes any inconsistency caused by overlayfs.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-07-27 09:47:40 -07:00
..
copy_up.c ovl: use a minimal buffer in ovl_copy_xattr 2016-02-25 12:01:24 -08:00
dir.c ovl: verify upper dentry before unlink and rename 2016-07-27 09:47:40 -07:00
inode.c ovl: Copy up underlying inode's ->i_mode to overlay inode 2016-07-27 09:47:39 -07: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: Copy up underlying inode's ->i_mode to overlay inode 2016-07-27 09:47:39 -07:00
readdir.c ovl: check dentry positiveness in ovl_cleanup_whiteouts() 2016-02-25 12:01:24 -08:00
super.c fs: add file_dentry() 2016-04-20 15:42:12 +09:00