]> git.baikalelectronics.ru Git - kernel.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)
commit98ae403521100a009398cc1665aba771dd1c2efb
tree9f0904f868dd155bf00b0b10caf264d2a4065355
parent1b81ee5364c084624c89d3ea532d0b503afff4e2
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