This is a note to let you know that I've just added the patch titled fuse: dax: set fc->dax to NULL in fuse_dax_conn_free() to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: fuse-dax-set-fc-dax-to-null-in-fuse_dax_conn_free.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 7f8ed28d1401320bcb02dda81b3c23ab2dc5a6d8 Mon Sep 17 00:00:00 2001 From: Hangyu Hua <hbh25y@xxxxxxxxx> Date: Thu, 16 Nov 2023 15:57:26 +0800 Subject: fuse: dax: set fc->dax to NULL in fuse_dax_conn_free() From: Hangyu Hua <hbh25y@xxxxxxxxx> commit 7f8ed28d1401320bcb02dda81b3c23ab2dc5a6d8 upstream. 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: 1dd539577c42 ("virtiofs: add a mount option to enable dax") Signed-off-by: Hangyu Hua <hbh25y@xxxxxxxxx> Acked-by: Vivek Goyal <vgoyal@xxxxxxxxxx> Reviewed-by: Jingbo Xu <jefflexu@xxxxxxxxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> # v5.10 Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/fuse/dax.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/fuse/dax.c +++ b/fs/fuse/dax.c @@ -1222,6 +1222,7 @@ void fuse_dax_conn_free(struct fuse_conn if (fc->dax) { fuse_free_dax_mem_ranges(&fc->dax->free_ranges); kfree(fc->dax); + fc->dax = NULL; } } Patches currently in stable-queue which might be from hbh25y@xxxxxxxxx are queue-6.6/fuse-dax-set-fc-dax-to-null-in-fuse_dax_conn_free.patch