From nobody Fri Nov 14 06:38:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585233065; cv=none; d=zohomail.com; s=zohoarc; b=elr6e6n6rN1SU2tCwaMOIIlYas3N0tauA4bD2f/Ya/+ztEaNbQBoufZZWhWVqERJdfyfkrFD3LvWb85go24oZM3zTmKfNF6KcAgGPpNny6OEt5gNuDJslF38zZ+1YJiaD6wUzMAJDfhFjyD4l9z+qSh/Z05I1cy0qSOtM4mwyQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585233065; h=Content-Type:Content-Transfer-Encoding:Cc: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; bh=CPS7tT0aRgNDMOmquEAYiHn+rSIgheBGQQd4trHvHfg=; b=Wo9KWHw2bP6MRWJhtlE3SDpDo7GIMJ2GeNmup/0OpHdpULQUs8i0q5qO2mBCCUf3YSs24RhJbSGfd6BHCai3PufvlFCbtDzx3Ab017XH7UjdcWTP95NTjPLQIZUkWNVT1ZXHlqHByfpKEp70N+Y4xXCIAHc7OBSxPFdQkGneotA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585233065266415.76517962466414; Thu, 26 Mar 2020 07:31:05 -0700 (PDT) Received: from localhost ([::1]:53818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHTXD-00054l-6X for importer@patchew.org; Thu, 26 Mar 2020 10:31:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41227) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHTVy-0003KW-9e for qemu-devel@nongnu.org; Thu, 26 Mar 2020 10:29:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHTVw-0002kz-Lc for qemu-devel@nongnu.org; Thu, 26 Mar 2020 10:29:45 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:53898) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jHTVw-0002kM-6B for qemu-devel@nongnu.org; Thu, 26 Mar 2020 10:29:44 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-461-QiLkYxYIP1eQ_ydRGGFVQw-1; Thu, 26 Mar 2020 10:29:41 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6C3C8018CB; Thu, 26 Mar 2020 14:29:39 +0000 (UTC) Received: from localhost (ovpn-112-132.ams2.redhat.com [10.36.112.132]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 43D5919C70; Thu, 26 Mar 2020 14:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585232983; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=CPS7tT0aRgNDMOmquEAYiHn+rSIgheBGQQd4trHvHfg=; b=VwA+3wOu5kFBh4RMSgM2XyQH9zhJ0YTF1sDoWNZ4dFdWl2MgJ99a9W9zhzZ55MVQDX3axp l0jOimL5sQ0Phv62n6Pd5zkHQyqN1K+MdihhRS7O/qZoRtCToJxqDVcCKJDVDc3irKWMXY vlibzatyC4DIk1HXtkkQzEbKEPekGCE= X-MC-Unique: QiLkYxYIP1eQ_ydRGGFVQw-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 01/10] block/mirror: fix use after free of local_err Date: Thu, 26 Mar 2020 15:29:24 +0100 Message-Id: <20200326142933.625037-2-mreitz@redhat.com> In-Reply-To: <20200326142933.625037-1-mreitz@redhat.com> References: <20200326142933.625037-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 216.205.24.74 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy local_err is used again in mirror_exit_common() after bdrv_set_backing_hd(), so we must zero it. Otherwise try to set non-NULL local_err will crash. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200324153630.11882-3-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake Reviewed-by: John Snow Signed-off-by: Max Reitz --- block/mirror.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/mirror.c b/block/mirror.c index 447051dbc6..6203e5946e 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -678,6 +678,7 @@ static int mirror_exit_common(Job *job) bdrv_set_backing_hd(target_bs, backing, &local_err); if (local_err) { error_report_err(local_err); + local_err =3D NULL; ret =3D -EPERM; } } --=20 2.25.1