]> git.baikalelectronics.ru Git - kernel.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)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 22 Jul 2016 08:54:20 +0000 (10:54 +0200)
commit6eee90d0e53d81991e18f844686dc6df8f3a1119
tree7f36d4f2a49719673c436767707d25ef5f5e9041
parentf143f125595c107577489d84a5556c1f6aff1d5a
ovl: verify upper dentry in ovl_remove_and_whiteout()

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 98ae40352110 ("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>
fs/overlayfs/dir.c