提交 c065ac85 编写于 作者: M Miklos Szeredi 提交者: Yang Yingliang

cuse: prevent clone

stable inclusion
from linux-4.19.191
commit 2bb2ff46d21d6794fd298df177199a2bb3b98434

--------------------------------

[ Upstream commit 8217673d ]

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: NMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 970d7f87
...@@ -621,6 +621,8 @@ static int __init cuse_init(void) ...@@ -621,6 +621,8 @@ static int __init cuse_init(void)
cuse_channel_fops.owner = THIS_MODULE; cuse_channel_fops.owner = THIS_MODULE;
cuse_channel_fops.open = cuse_channel_open; cuse_channel_fops.open = cuse_channel_open;
cuse_channel_fops.release = cuse_channel_release; 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"); cuse_class = class_create(THIS_MODULE, "cuse");
if (IS_ERR(cuse_class)) if (IS_ERR(cuse_class))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册