Skip to content

Commit 2c20c7d

Browse files
Miklos Szeredigregkh
authored andcommitted
virtiofs: fix userns
[ Upstream commit 0a7419c ] get_user_ns() is done twice (once in virtio_fs_get_tree() and once in fuse_conn_init()), resulting in a reference leak. Also looks better to use fsc->user_ns (which *should* be the current_user_ns() at this point). Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 87fe0ca commit 2c20c7d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎fs/fuse/virtio_fs.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,8 +1457,7 @@ static int virtio_fs_get_tree(struct fs_context *fsc)
14571457
return -ENOMEM;
14581458
}
14591459

1460-
fuse_conn_init(fc, fm, get_user_ns(current_user_ns()),
1461-
&virtio_fs_fiq_ops, fs);
1460+
fuse_conn_init(fc, fm, fsc->user_ns, &virtio_fs_fiq_ops, fs);
14621461
fc->release = fuse_free_conn;
14631462
fc->delete_stale = true;
14641463
fc->auto_submounts = true;

0 commit comments

Comments
 (0)