Skip to content

Commit 156eeef

Browse files
mtk-xiangshengvijay-suman
authored andcommitted
virtiofs: add filesystem context source name check
commit a94fd938df2b1628da66b498aa0eeb89593bc7a2 upstream. 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: <[email protected]> # all LTS kernels Signed-off-by: Xiangsheng Hou <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Christian Brauner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 5ee09cdaf3414f6c92960714af46d3d90eede2f3) Signed-off-by: Vijayendra Suman <[email protected]>
1 parent 68831d5 commit 156eeef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/fuse/virtio_fs.c

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

1436+
if (!fsc->source)
1437+
return invalf(fsc, "No source specified");
1438+
14361439
/* This gets a reference on virtio_fs object. This ptr gets installed
14371440
* in fc->iq->priv. Once fuse_conn is going away, it calls ->put()
14381441
* to drop the reference to this object.

0 commit comments

Comments
 (0)