From nobody Sun May 5 10:45:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566907524; cv=none; d=zoho.com; s=zohoarc; b=GT3T+dT56ZQc/IcPUYm8J8SB2WY4/qJ/0g2AOmX/20YGH6U3D+kY2g/8W9M2J6kggc1IXGrfXwwwLnSPNMSB8ugLbHyReUeFPF86yMTBGZNGTip6HY34OjrI9Rulknrss98ie/HeSHRnqpaOFO5x6zk3ehXioFoh123sGVc+jm8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566907524; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5ChIN/WF4vzjjX3rQqiIsG3RDyvSnhYS0K/0OVOYByM=; b=O7epmJ0JhYkzLW6PsywDTfovCS6r+svxSKND1K1+uNP8K+iPU3TOXOk7hECOgPI+RO/tatiO1kriYp6qFHBH2oYDsGtTJ3mfEpQMc+0IY9CsG0cCdrz1HkulOmPgRZI6BQL1R9SgPP2OMQYkBNSSG6l4MhkZZKQJkjsAtgxOkd0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566907524103365.1705480663535; Tue, 27 Aug 2019 05:05:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CC6C300BEAE; Tue, 27 Aug 2019 12:05:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D662C5D9C3; Tue, 27 Aug 2019 12:05:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 836662551F; Tue, 27 Aug 2019 12:05:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7RC5KZC018152 for ; Tue, 27 Aug 2019 08:05:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7D47D10018F9; Tue, 27 Aug 2019 12:05:20 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03D521001944 for ; Tue, 27 Aug 2019 12:05:17 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 14:05:06 +0200 Message-Id: <31d3405bb4c8a87b30a1ef8944d4c2d87236a5da.1566907227.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] remote_daemon_dispatch: Check for limit properly in remoteDispatchConnectGetAllDomainStats X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 27 Aug 2019 12:05:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The return structure is a bit complicated and that's why it is very easy to check for RPC limits incorrectly. The structure is an array of remote_domain_stats_record structures with the limit of REMOTE_DOMAIN_LIST_MAX. The latter structure then poses a different limit on typed params: REMOTE_CONNECT_GET_ALL_DOMAIN_STATS_MAX (which is what we are checking for mistakenly). Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety Reviewed-by: Jonathon Jongsma --- src/remote/remote_daemon_dispatch.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index fb8b95f315..1a002957ef 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -6996,15 +6996,15 @@ remoteDispatchConnectGetAllDomainStats(virNetServer= Ptr server ATTRIBUTE_UNUSED, goto cleanup; } =20 - if (nrecords > REMOTE_CONNECT_GET_ALL_DOMAIN_STATS_MAX) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Number of domain stats records is %d, " - "which exceeds max limit: %d"), - nrecords, REMOTE_CONNECT_GET_ALL_DOMAIN_STATS_MAX); - goto cleanup; - } - if (nrecords) { + if (nrecords > REMOTE_DOMAIN_LIST_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Number of domain stats records is %d, " + "which exceeds max limit: %d"), + nrecords, REMOTE_DOMAIN_LIST_MAX); + goto cleanup; + } + if (VIR_ALLOC_N(ret->retStats.retStats_val, nrecords) < 0) goto cleanup; =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 10:45:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566907529; cv=none; d=zoho.com; s=zohoarc; b=KPSPWLECqhbzPmnoVQprSrga1j9OlW+qJKlPByVHM9mPrjeNoGso/FJQx0HrkDB9t/8tH2nifQ8jn1HfUxP/GLr+oivePsVOaEjdEZZSFsFWWB0tjTe/Qn6TKU+L46KZab7Am5vNgPKBnxkzMgqlo+c7M3rJdMf0pSaGkEdbvBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566907529; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4kuLWGmi9Rcb2kUz0/p/CTIp3wHM2pvmUslUO4PNmR4=; b=WJWvFi3yUmVaNMta9iXwjJrlx3iHymZXzZEsKTMpWE5U4yhD5XlndprSewD6ohWBvG9FgvsX12olnyfLMzap0EMHzYYkyxFkIJWF4aUmvXy4JWzRqWsaWKgep70sg57kBZfXpbm+CQEQQal4dqHy+arxqhc1hdIkb2mDNN9/hr0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566907529693504.3870528148742; Tue, 27 Aug 2019 05:05:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EACF53084242; Tue, 27 Aug 2019 12:05:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C43365D9C3; Tue, 27 Aug 2019 12:05:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 79580180221D; Tue, 27 Aug 2019 12:05:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7RC5Ous018164 for ; Tue, 27 Aug 2019 08:05:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 55C1510018F9; Tue, 27 Aug 2019 12:05:24 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA3EC1001B08 for ; Tue, 27 Aug 2019 12:05:20 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 14:05:07 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] remote: Check for limits when encoding typed params X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 27 Aug 2019 12:05:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The same way we check for limits when decoding typed parameters (virTypedParamsDeserialize()) we should do the same check when serializing them so that we don't put onto the wire more than our limits allow. Surprisingly, we were doing so explicitly in some places but not all of them. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety Reviewed-by: Jonathon Jongsma --- src/admin/admin_remote.c | 2 ++ src/admin/admin_server_dispatch.c | 27 ++------------- src/remote/remote_daemon_dispatch.c | 54 ++++++++++------------------- src/remote/remote_driver.c | 48 ++++--------------------- src/rpc/gendispatch.pl | 2 ++ src/util/virtypedparam.c | 13 ++++++- src/util/virtypedparam.h | 1 + 7 files changed, 45 insertions(+), 102 deletions(-) diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c index e112c1f115..0846e72f6d 100644 --- a/src/admin/admin_remote.c +++ b/src/admin/admin_remote.c @@ -294,6 +294,7 @@ remoteAdminServerSetThreadPoolParameters(virAdmServerPt= r srv, virObjectLock(priv); =20 if (virTypedParamsSerialize(params, nparams, + ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &args.param= s.params_val, &args.params.params_len, 0) < 0) @@ -405,6 +406,7 @@ remoteAdminServerSetClientLimits(virAdmServerPtr srv, virObjectLock(priv); =20 if (virTypedParamsSerialize(params, nparams, + ADMIN_SERVER_CLIENT_LIMITS_MAX, (virTypedParameterRemotePtr *) &args.param= s.params_val, &args.params.params_len, 0) < 0) diff --git a/src/admin/admin_server_dispatch.c b/src/admin/admin_server_dis= patch.c index 1973664488..3c4d72dedb 100644 --- a/src/admin/admin_server_dispatch.c +++ b/src/admin/admin_server_dispatch.c @@ -237,15 +237,8 @@ adminDispatchServerGetThreadpoolParameters(virNetServe= rPtr server ATTRIBUTE_UNUS args->flags) < 0) goto cleanup; =20 - if (nparams > ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Number of threadpool parameters %d exceeds max " - "allowed limit: %d"), nparams, - ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, 0) < 0) goto cleanup; @@ -336,15 +329,8 @@ adminDispatchClientGetInfo(virNetServerPtr server ATTR= IBUTE_UNUSED, if (adminClientGetInfo(clnt, ¶ms, &nparams, args->flags) < 0) goto cleanup; =20 - if (nparams > ADMIN_CLIENT_INFO_PARAMETERS_MAX) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Number of client info parameters %d exceeds max " - "allowed limit: %d"), nparams, - ADMIN_CLIENT_INFO_PARAMETERS_MAX); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + ADMIN_CLIENT_INFO_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) @@ -383,15 +369,8 @@ adminDispatchServerGetClientLimits(virNetServerPtr ser= ver ATTRIBUTE_UNUSED, if (adminServerGetClientLimits(srv, ¶ms, &nparams, args->flags) < = 0) goto cleanup; =20 - if (nparams > ADMIN_SERVER_CLIENT_LIMITS_MAX) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Number of client processing parameters %d exceed= s " - "max allowed limit: %d"), nparams, - ADMIN_SERVER_CLIENT_LIMITS_MAX); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + ADMIN_SERVER_CLIENT_LIMITS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, 0) < 0) goto cleanup; diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index 1a002957ef..e205c743c3 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -1152,6 +1152,7 @@ remoteRelayDomainEventTunable(virConnectPtr conn, goto error; =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_EVENT_TUNABLE_MAX, (virTypedParameterRemotePtr *) &data.param= s.params_val, &data.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { @@ -1318,6 +1319,7 @@ remoteRelayDomainEventJobCompleted(virConnectPtr conn, goto error; =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_JOB_STATS_MAX, (virTypedParameterRemotePtr *) &data.param= s.params_val, &data.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { @@ -2450,6 +2452,7 @@ remoteDispatchDomainGetSchedulerParameters(virNetServ= erPtr server ATTRIBUTE_UNUS goto cleanup; =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, 0) < 0) @@ -2498,6 +2501,7 @@ remoteDispatchDomainGetSchedulerParametersFlags(virNe= tServerPtr server ATTRIBUTE goto cleanup; =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -2663,6 +2667,7 @@ remoteDispatchDomainBlockStatsFlags(virNetServerPtr s= erver ATTRIBUTE_UNUSED, =20 /* Serialize the block stats. */ if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_BLOCK_STATS_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -3292,6 +3297,7 @@ remoteDispatchDomainGetMemoryParameters(virNetServerP= tr server ATTRIBUTE_UNUSED, } =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -3351,6 +3357,7 @@ remoteDispatchDomainGetNumaParameters(virNetServerPtr= server ATTRIBUTE_UNUSED, } =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_NUMA_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, flags) < 0) @@ -3410,6 +3417,7 @@ remoteDispatchDomainGetBlkioParameters(virNetServerPt= r server ATTRIBUTE_UNUSED, } =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -3587,12 +3595,8 @@ remoteDispatchDomainGetLaunchSecurityInfo(virNetServ= erPtr server ATTRIBUTE_UNUSE if (virDomainGetLaunchSecurityInfo(dom, ¶ms, &nparams, args->flags= ) < 0) goto cleanup; =20 - if (nparams > REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_MAX) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large"= )); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_= MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -3631,12 +3635,8 @@ remoteDispatchDomainGetPerfEvents(virNetServerPtr se= rver ATTRIBUTE_UNUSED, if (virDomainGetPerfEvents(dom, ¶ms, &nparams, args->flags) < 0) goto cleanup; =20 - if (nparams > REMOTE_DOMAIN_PERF_EVENTS_MAX) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large"= )); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_PERF_EVENTS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, 0) < 0) @@ -3732,6 +3732,7 @@ remoteDispatchDomainGetBlockIoTune(virNetServerPtr se= rver ATTRIBUTE_UNUSED, =20 /* Serialize the block I/O tuning parameters. */ if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_BLOCK_IO_TUNE_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -5289,6 +5290,7 @@ remoteDispatchDomainGetInterfaceParameters(virNetServ= erPtr server ATTRIBUTE_UNUS } =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_INTERFACE_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, flags) < 0) @@ -5348,6 +5350,7 @@ remoteDispatchDomainGetCPUStats(virNetServerPtr serve= r ATTRIBUTE_UNUSED, goto success; =20 if (virTypedParamsSerialize(params, args->nparams * args->ncpus, + REMOTE_DOMAIN_GET_CPU_STATS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -5450,13 +5453,8 @@ remoteDispatchNodeGetSevInfo(virNetServerPtr server = ATTRIBUTE_UNUSED, if (virNodeGetSEVInfo(conn, ¶ms, &nparams, args->flags) < 0) goto cleanup; =20 - if (nparams > REMOTE_NODE_SEV_INFO_MAX) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large"= )); - goto cleanup; - } - - if (virTypedParamsSerialize(params, nparams, + REMOTE_NODE_SEV_INFO_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -5511,6 +5509,7 @@ remoteDispatchNodeGetMemoryParameters(virNetServerPtr= server ATTRIBUTE_UNUSED, } =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_NODE_MEMORY_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -5641,14 +5640,8 @@ remoteDispatchDomainGetJobStats(virNetServerPtr serv= er ATTRIBUTE_UNUSED, &nparams, args->flags) < 0) goto cleanup; =20 - if (nparams > REMOTE_DOMAIN_JOB_STATS_MAX) { - virReportError(VIR_ERR_RPC, - _("Too many job stats '%d' for limit '%d'"), - nparams, REMOTE_DOMAIN_JOB_STATS_MAX); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_JOB_STATS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, 0) < 0) @@ -7018,6 +7011,7 @@ remoteDispatchConnectGetAllDomainStats(virNetServerPt= r server ATTRIBUTE_UNUSED, =20 if (virTypedParamsSerialize(retStats[i]->params, retStats[i]->nparams, + REMOTE_CONNECT_GET_ALL_DOMAIN_STAT= S_MAX, (virTypedParameterRemotePtr *) &ds= t->params.params_val, &dst->params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) @@ -7370,12 +7364,8 @@ remoteDispatchNetworkPortGetParameters(virNetServerP= tr server ATTRIBUTE_UNUSED, if (virNetworkPortGetParameters(port, ¶ms, &nparams, args->flags) = < 0) goto cleanup; =20 - if (nparams > REMOTE_NETWORK_PORT_PARAMETERS_MAX) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large"= )); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + REMOTE_NETWORK_PORT_PARAMETERS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, args->flags) < 0) @@ -7674,14 +7664,8 @@ remoteDispatchDomainGetGuestInfo(virNetServerPtr ser= ver ATTRIBUTE_UNUSED, if (virDomainGetGuestInfo(dom, args->types, ¶ms, &nparams, args->f= lags) < 0) goto cleanup; =20 - if (nparams > REMOTE_DOMAIN_GUEST_INFO_PARAMS_MAX) { - virReportError(VIR_ERR_RPC, - _("Too many params in guestinfo: %d for limit %d"), - nparams, REMOTE_DOMAIN_GUEST_INFO_PARAMS_MAX); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_GUEST_INFO_PARAMS_MAX, (virTypedParameterRemotePtr *) &ret->param= s.params_val, &ret->params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 8cc7ab3663..2b86f55035 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -7109,14 +7109,8 @@ remoteDomainMigrateBegin3Params(virDomainPtr domain, make_nonnull_domain(&args.dom, domain); args.flags =3D flags; =20 - if (nparams > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { - virReportError(VIR_ERR_RPC, - _("Too many migration parameters '%d' for limit '%d= '"), - nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, (virTypedParameterRemotePtr *) &args.param= s.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { @@ -7177,14 +7171,8 @@ remoteDomainMigratePrepare3Params(virConnectPtr dcon= n, memset(&args, 0, sizeof(args)); memset(&ret, 0, sizeof(ret)); =20 - if (nparams > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { - virReportError(VIR_ERR_RPC, - _("Too many migration parameters '%d' for limit '%d= '"), - nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); - goto cleanup; - } - if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, (virTypedParameterRemotePtr *) &args.param= s.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { @@ -7261,18 +7249,12 @@ remoteDomainMigratePrepareTunnel3Params(virConnectP= tr dconn, memset(&args, 0, sizeof(args)); memset(&ret, 0, sizeof(ret)); =20 - if (nparams > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { - virReportError(VIR_ERR_RPC, - _("Too many migration parameters '%d' for limit '%d= '"), - nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); - goto cleanup; - } - args.cookie_in.cookie_in_val =3D (char *)cookiein; args.cookie_in.cookie_in_len =3D cookieinlen; args.flags =3D flags; =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, (virTypedParameterRemotePtr *) &args.param= s.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { @@ -7351,13 +7333,6 @@ remoteDomainMigratePerform3Params(virDomainPtr dom, memset(&args, 0, sizeof(args)); memset(&ret, 0, sizeof(ret)); =20 - if (nparams > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { - virReportError(VIR_ERR_RPC, - _("Too many migration parameters '%d' for limit '%d= '"), - nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); - goto cleanup; - } - make_nonnull_domain(&args.dom, dom); args.dconnuri =3D dconnuri =3D=3D NULL ? NULL : (char **) &dconnuri; args.cookie_in.cookie_in_val =3D (char *)cookiein; @@ -7365,6 +7340,7 @@ remoteDomainMigratePerform3Params(virDomainPtr dom, args.flags =3D flags; =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, (virTypedParameterRemotePtr *) &args.param= s.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { @@ -7425,19 +7401,13 @@ remoteDomainMigrateFinish3Params(virConnectPtr dcon= n, memset(&args, 0, sizeof(args)); memset(&ret, 0, sizeof(ret)); =20 - if (nparams > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { - virReportError(VIR_ERR_RPC, - _("Too many migration parameters '%d' for limit '%d= '"), - nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); - goto cleanup; - } - args.cookie_in.cookie_in_val =3D (char *)cookiein; args.cookie_in.cookie_in_len =3D cookieinlen; args.flags =3D flags; args.cancelled =3D cancelled; =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, (virTypedParameterRemotePtr *) &args.param= s.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { @@ -7499,13 +7469,6 @@ remoteDomainMigrateConfirm3Params(virDomainPtr domai= n, =20 memset(&args, 0, sizeof(args)); =20 - if (nparams > REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX) { - virReportError(VIR_ERR_RPC, - _("Too many migration parameters '%d' for limit '%d= '"), - nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX); - goto cleanup; - } - make_nonnull_domain(&args.dom, domain); args.cookie_in.cookie_in_len =3D cookieinlen; args.cookie_in.cookie_in_val =3D (char *) cookiein; @@ -7513,6 +7476,7 @@ remoteDomainMigrateConfirm3Params(virDomainPtr domain, args.cancelled =3D cancelled; =20 if (virTypedParamsSerialize(params, nparams, + REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, (virTypedParameterRemotePtr *) &args.param= s.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index ff21834091..9d3cc5b145 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -951,6 +951,7 @@ elsif ($mode eq "server") { splice(@args_list, int($5), 0, "&$1_len"); =20 push(@ret_list, "if (virTypedParamsSerialize($1, $1_le= n,\n" . + " $2,\n= " . " (virT= ypedParameterRemotePtr *) &ret->$1.$1_val,\n" . " &ret-= >$1.$1_len,\n" . " VIR_T= YPED_PARAM_STRING_OKAY) < 0)\n" . @@ -1436,6 +1437,7 @@ elsif ($mode eq "client") { push(@args_list, "virTypedParameterPtr $1"); push(@args_list, "int n$1"); push(@setters_list2, "if (virTypedParamsSerialize($1, = n$1,\n" . + " = $2,\n" . " = (virTypedParameterRemotePtr *) &args.$1.$1_val,\n" . " = &args.$1.$1_len,\n" . " = VIR_TYPED_PARAM_STRING_OKAY) < 0) {\n" . diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index 8f23348d97..779714d146 100644 --- a/src/util/virtypedparam.c +++ b/src/util/virtypedparam.c @@ -1480,12 +1480,15 @@ virTypedParamsDeserialize(virTypedParameterRemotePt= r remote_params, * virTypedParamsSerialize: * @params: array of parameters to be serialized and later sent to remote = side * @nparams: number of elements in @params + * @limit: user specified maximum limit to @remote_params_len * @remote_params_val: protocol independent remote representation of @para= ms * @remote_params_len: the final number of elements in @remote_params_val * @flags: bitwise-OR of virTypedParameterFlags * * This method serializes typed parameters provided by @params into * @remote_params_val which is the representation actually being sent. + * It also checks, if the @limit imposed by RPC on the maximum number of + * parameters is not exceeded. * * Server side using this method also filters out any string parameters th= at * must not be returned to older clients and handles possibly sparse arrays @@ -1496,6 +1499,7 @@ virTypedParamsDeserialize(virTypedParameterRemotePtr = remote_params, int virTypedParamsSerialize(virTypedParameterPtr params, int nparams, + int limit, virTypedParameterRemotePtr *remote_params_val, unsigned int *remote_params_len, unsigned int flags) @@ -1503,9 +1507,16 @@ virTypedParamsSerialize(virTypedParameterPtr params, size_t i; size_t j; int rv =3D -1; - virTypedParameterRemotePtr params_val; + virTypedParameterRemotePtr params_val =3D NULL; int params_len =3D nparams; =20 + if (nparams > limit) { + virReportError(VIR_ERR_RPC, + _("too many parameters '%d' for limit '%d'"), + nparams, limit); + goto cleanup; + } + if (VIR_ALLOC_N(params_val, nparams) < 0) goto cleanup; =20 diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h index ce4e75b389..f9d22b24fb 100644 --- a/src/util/virtypedparam.h +++ b/src/util/virtypedparam.h @@ -113,6 +113,7 @@ int virTypedParamsDeserialize(virTypedParameterRemotePt= r remote_params, =20 int virTypedParamsSerialize(virTypedParameterPtr params, int nparams, + int limit, virTypedParameterRemotePtr *remote_params_val, unsigned int *remote_params_len, unsigned int flags); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 10:45:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566907531; cv=none; d=zoho.com; s=zohoarc; b=A2+tNr4YSNVLqWxp/kYAUmf6w84XRAMU2Fo8QZPXx79eOKQGRznnlvBbKrHdPjy2VJ7tYtew2ZF1eCFeFmpdLHYR+5IfooIrGw75gZZRQYbaE7AVIqxe5Zc6RQpg0N9vWd0eq+qM7HucRA40eaJ4AMKrbRM1z+X9ya8mkZNxN9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566907531; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2H2zRaE/hlxZiaD95zuJEuoHTqDJZdedepwwHlwLMms=; b=cBJ6wzRLMGgnNrumdqozme6QvmbL3lwatDbS5j9cAxkTq4gYCXGGSLKQfBrw2f1TSiS78LTeI855FrqAbkUFobecdw3tMkgHrv0KopH58ltcTAzbglLgkRYnC8Yy+V293Ag8Ku58VId8mCa0pcRkZprMyWJqYl8KsKIKiKLEjfI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566907531734708.5221800397038; Tue, 27 Aug 2019 05:05:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C3F78980ED; Tue, 27 Aug 2019 12:05:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 430E25D9C3; Tue, 27 Aug 2019 12:05:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 01C51180221E; Tue, 27 Aug 2019 12:05:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7RC5R6o018175 for ; Tue, 27 Aug 2019 08:05:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id EEAB61001944; Tue, 27 Aug 2019 12:05:27 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7823410018F9 for ; Tue, 27 Aug 2019 12:05:24 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 14:05:08 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] remote_daemon_dispatch: Don't leak @ret on failure X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Tue, 27 Aug 2019 12:05:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" If there's a problem in encoding @ret (for instance virTypedParamsSerialize() fails) then @ret is leaked. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/remote/remote_daemon_dispatch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index e205c743c3..c658a6e115 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -7025,8 +7025,11 @@ remoteDispatchConnectGetAllDomainStats(virNetServerP= tr server ATTRIBUTE_UNUSED, rv =3D 0; =20 cleanup: - if (rv < 0) + if (rv < 0) { virNetMessageSaveError(rerr); + xdr_free((xdrproc_t)xdr_remote_connect_get_all_domain_stats_ret, + (char *) ret); + } =20 virDomainStatsRecordListFree(retStats); virObjectListFree(doms); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 10:45:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566907533; cv=none; d=zoho.com; s=zohoarc; b=F/ZySeHfy076D+tz26g/1cAoC7jf8Uo+Ea2RHxVTIZk6TmAHKBVnkpJQVymKyvNDNmREVyhQEsZX7FjvJt9HOuKcBT13zdrHnQMNTjZ+c7Rxv+p5FAQGzM9lG8HMQgy45F+8OFPOZCjlozKG4xFyFI1b/LYfk7j4n24qIzqVqFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566907533; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rbfG5ZeFahN0NiUq5nR/6xteOXLwx1oTk8Hr6IlYuxE=; b=BaFjm3e6c8GqwMeQQTM1N4hju39vD+NVR+6rYRHKUqHtLGnGtNxfCOMWFPN987aHlJp6SLUO9aK9vJYq/2FJ/aQ2zbxuYX7eBwbgOBfAM10aGna5qY0MbfwLRKnZ6RSEuAe4na4ZmCPAsnfYqsGbB4FEtgxWcLLlXhOd/W0DLbI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566907533619683.1837817772408; Tue, 27 Aug 2019 05:05:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECE6910C6964; Tue, 27 Aug 2019 12:05:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9AC560BF7; Tue, 27 Aug 2019 12:05:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3F8FD1802220; Tue, 27 Aug 2019 12:05:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7RC5Tmj018180 for ; Tue, 27 Aug 2019 08:05:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1BA3610190B4; Tue, 27 Aug 2019 12:05:29 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 865A61001B08 for ; Tue, 27 Aug 2019 12:05:28 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 14:05:09 +0200 Message-Id: <62162cdb1d02f211ac9f19cce90af981c8f4fb50.1566907227.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] remote_daemon_dispatch: Don't open code xdr_free() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Tue, 27 Aug 2019 12:05:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" At two places we are open coding xdr_free(): remoteRelayDomainEventTunable() and remoteRelayDomainEventJobCompleted(). Bot of these functions use make_nonnull_domain() to put domain IDs tuple into return structure and then continue encoding the rest of structure. If that fails, they call VIR_FREE() directly. While this okay, we should use xdr_free() which frees the whole return structure for us. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/remote/remote_daemon_dispatch.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index c658a6e115..ecde959088 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -1156,8 +1156,7 @@ remoteRelayDomainEventTunable(virConnectPtr conn, (virTypedParameterRemotePtr *) &data.param= s.params_val, &data.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { - VIR_FREE(data.dom.name); - return -1; + goto error; } =20 remoteDispatchObjectEventSend(callback->client, remoteProgram, @@ -1323,8 +1322,7 @@ remoteRelayDomainEventJobCompleted(virConnectPtr conn, (virTypedParameterRemotePtr *) &data.param= s.params_val, &data.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { - VIR_FREE(data.dom.name); - return -1; + goto error; } =20 remoteDispatchObjectEventSend(callback->client, remoteProgram, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list