Skip to content

Commit 2bfc47d

Browse files
Miklos Szeredigregkh
authored andcommitted
cuse: prevent clone
[ Upstream commit 8217673 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2c20c7d commit 2bfc47d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/fuse/cuse.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,8 @@ static int __init cuse_init(void)
627627
cuse_channel_fops.owner = THIS_MODULE;
628628
cuse_channel_fops.open = cuse_channel_open;
629629
cuse_channel_fops.release = cuse_channel_release;
630+
/* CUSE is not prepared for FUSE_DEV_IOC_CLONE */
631+
cuse_channel_fops.unlocked_ioctl = NULL;
630632

631633
cuse_class = class_create(THIS_MODULE, "cuse");
632634
if (IS_ERR(cuse_class))

0 commit comments

Comments
 (0)