]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ovl: verify upper dentry before unlink and rename
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 21 Jul 2016 20:24:59 +0000 (13:24 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 31 Jul 2016 00:08:05 +0000 (17:08 -0700)
commitb4f6405a34d3271f9656a07dbe8ae8713af837cb
treeae625155fcee7ae8984003401f88378f540911c6
parent3eb98527fcecb3b74fba5145c62c4d8e3ef95d4e
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>
Orabug: 24363418
CVE:CVE-2016-6198,CVE-2016-6197
Based on mainline v4.6 commit 11f3710417d026ea2f4fcf362d866342c5274185
Conflicts:
  fs/overlayfs/dir.c - code base
Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
fs/overlayfs/dir.c