[PATCH OLK-6.6 0/2] CVE-2026-23096
CVE-2026-23096 Wang Tao (1): Revert "uacce: fix for cdev memory leak" Wenkai Lin (1): uacce: fix cdev handling in the cleanup path drivers/misc/uacce/uacce.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.34.1
hulk inclusion category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/13629 CVE: CVE-2026-23096 -------------------------------- This reverts commit 3cf71ab1a46d0f9801b298231018a1667c935982. Revert driver patch and use upstream commit d9031575a2f8 ("uacce: fix cdev handling in the cleanup path"). Fixes: 3cf71ab1a46d ("uacce: fix for cdev memory leak") Signed-off-by: Wang Tao <wangtao554@huawei.com> --- drivers/misc/uacce/uacce.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index 02f402ee0a49..a21dc275c701 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -966,8 +966,6 @@ EXPORT_SYMBOL_GPL(uacce_alloc); */ int uacce_register(struct uacce_device *uacce) { - int ret; - if (!uacce) return -ENODEV; @@ -978,14 +976,7 @@ int uacce_register(struct uacce_device *uacce) uacce->cdev->ops = &uacce_fops; uacce->cdev->owner = THIS_MODULE; - ret = cdev_device_add(uacce->cdev, &uacce->dev); - if (ret) { - cdev_del(uacce->cdev); - uacce->cdev = NULL; - return ret; - } - - return 0; + return cdev_device_add(uacce->cdev, &uacce->dev); } EXPORT_SYMBOL_GPL(uacce_register); -- 2.34.1
From: Wenkai Lin <linwenkai6@hisilicon.com> stable inclusion from stable-v6.6.122 commit d9031575a2f8aabc53af3025dd79af313a2e046b category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/13629 CVE: CVE-2026-23096 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=... -------------------------------- commit a3bece3678f6c88db1f44c602b2a63e84b4040ac upstream. When cdev_device_add fails, it internally releases the cdev memory, and if cdev_device_del is then executed, it will cause a hang error. To fix it, we check the return value of cdev_device_add() and clear uacce->cdev to avoid calling cdev_device_del in the uacce_remove. Fixes: 015d239ac014 ("uacce: add uacce driver") Cc: stable@vger.kernel.org Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org> Link: https://patch.msgid.link/20251202061256.4158641-2-huangchenghai2@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Wang Tao <wangtao554@huawei.com> --- drivers/misc/uacce/uacce.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index a21dc275c701..367c048f0cb6 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -966,6 +966,8 @@ EXPORT_SYMBOL_GPL(uacce_alloc); */ int uacce_register(struct uacce_device *uacce) { + int ret; + if (!uacce) return -ENODEV; @@ -976,7 +978,11 @@ int uacce_register(struct uacce_device *uacce) uacce->cdev->ops = &uacce_fops; uacce->cdev->owner = THIS_MODULE; - return cdev_device_add(uacce->cdev, &uacce->dev); + ret = cdev_device_add(uacce->cdev, &uacce->dev); + if (ret) + uacce->cdev = NULL; + + return ret; } EXPORT_SYMBOL_GPL(uacce_register); -- 2.34.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/20871 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/K4H... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://atomgit.com/openeuler/kernel/merge_requests/20871 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/K4H...
participants (2)
-
patchwork bot -
Wang Tao