]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ovl: verify upper dentry in ovl_remove_and_whiteout()
authorMaxim Patlasov <mpatlasov@virtuozzo.com>
Fri, 22 Jul 2016 01:24:26 +0000 (18:24 -0700)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Wed, 16 Aug 2017 15:33:14 +0000 (08:33 -0700)
commit2a9857f39ef77bf8bd18f35daf6654fbe1d965ed
tree2d39e88ff93ca690db1d2742b9e49a98e1dca822
parentcf32a76de4353b95a1c7f46b0b681388aba33db2
ovl: verify upper dentry in ovl_remove_and_whiteout()

Orabug: 26175588

The upper dentry may become stale before we call ovl_lock_rename_workdir.
For example, someone could (mistakenly or maliciously) manually unlink(2)
it directly from upperdir.

To ensure it is not stale, let's lookup it after ovl_lock_rename_workdir
and and check if it matches the upper dentry.

Essentially, it is the same problem and similar solution as in
commit 11f3710417d0 ("ovl: verify upper dentry before unlink and rename").

Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: <stable@vger.kernel.org>
(cherry picked from commit cfc9fde0b07c3b44b570057c5f93dda59dca1c94)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Ethan Zhao <ethan.zhao@oracle.com>
fs/overlayfs/dir.c