!314 remote_driver: fix the UAF causing "UnicodeDecodeError: 'utf-8' codec can't decode byte XXX".

From: @jjiacheng 
Reviewed-by: @mdsc 
Signed-off-by: @mdsc
This commit is contained in:
openeuler-ci-bot 2024-05-18 14:48:15 +00:00 committed by Gitee
commit 35c4e39997
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 32 additions and 1 deletions

View File

@ -262,7 +262,7 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 9.10.0
Release: 8
Release: 9
License: LGPLv2+
URL: https://libvirt.org/
@ -314,6 +314,7 @@ Patch0040: Fix-off-by-one-error-in-udevListInterfacesByStatus.patch
Patch0041: remote-check-for-negative-array-lengths-before-alloc.patch
Patch0042: hotpatch-if-hotpatch_path-not-in-qemu.conf-the-hotpa.patch
Patch0043: remote_driver-Restore-special-behavior-of-remoteDoma.patch
Patch0044: remote_driver-fix-the-UAF-causing-UnicodeDecodeError.patch
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release}
@ -2605,6 +2606,9 @@ exit 0
%endif
%changelog
* SAT May 18 2024 QingXiu <xiuqing1@huawei.com> 9.10.0-9
- spec: remote_driver: fix the UAF causing UnicodeDecodeError
* Mon May 06 2024 laokz <zhangkai@iscas.ac.cn> - 9.10.0-8
- spec: enable libvirt-daemon-kvm sub-package for riscv64

View File

@ -0,0 +1,27 @@
From 10ec4fa6e9f1e6c72f2d7a1025d1e200ce94f8b0 Mon Sep 17 00:00:00 2001
From: caozhongwang <caozhongwang1@huawei.com>
Date: Sat, 18 May 2024 17:05:07 +0800
Subject: [PATCH] remote_driver: fix the UAF causing "UnicodeDecodeError:
'utf-8' codec can't decode byte XXX".
Signed-off-by:xiuqing1 <xiuqing1@huawei.com>
---
src/remote/remote_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index a1a0edd7a2..9350e811d6 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1408,7 +1408,7 @@ remoteConnectGetType(virConnectPtr conn)
return NULL;
/* Stash. */
- return priv->type = ret.type;
+ return priv->type = g_steal_pointer(&ret.type);
}
static int remoteConnectIsSecure(virConnectPtr conn)
--
2.27.0