]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
ovl: fix BUG_ON() in may_delete() when called from ovl_cleanup()
authorchenying <chenying.kernel@bytedance.com>
Mon, 16 Aug 2021 10:02:56 +0000 (18:02 +0800)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Tue, 12 Oct 2021 22:31:39 +0000 (16:31 -0600)
commit40273f0f878914d0543681f437456958e681c5fe
treeb0c3caf085149222ecf13ea84e1140b44ca9a259
parente96011a1e6c811b25f3d731a12ad9b05b5ea900a
ovl: fix BUG_ON() in may_delete() when called from ovl_cleanup()

BugLink: https://bugs.launchpad.net/bugs/1946802
commit 52d5a0c6bd8a89f460243ed937856354f8f253a3 upstream.

If function ovl_instantiate() returns an error, ovl_cleanup will be called
and try to remove newdentry from wdir, but the newdentry has been moved to
udir at this time.  This will causes BUG_ON(victim->d_parent->d_inode !=
dir) in fs/namei.c:may_delete.

Signed-off-by: chenying <chenying.kernel@bytedance.com>
Fixes: 01b39dcc9568 ("ovl: use inode_insert5() to hash a newly created inode")
Link: https://lore.kernel.org/linux-unionfs/e6496a94-a161-dc04-c38a-d2544633acb4@bytedance.com/
Cc: <stable@vger.kernel.org> # v4.18
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/overlayfs/dir.c