]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
cuse: prevent clone
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 14 Apr 2021 08:40:58 +0000 (10:40 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 14 Apr 2021 08:40:58 +0000 (10:40 +0200)
For cloned connections cuse_channel_release() will be called more than
once, resulting in use after free.

Prevent device cloning for CUSE, which does not make sense at this point,
and highly unlikely to be used in real life.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/cuse.c

index 45082269e698218d9c2daee40d6f325e9bcfe582..a37528b51798b749bf2e91323ccf2fb8874520b6 100644 (file)
@@ -627,6 +627,8 @@ static int __init cuse_init(void)
        cuse_channel_fops.owner         = THIS_MODULE;
        cuse_channel_fops.open          = cuse_channel_open;
        cuse_channel_fops.release       = cuse_channel_release;
+       /* CUSE is not prepared for FUSE_DEV_IOC_CLONE */
+       cuse_channel_fops.unlocked_ioctl        = NULL;
 
        cuse_class = class_create(THIS_MODULE, "cuse");
        if (IS_ERR(cuse_class))