Skip to content

Commit a94fd93

Browse files
mtk-xiangshengbrauner
authored andcommitted
virtiofs: add filesystem context source name check
In certain scenarios, for example, during fuzz testing, the source name may be NULL, which could lead to a kernel panic. Therefore, an extra check for the source name should be added. Fixes: a62a8ef ("virtio-fs: add virtiofs filesystem") Cc: <stable@vger.kernel.org> # all LTS kernels Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com> Link: https://lore.kernel.org/20250407115111.25535-1-xiangsheng.hou@mediatek.com Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent cfa5f33 commit a94fd93

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

fs/fuse/virtio_fs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,9 @@ static int virtio_fs_get_tree(struct fs_context *fsc)
16691669
unsigned int virtqueue_size;
16701670
int err = -EIO;
16711671

1672+
if (!fsc->source)
1673+
return invalf(fsc, "No source specified");
1674+
16721675
/* This gets a reference on virtio_fs object. This ptr gets installed
16731676
* in fc->iq->priv. Once fuse_conn is going away, it calls ->put()
16741677
* to drop the reference to this object.

0 commit comments

Comments
 (0)