aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2021-04-14 10:40:58 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-19 10:12:56 +0200
commit2bfc47dec5b8b13b16dbab1a266ab9de387ca59b (patch)
tree89204cc5b41c79089fd295220825a98d90b77e17 /fs/fuse
parent2c20c7d96e45fd9642fe6d12486cda9ef80661df (diff)
downloadkernel_replicant_linux-2bfc47dec5b8b13b16dbab1a266ab9de387ca59b.tar.gz
kernel_replicant_linux-2bfc47dec5b8b13b16dbab1a266ab9de387ca59b.tar.bz2
kernel_replicant_linux-2bfc47dec5b8b13b16dbab1a266ab9de387ca59b.zip
cuse: prevent clone
[ Upstream commit 8217673d07256b22881127bf50dce874d0e51653 ] 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>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/cuse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
index 45082269e698..a37528b51798 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
@@ -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))