Skip to content

Commit 7f8ed28

Browse files
HBh25YMiklos Szeredi
authored andcommitted
fuse: dax: set fc->dax to NULL in fuse_dax_conn_free()
fuse_dax_conn_free() will be called when fuse_fill_super_common() fails after fuse_dax_conn_alloc(). Then deactivate_locked_super() in virtio_fs_get_tree() will call virtio_kill_sb() to release the discarded superblock. This will call fuse_dax_conn_free() again in fuse_conn_put(), resulting in a possible double free. Fixes: 1dd5395 ("virtiofs: add a mount option to enable dax") Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Reviewed-by: Jingbo Xu <jefflexu@linux.alibaba.com> Cc: <stable@vger.kernel.org> # v5.10 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent c4d361f commit 7f8ed28

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/fuse/dax.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,7 @@ void fuse_dax_conn_free(struct fuse_conn *fc)
12221222
if (fc->dax) {
12231223
fuse_free_dax_mem_ranges(&fc->dax->free_ranges);
12241224
kfree(fc->dax);
1225+
fc->dax = NULL;
12251226
}
12261227
}
12271228

0 commit comments

Comments
 (0)