Greg Kurz
2021-May-20 15:46 UTC
[PATCH v4 1/5] fuse: Fix leak in fuse_dentry_automount() error path
Some rollback was forgotten during the addition of crossmounts. Fixes: bf109c64040f ("fuse: implement crossmounts") Cc: mreitz at redhat.com Signed-off-by: Greg Kurz <groug at kaod.org> --- fs/fuse/dir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 1b6c001a7dd1..fb2af70596c3 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -339,8 +339,11 @@ static struct vfsmount *fuse_dentry_automount(struct path *path) /* Initialize superblock, making @mp_fi its root */ err = fuse_fill_super_submount(sb, mp_fi); - if (err) + if (err) { + fuse_conn_put(fc); + kfree(fm); goto out_put_sb; + } sb->s_flags |= SB_ACTIVE; fsc->root = dget(sb->s_root); -- 2.26.3
Al Viro
2021-May-20 19:45 UTC
[PATCH v4 1/5] fuse: Fix leak in fuse_dentry_automount() error path
On Thu, May 20, 2021 at 05:46:50PM +0200, Greg Kurz wrote:> Some rollback was forgotten during the addition of crossmounts.Have you actually tested that? Because I strongly suspect that by that point the ownership of fc and fm is with sb and those should be taken care of by deactivate_locked_super().