]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-linux-kernel/ti-linux-kernel-next.git/commit
ovl: verify upper dentry before unlink and rename
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 21 Mar 2016 16:31:44 +0000 (17:31 +0100)
committerMiklos Szeredi <miklos@szeredi.hu>
Mon, 21 Mar 2016 16:31:44 +0000 (17:31 +0100)
commit11f3710417d026ea2f4fcf362d866342c5274185
tree9f0904f868dd155bf00b0b10caf264d2a4065355
parent3c2de27d793bf55167804fc47954711e94f27be7
ovl: verify upper dentry before unlink and rename

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>
fs/overlayfs/dir.c