From nobody Sun Feb 8 21:56:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1687856399; cv=none; d=zohomail.com; s=zohoarc; b=OQpH9LI5k1Sy4CHDTSzsA2tEo5n3iu+QWLKPWewt3bSAMoWM4Tu/T+2j9HmdopS4yGiSDoz55V1b1NDd/YuKGZLXDO+m5SPDc83qFkXTEq6YvaxeN2pady4oTbYFMKw6/uZC1Fkv4e2179Q5RHwNzjy5R7xP3IJ4aqsrKqnu8ww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687856399; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=+cOZZmkKNkRej2xzSu7egmKZVtoVsnOT/jn3qzeW/Cc=; b=UmxWG5F2RQ1/nevSQIyNMCMCuLDpWvSQT4seBtFOYSlk0wFQChDdKHrV8YDakKeBKzGWBXU5FgKSaEh1GwxMJ1XjBrnECkwZOifgyuEvwE/TfPdwQUe4CCcUWRgvx5/ZFKnSRMAI+4lGLwl2mHjk6GpIkSc1DTq2Hs59WsZbWKM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1687856399639196.13883489463058; Tue, 27 Jun 2023 01:59:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-l65sK8LcMEio4n8FQh9jAg-1; Tue, 27 Jun 2023 04:59:56 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AAF16282CCBF; Tue, 27 Jun 2023 08:59:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90DFB40D1A4; Tue, 27 Jun 2023 08:59:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 633961946587; Tue, 27 Jun 2023 08:59:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EAD581946587 for ; Tue, 27 Jun 2023 08:59:41 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 32CA940C206F; Tue, 27 Jun 2023 08:59:36 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B84F40C2063 for ; Tue, 27 Jun 2023 08:59:36 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 11DA1104458D for ; Tue, 27 Jun 2023 08:59:36 +0000 (UTC) Received: from relay.virtuozzo.com (relay.virtuozzo.com [130.117.225.111]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-522-4Q85jb9lN_2FULJWYtT-KQ-1; Tue, 27 Jun 2023 04:59:33 -0400 Received: from rnd-den01.nl-qa.sw.ru ([172.26.1.29] helo=rnd-den01.nl-qa.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1qE4Hw-00GoNv-3A; Tue, 27 Jun 2023 10:43:55 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687856398; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=+cOZZmkKNkRej2xzSu7egmKZVtoVsnOT/jn3qzeW/Cc=; b=VIR4tkQoDxukhAkJ7rzyvNkQadWHvK5OLBfQYfAgNkBX8S63RLR5kEQ99bDTwmdQu3+nG+ PfrWj7+C7r65BMc0R0yYz+LyE5+TtDQQnHG2cn47ipatuk6+YO3eC3mlBoObtksEW+2Tlk dudPJepsa2f8UxKaD5B0xiXSiqpLxcQ= X-MC-Unique: l65sK8LcMEio4n8FQh9jAg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 4Q85jb9lN_2FULJWYtT-KQ-1 From: Nikolai Barybin To: libvir-list@redhat.com Subject: [PATCH] qemu: prevent SIGSEGV in qemuProcessHandleDumpCompleted Date: Tue, 27 Jun 2023 11:43:58 +0300 Message-Id: <20230627084359.171276-1-nikolai.barybin@virtuozzo.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oleg Vasilev , Den Lunev , Nikolai Barybin Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: virtuozzo.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687856402031100001 Content-Type: text/plain; charset="utf-8"; x-default="true" If VIR_ASYNC_JOB_NONE flag is present, job.current is equal to NULL, which leads to SIGSEGV. Thus, this check should be moved up. Signed-off-by: Nikolai Barybin Reviewed-by: Jiri Denemark --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d3b1bdf6a4..db06991450 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1601,11 +1601,11 @@ qemuProcessHandleDumpCompleted(qemuMonitor *mon G_G= NUC_UNUSED, vm, vm->def->name, stats, NULLSTR(error)); =20 jobPriv =3D vm->job->privateData; - privJobCurrent =3D vm->job->current->privateData; if (vm->job->asyncJob =3D=3D VIR_ASYNC_JOB_NONE) { VIR_DEBUG("got DUMP_COMPLETED event without a dump_completed job"); goto cleanup; } + privJobCurrent =3D vm->job->current->privateData; jobPriv->dumpCompleted =3D true; privJobCurrent->stats.dump =3D *stats; vm->job->error =3D g_strdup(error); --=20 2.39.3