Skip to content
Snippets Groups Projects
Commit 35866c6e authored by youngjun's avatar youngjun Committed by Yang Yingliang
Browse files

ovl: inode reference leak in ovl_is_inuse true case.


stable inclusion
from linux-4.19.134
commit 77cc397f6bb05121ef5544e9d78d29ecf4ba7165

--------------------------------

commit 24f14009 upstream.

When "ovl_is_inuse" true case, trap inode reference not put.  plus adding
the comment explaining sequence of ovl_is_inuse after ovl_setup_trap.

Fixes: 0be0bfd2 ("ovl: fix regression caused by overlapping layers detection")
Cc: <stable@vger.kernel.org> # v4.19+
Reviewed-by: default avatarAmir Goldstein <amir73il@gmail.com>
Signed-off-by: default avataryoungjun <her0gyugyu@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 668f513a
No related branches found
No related tags found
No related merge requests found
......@@ -1338,14 +1338,23 @@ static int ovl_get_lower_layers(struct super_block *sb, struct ovl_fs *ofs,
if (err < 0)
goto out;
/*
* Check if lower root conflicts with this overlay layers before
* checking if it is in-use as upperdir/workdir of "another"
* mount, because we do not bother to check in ovl_is_inuse() if
* the upperdir/workdir is in fact in-use by our
* upperdir/workdir.
*/
err = ovl_setup_trap(sb, stack[i].dentry, &trap, "lowerdir");
if (err)
goto out;
if (ovl_is_inuse(stack[i].dentry)) {
err = ovl_report_in_use(ofs, "lowerdir");
if (err)
if (err) {
iput(trap);
goto out;
}
}
mnt = clone_private_mount(&stack[i]);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment