From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206565; cv=none; d=zohomail.com; s=zohoarc; b=myBB9a/VrM0UezA47p5tROo0/6Q/68HSLBdFe5piRYkg9Vq1sLLbxfJOPcT+fkLC7FokKIcMWW8FOzA1CEwfRtRLZfmGm/liPxRzM3LwvZS3m9ZisPdRfebBNmvLhVU53ubbkD9k9qWFj8BZwGjv5GPRtYwRxI5xpBnmCfaOdCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206565; 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=rYUBVY78yAnySDLrisD3drGGMY9XwdwkOa964kiWAtY=; b=fFIr2gLmyTbiMiAovjzIOmbzVv/Vncty5sZatrYBMldyJDv9XMD98+nIx3JYiwRURMgy0XsPrDNnQdGRJofWJ/2dxmE3RA+QXj7adFThzCX8RYAabt7OFYqMJaLdoAQVuVb7TXSvLNNrvgnJ5tRhNgdOVCXxyR0ge6TZ9h31PTM= 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 1605206565014193.5876569747477; Thu, 12 Nov 2020 10:42:45 -0800 (PST) Received: from localhost ([::1]:51136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHYR-0006sM-O9 for importer@patchew.org; Thu, 12 Nov 2020 13:42:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHU7-0002Gg-HV for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHU5-0006N0-Qc for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:15 -0500 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-342-3k_j50CaOjuOUZ2iV93aDQ-1; Thu, 12 Nov 2020 13:38:11 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 29EC98049D4; Thu, 12 Nov 2020 18:38:10 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2868E5D9E4; Thu, 12 Nov 2020 18:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206293; 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=rYUBVY78yAnySDLrisD3drGGMY9XwdwkOa964kiWAtY=; b=YHqncOvrrVLmc31G0QzMqqME9gCiUKEBRmIKVJPBcPZuWqR5vPpK8JIWOokBGaoOWM6W+B gtOFZhP2VjyrT+YptLMpOviaeemiy8gM0ByjkscZQc1mXikWbGh+5fkRtgOVWWOTZIUmYW SPIJb2GU9zs8ipNhcBALVsuCb9+ZUc0= X-MC-Unique: 3k_j50CaOjuOUZ2iV93aDQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 01/11] migration/ram: Fix hexadecimal format string specifier Date: Thu, 12 Nov 2020 18:37:48 +0000 Message-Id: <20201112183758.203176-2-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 00:52:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 The '%u' conversion specifier is for decimal notation. When prefixing a format with '0x', we want the hexadecimal specifier ('%x'). Inspired-by: Dov Murik Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert Message-Id: <20201103112558.2554390-5-philmd@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index add5396a62..7811cde643 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3741,7 +3741,7 @@ int ram_dirty_bitmap_reload(MigrationState *s, RAMBlo= ck *block) } =20 if (end_mark !=3D RAMBLOCK_RECV_BITMAP_ENDING) { - error_report("%s: ramblock '%s' end mark incorrect: 0x%"PRIu64, + error_report("%s: ramblock '%s' end mark incorrect: 0x%"PRIx64, __func__, block->idstr, end_mark); ret =3D -EINVAL; goto out; --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206428; cv=none; d=zohomail.com; s=zohoarc; b=Snw3r5OC+3R82Ga/5vhBsgZPmKde5QBXNVrcGv59NVmoeQcbQYi6WvC7HeYiuzp5aqZ+5PKip1ux2I+plKfR+kqxFce3NpxHAmIgxjKwCrXgUHbJ83PTrmqspZMC6krWPgk9zhAjqmi/Rn4b4Dr8Whobl1PrkeJMd9VLQFuoBOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206428; 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=UtM8AmbGW7trohI4UkXVaady5PCxEYTFhU1MA6rkjNA=; b=gjCRO107Nv7jp+poATFZK1ryQfdJ2vQIwWyL7rFlc+kFHzCoFB3ijmN+2pVAuh8ED/xsptomy7LmjTgOPAZSIt852TGn9nDUVEdRsGfU2cBHJm6kLj55Wss0RTeguibDXZJbpar7FrZOWM+GWCvEdpz1b5blliM+ATp8r0CS33s= 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 1605206428904333.7047158171498; Thu, 12 Nov 2020 10:40:28 -0800 (PST) Received: from localhost ([::1]:45316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHWD-0004Fh-QG for importer@patchew.org; Thu, 12 Nov 2020 13:40:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUD-0002Pf-4y for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUB-0006PV-D7 for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:20 -0500 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-308-0xuL2W8APBCsEN_XfL0BxA-1; Thu, 12 Nov 2020 13:38:16 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 751B3801817; Thu, 12 Nov 2020 18:38:15 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 758235D9E4; Thu, 12 Nov 2020 18:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206298; 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=UtM8AmbGW7trohI4UkXVaady5PCxEYTFhU1MA6rkjNA=; b=JbOpJ4Md9xty3GWrt+hVy7+Fu2OcczJiOZc594sxk/EldBr6Qcl9k3zjHvNWZFrjVz87lF k6DoBEFkilOkGWkkWwYrpPl8Tcan4aJ1adEftStpih6Fq7LqEC8RaH4Q/I4qJZ7+fbc1iU d+sPIO/6EqXPbCFO7YVMxfTkIdKlbOI= X-MC-Unique: 0xuL2W8APBCsEN_XfL0BxA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 02/11] ACPI: Avoid infinite recursion when dump-vmstate Date: Thu, 12 Nov 2020 18:37:49 +0000 Message-Id: <20201112183758.203176-3-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 00:52:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Peng Liang There is a field with vmstate_ghes_state as vmsd in vmstate_ghes_state, which will lead to infinite recursion in dump_vmstate_vmsd. Fixes: a08a64627b ("ACPI: Record the Generic Error Status Block address") Reported-by: Euler Robot Signed-off-by: Peng Liang Acked-by: Igor Mammedov Message-Id: <20201112020638.874515-1-liangpeng10@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Dr. David Alan Gilbert --- hw/acpi/generic_event_device.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 6df400e1ee..5454be67d5 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -322,6 +322,16 @@ static const VMStateDescription vmstate_ged_state =3D { } }; =20 +static const VMStateDescription vmstate_ghes =3D { + .name =3D "acpi-ghes", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_UINT64(ghes_addr_le, AcpiGhesState), + VMSTATE_END_OF_LIST() + }, +}; + static bool ghes_needed(void *opaque) { AcpiGedState *s =3D opaque; @@ -335,7 +345,7 @@ static const VMStateDescription vmstate_ghes_state =3D { .needed =3D ghes_needed, .fields =3D (VMStateField[]) { VMSTATE_STRUCT(ghes_state, AcpiGedState, 1, - vmstate_ghes_state, AcpiGhesState), + vmstate_ghes, AcpiGhesState), VMSTATE_END_OF_LIST() } }; --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206574; cv=none; d=zohomail.com; s=zohoarc; b=mt4MSpCeWyr/p9dxetLlkjjiwfPmtvUBPnYWkrWdn0jYr3TRu3OY+TuiVrnt0zGxH7IJraXKIf49dYrBYIMcO0H5XF0k3dBLjX3vNXwTsWZLON1YbYvwgUCNmoRybr7kscdC0VROu7iaCptEXhIzOEUAzc+wyI1Rhn/UcUT8dt0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206574; 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=J5Uru7LyvR0I1vk/rEPADBpvjbXgquFwOt7WjLL5UMg=; b=NFIL4UQ/CzcRuu3Ejz6bSR+3Iaxs1TJlcDZY3HLNEgVRUjC967LQ/186oPdZrzcCINGKXdMOgN0X38KT+scQpB4zmvPCWHalnazWMPMymPQXgfvmzso62pP0uXp/eHndJswdwgIZa/WOjl6LNcoN/VpthmY1fUYSZxg8E7OapmE= 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 160520657444919.568252764842327; Thu, 12 Nov 2020 10:42:54 -0800 (PST) Received: from localhost ([::1]:51746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHYb-00079q-DF for importer@patchew.org; Thu, 12 Nov 2020 13:42:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUI-0002ad-4c for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30541) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUG-0006S6-BO for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:25 -0500 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-180-nbJSEPFZPJqJJHV-UZkS8w-1; Thu, 12 Nov 2020 13:38:21 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6DC1618B9EC1; Thu, 12 Nov 2020 18:38:20 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0CC85D9E4; Thu, 12 Nov 2020 18:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206303; 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=J5Uru7LyvR0I1vk/rEPADBpvjbXgquFwOt7WjLL5UMg=; b=OLWHPQtb/R+RPIgX6wTTrr4o2Zadh9Cc+br9Wr0q5lGw+Wvk2NAqXwBMJBQggugkv/p9sB Cr8PKmjCPpgUgls+WTWp5xsGsDd1Yn+de/2txBAvWioUR1tWJLRASUxvanA6sV1RQHUd5x XM03WrrqRWARVqOmXJO5UJ477asX0x8= X-MC-Unique: nbJSEPFZPJqJJHV-UZkS8w-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 03/11] migration/multifd: fix hangup with TLS-Multifd due to blocking handshake Date: Thu, 12 Nov 2020 18:37:50 +0000 Message-Id: <20201112183758.203176-4-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 00:52:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Chuan Zheng The qemu main loop could hang up forever when we enable TLS+Multifd. The Src multifd_send_0 invokes tls handshake, it sends hello to sever and wait response. However, the Dst main qemu loop has been waiting recvmsg() for multifd_recv= _1. Both of Src and Dst main qemu loop are blocking and waiting for reponse whi= ch results in hanging up forever. Src: (multifd_send_0) Dst: (mu= ltifd_recv_1) multifd_channel_connect migratio= n_channel_process_incoming multifd_tls_channel_connect migrat= ion_tls_channel_process_incoming multifd_tls_channel_connect qio_= channel_tls_handshake_task qio_channel_tls_handshake gn= utls_handshake qio_channel_tls_handshake_task = ... qcrypto_tls_session_handshake = ... gnutls_handshake = ... ... = ... recvmsg (Blocking I/O waiting for response) = recvmsg (Blocking I/O waiting for response) Fix this by offloadinig handshake work to a background thread. Reported-by: Yan Jin Suggested-by: Daniel P. Berrang=C3=A9 Signed-off-by: Chuan Zheng Message-Id: <1604643893-8223-1-git-send-email-zhengchuan@huawei.com> Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- migration/multifd.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 68b171fb61..88486b90d6 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -739,6 +739,19 @@ static void multifd_tls_outgoing_handshake(QIOTask *ta= sk, multifd_channel_connect(p, ioc, err); } =20 +static void *multifd_tls_handshake_thread(void *opaque) +{ + MultiFDSendParams *p =3D opaque; + QIOChannelTLS *tioc =3D QIO_CHANNEL_TLS(p->c); + + qio_channel_tls_handshake(tioc, + multifd_tls_outgoing_handshake, + p, + NULL, + NULL); + return NULL; +} + static void multifd_tls_channel_connect(MultiFDSendParams *p, QIOChannel *ioc, Error **errp) @@ -754,12 +767,10 @@ static void multifd_tls_channel_connect(MultiFDSendPa= rams *p, =20 trace_multifd_tls_outgoing_handshake_start(ioc, tioc, hostname); qio_channel_set_name(QIO_CHANNEL(tioc), "multifd-tls-outgoing"); - qio_channel_tls_handshake(tioc, - multifd_tls_outgoing_handshake, - p, - NULL, - NULL); - + p->c =3D QIO_CHANNEL(tioc); + qemu_thread_create(&p->thread, "multifd-tls-handshake-worker", + multifd_tls_handshake_thread, p, + QEMU_THREAD_JOINABLE); } =20 static bool multifd_channel_connect(MultiFDSendParams *p, --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206665; cv=none; d=zohomail.com; s=zohoarc; b=FB98v1SM0rL7V9QGjqPsl9lrZORpRD8rgCipWEFwWDkHxkKX3Zi7pEB+OzLv2py5xY+2wK9tSBnZC+sdALEZwxxXxUvDNJOQHPZpceVssirY+spr3x65uj6stcRh8DBuVjlaDbylscfvcplxX6Hd6BkovUKVlKEcCGKQVR2cN1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206665; 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=uYkNpllGQa8BMTT9bn+m2l0xSF1xvQhp1umpfouqGPU=; b=RxXVyusOq0O3viwXOFZatBvgujddBHcc9iDs71no3XPnSoAphaTHLxugmrnbHxNM0GNSKm9IjmAe9T009nISmdHap83hq/y/6ZdpSBZqB+D0jqbPtF5NtruGCh7SkwnOjzp+13/IOanqGOKDkjrzBFt6lBgS0gyePLZdjquT7/0= 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 1605206665865241.03644227027553; Thu, 12 Nov 2020 10:44:25 -0800 (PST) Received: from localhost ([::1]:58076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHa4-0001O7-Rq for importer@patchew.org; Thu, 12 Nov 2020 13:44:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUL-0002jX-P7 for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUK-0006TB-2F for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:29 -0500 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-197-uZKT-qFzNQe5YNdyuz3LZQ-1; Thu, 12 Nov 2020 13:38:24 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id BA6E71087D63; Thu, 12 Nov 2020 18:38:22 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB0D15D9E4; Thu, 12 Nov 2020 18:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206307; 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=uYkNpllGQa8BMTT9bn+m2l0xSF1xvQhp1umpfouqGPU=; b=hizrYyG7tZdjGSF4Hoi8CxL5v9vwJozShfq2dI+RhQUYURMO21Su8dRDSzAQN7pX1uZixG u03JkOZD0Bt4vN8IlRPNcaxtiMzcnAvhfss6XiObskcLn30Sn8sB7eN+lW0Jdu+jvMfuDD PBf+9RS/kwOQfT1R/y/OP8drrgysNQs= X-MC-Unique: uZKT-qFzNQe5YNdyuz3LZQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 04/11] migration: fix uninitialized variable warning in migrate_send_rp_req_pages() Date: Thu, 12 Nov 2020 18:37:51 +0000 Message-Id: <20201112183758.203176-5-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 08:00:44 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Chen Qun After the WITH_QEMU_LOCK_GUARD macro is added, the compiler cannot identify that the statements in the macro must be executed. As a result, some varia= bles assignment statements in the macro may be considered as unexecuted by the = compiler. When the -Wmaybe-uninitialized capability is enabled on GCC9,the compiler s= howed warning: migration/migration.c: In function =E2=80=98migrate_send_rp_req_pages=E2=80= =99: migration/migration.c:384:8: warning: =E2=80=98received=E2=80=99 may be use= d uninitialized in this function [-Wmaybe-uninitialized] 384 | if (received) { | ^ Add a default value for 'received' to prevented the warning. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201111142203.2359370-6-kuhn.chenqun@huawei.com> Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 3263aa55a9..f696e22fab 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -365,7 +365,7 @@ int migrate_send_rp_req_pages(MigrationIncomingState *m= is, RAMBlock *rb, ram_addr_t start, uint64_t had= dr) { void *aligned =3D (void *)(uintptr_t)(haddr & (-qemu_ram_pagesize(rb))= ); - bool received; + bool received =3D false; =20 WITH_QEMU_LOCK_GUARD(&mis->page_request_mutex) { received =3D ramblock_recv_bitmap_test_byte_offset(rb, start); --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206778; cv=none; d=zohomail.com; s=zohoarc; b=FlZ0nvws/FJDJKIoaJg66uxnob86rdYnQPwOOs5VPTXWILpO63VMOoGbkVFeRzg6hOcrNfVLwfVvsJy2roB6QfZpmSUCqC96DmMz/7d0hEiJRFtPz8/74pR4cfl3OIoOjibIm1BAo52uwvX4QRDH0iugx5859PwAca8rBv5Nufo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206778; 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=T3uZCA2pBHTQq5Zh8MKa+E90T+viNNaW//zz0jDKJYM=; b=CRb654ET5HSNGVtQxGAxdqaYuvAme0AIGQjRvCzXDojJ7nmeWN7LfjEmq21BCKK/SWtMGyJcLXFHdWaZRgT/KJA+v+pqhcEGyQHntB+oZjfQv2objUCCfGa2THu40qlnW823caxOPEeiDal0MQqH216pZQkcCUg/r53QVwpHNSY= 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 1605206778194458.47640504877404; Thu, 12 Nov 2020 10:46:18 -0800 (PST) Received: from localhost ([::1]:36128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHbt-00043e-29 for importer@patchew.org; Thu, 12 Nov 2020 13:46:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUV-0002zy-HM for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUT-0006WP-Sj for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:39 -0500 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-173-h7FRlY_0N2ay4YsUO6-Ngg-1; Thu, 12 Nov 2020 13:38:32 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id AACD9AF06A; Thu, 12 Nov 2020 18:38:30 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 13C955D9E4; Thu, 12 Nov 2020 18:38:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206317; 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=T3uZCA2pBHTQq5Zh8MKa+E90T+viNNaW//zz0jDKJYM=; b=G2BWR7AyWjnvMBT7r5SZv5gXL5jS2EaMsnbsUp/8xsjGMpLpb/ktnyNKBBRFhvQle/B39t N58j7pmicK+DO+pNrXHy4EBKipNlmXhgHtR8MZ80kUJ/Zhmptmor/Gf/pV/X465LvCfpP1 k4laFtmKRMzmmcXZpkpVQNPvKAvhPoY= X-MC-Unique: h7FRlY_0N2ay4YsUO6-Ngg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 05/11] migration/dirtyrate: simplify includes in dirtyrate.c Date: Thu, 12 Nov 2020 18:37:52 +0000 Message-Id: <20201112183758.203176-6-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 08:00:44 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Chuan Zheng Remove redundant blank line which is left by Commit 662770af7c6e8c, also take this opportunity to remove redundant includes in dirtyrate.c. Signed-off-by: Chuan Zheng Message-Id: <1604030281-112946-1-git-send-email-zhengchuan@huawei.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/dirtyrate.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c index 8f728d2600..ccb98147e8 100644 --- a/migration/dirtyrate.c +++ b/migration/dirtyrate.c @@ -11,17 +11,12 @@ */ =20 #include "qemu/osdep.h" - #include #include "qapi/error.h" #include "cpu.h" -#include "qemu/config-file.h" -#include "exec/memory.h" #include "exec/ramblock.h" -#include "exec/target_page.h" #include "qemu/rcu_queue.h" #include "qapi/qapi-commands-migration.h" -#include "migration.h" #include "ram.h" #include "trace.h" #include "dirtyrate.h" --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206878; cv=none; d=zohomail.com; s=zohoarc; b=JgGA0o7eyWHhTp1BeuM7wkvrPFkxsEgCe5i3QJqSK4ph/Mq/zXs0sYzHMf1YX5PI3zzKY35XDSHn3V4PN1YK7zC7LcMpezfBWqYaYDdYNXxByeIuJuDJG3kiYdWOmybIxuqjH8xTU/IVl6FD4i8N15KQP4fh58ODK2LUSgORzas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206878; 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=A2ti3fVP8mT2NIv7ZCyiPI3bXIvVq+ARR7hT+l4/QgA=; b=J8rcakDgZZshdIsOztlUT+yDTjI0H8ssejBur/kzYd7Gksa7ynvE0fX6sXlKcZZp/aWSY2mf2eMG+DNn0IhDtupM7CUqIbkxqP9u7yl9kzwDTeEDGLnsuo6jB6y6BCDfmo1AKJ14q0zLQ2FQK/FErvIW6HzPZ7xe3V1sQkV/RsU= 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 1605206878236148.45887326385503; Thu, 12 Nov 2020 10:47:58 -0800 (PST) Received: from localhost ([::1]:42444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHdV-0006cz-8h for importer@patchew.org; Thu, 12 Nov 2020 13:47:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUh-00033D-6C for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUd-0006XY-VB for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:50 -0500 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-26-tqrYqmD0MVG2vLxAEGsmtA-1; Thu, 12 Nov 2020 13:38:37 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 432EA1087D60; Thu, 12 Nov 2020 18:38:36 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id F42295D9E4; Thu, 12 Nov 2020 18:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206321; 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=A2ti3fVP8mT2NIv7ZCyiPI3bXIvVq+ARR7hT+l4/QgA=; b=MhLQaJ+56glo+EQym+QCrcWPXmR2Lmnomd/qTdF4DD17dyie3+5SQiZqRwtG0UhoCoNruk uY//6BrdYhKYFArc8KqwViYa14v7W14VrnvrT26qi7POCIb8f0FkE1Qf5idsh5y1ErxFj8 HMQN+agIR+6UqfJP/d0oVWrnd9J0vNg= X-MC-Unique: tqrYqmD0MVG2vLxAEGsmtA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 06/11] multifd/tls: fix memoryleak of the QIOChannelSocket object when cancelling migration Date: Thu, 12 Nov 2020 18:37:53 +0000 Message-Id: <20201112183758.203176-7-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 00:52:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Chuan Zheng When creating new tls client, the tioc->master will be referenced which res= ults in socket leaking after multifd_save_cleanup if we cancel migration. Fix it by do object_unref() after tls client creation. Suggested-by: Daniel P. Berrang=C3=A9 Signed-off-by: Chuan Zheng Message-Id: <1605104763-118687-1-git-send-email-zhengchuan@huawei.com> Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- migration/multifd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/multifd.c b/migration/multifd.c index 88486b90d6..45c690aa11 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -765,6 +765,7 @@ static void multifd_tls_channel_connect(MultiFDSendPara= ms *p, return; } =20 + object_unref(OBJECT(ioc)); trace_multifd_tls_outgoing_handshake_start(ioc, tioc, hostname); qio_channel_set_name(QIO_CHANNEL(tioc), "multifd-tls-outgoing"); p->c =3D QIO_CHANNEL(tioc); --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206952; cv=none; d=zohomail.com; s=zohoarc; b=VzX5/Yd9aINl0kf8a3wR/Hlz4NTTKwZtVh9xvxnHPnBp83pmE17/6tSu1oWyYKY6cdbbIQNM/1a+4PFowX0NP4sdl8nioJ1Q39tL3Barc6z3FFQEzyilLPgDy31Xho2TlWqmUHB/Iip+BWITUjn2ytTBB+SNtuAT6C0PqJC2lVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206952; 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=Q6nEKmLj5d6+j+dkyP524BhEMIkn9lxQsJrf3oP85Is=; b=CDYoILMJ6SJm6daQmd6IKoZl7O4u8E6RQg0BzDuMBgwpWYh8msOdFo3amoe4xcE0aQHaA76zgAIdbcGDsrNALETxXzNUGyoFoH52JprVwj/aUhiw5Y9R/w/qH+0r9Fuy8vncYaXXGawA2/aknHNn/sKmgV6TKLcl/0Cs8Evbhr0= 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 1605206952781125.70824576706957; Thu, 12 Nov 2020 10:49:12 -0800 (PST) Received: from localhost ([::1]:47646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHeh-0000LI-PN for importer@patchew.org; Thu, 12 Nov 2020 13:49:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUj-00034f-BQ for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUe-0006Xc-Ju for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:53 -0500 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-432-OW6OZLt3PM2iDSNfQYbEOw-1; Thu, 12 Nov 2020 13:38:39 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73019101F00D; Thu, 12 Nov 2020 18:38:38 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65DB55D9E4; Thu, 12 Nov 2020 18:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206321; 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=Q6nEKmLj5d6+j+dkyP524BhEMIkn9lxQsJrf3oP85Is=; b=HFp9vTAcgn/RblC/SdoTPsUZ6VOVy7sstbZzLjT42St/PhxSlXS5jMmIcau/JmAcOPUNxl rc/sBvWhe9rfjqm3XftE6QvQnJM3bpxM1dPq6VUoyL+dX6lSOECbW//YWnYnJCi0r/DwDN Uk6laPsD76O1GooCQWpx931YNFKT7ws= X-MC-Unique: OW6OZLt3PM2iDSNfQYbEOw-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 07/11] migration: handle CANCELLING state in migration_completion() Date: Thu, 12 Nov 2020 18:37:54 +0000 Message-Id: <20201112183758.203176-8-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 00:52:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: "Longpeng(Mike)" The following sequence may cause the VM abort during migration: 1. RUN_STATE_RUNNING,MIGRATION_STATUS_ACTIVE 2. before call migration_completion(), we send migrate_cancel QMP command, the state machine is changed to: RUN_STATE_RUNNING,MIGRATION_STATUS_CANCELLING 3. call migration_completion(), and the state machine is switch to: RUN_STATE_RUNNING,MIGRATION_STATUS_COMPLETED 4. call migration_iteration_finish(), because the migration status is COMPLETED, so it will try to set the runstate to POSTMIGRATE, but RUNNING-->POSTMIGRATE is an invalid transition, so abort(). The migration_completion() should not change the migration state to COMPLETED if it is already changed to CANCELLING. Signed-off-by: Longpeng(Mike) Message-Id: <20201105091726.148-1-longpeng2@huawei.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index f696e22fab..87a9b59f83 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3061,6 +3061,8 @@ static void migration_completion(MigrationState *s) =20 qemu_savevm_state_complete_postcopy(s->to_dst_file); trace_migration_completion_postcopy_end_after_complete(); + } else if (s->state =3D=3D MIGRATION_STATUS_CANCELLING) { + goto fail; } =20 /* --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206665; cv=none; d=zohomail.com; s=zohoarc; b=Jm0fx5E7Z1sGGqTiQyw0Fo7MZG6qwQ662lzJo43nAmSFiTleqmglhTHPShPbtmVdfxsvI1EzqE6XPDQvY0ZhN8D7hhyXNiJrXNifSounpB9jTsEJMDll0jvG0Zqa4HlY9G1W/SAhG8mGBowIqwtE15SGGQ6nIFmIoAgHrsuIQeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206665; 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=Sg7HcRs2/FAFweiOx5ZTXonC5w7t3XsXU78QHE7ftHY=; b=a2dHDz8a9FCz2sYfiCQxNjbOgRk/JWVJApo+vj7yuO4fMZssfaeTC1u12DwLe3KcgEa8B6kbB6vtFuR59G3BfKtQq5aNZBO5XgZqVzKwEjUOZo16FOZZPee9VUqGNbV3gao2wRN+x/P9YT/NJqW1zX+ebaZXUn7zLzj6FWY85TI= 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 1605206665840616.8463306640116; Thu, 12 Nov 2020 10:44:25 -0800 (PST) Received: from localhost ([::1]:58094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHa4-0001OU-Pn for importer@patchew.org; Thu, 12 Nov 2020 13:44:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUj-00034b-5X for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:24441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUe-0006Xi-JM for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:52 -0500 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-228-toDMNw8nOkGhNti1dbIhag-1; Thu, 12 Nov 2020 13:38:42 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id C99F78049D5; Thu, 12 Nov 2020 18:38:40 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD8755D9E4; Thu, 12 Nov 2020 18:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206324; 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=Sg7HcRs2/FAFweiOx5ZTXonC5w7t3XsXU78QHE7ftHY=; b=famE+JF5WViOcUURtfPIcGpWVjkDZIosLdkqJ7f6dDnR6qHAjBMEJuZArU+jKJiObNwepz XKV+gtEbt4uJzxwTGuGPHC+aelsQ/Z+el6CfusWjvZAcRAsAqmqsriD2aX3nETdvulEw91 j5WJGIhlmHr7iGMLzxrg9KHzOpASfZ8= X-MC-Unique: toDMNw8nOkGhNti1dbIhag-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 08/11] virtiofsd: Announce submounts even without statx() Date: Thu, 12 Nov 2020 18:37:55 +0000 Message-Id: <20201112183758.203176-9-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 00:52:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Max Reitz Contrary to what the check (and warning) in lo_init() claims, we can announce submounts just fine even without statx() -- the check is based on comparing both the mount ID and st_dev of parent and child. Without statx(), we will not have the mount ID; but we always have st_dev. The only problems we have (without statx() and its mount ID) are: (1) Mounting the same device twice may lead to both trees being treated as exactly the same tree by virtiofsd. But that is a problem that is completely independent of mirroring host submounts in the guest. Both submount roots will still show the FUSE_SUBMOUNT flag, because their st_dev still differs from their respective parent. (2) There is only one exception to (1), and that is if you mount a device inside a mount of itself: Then, its st_dev will be the same as that of its parent, and so without a mount ID, virtiofsd will not be able to recognize the nested mount's root as a submount. However, thanks to virtiofsd then treating both trees as exactly the same tree, it will be caught up in a loop when the guest tries to examine the nested submount, so the guest will always see nothing but an ELOOP there. Therefore, this case is just fully broken without statx(), whether we check for submounts (based on st_dev) or not. All in all, checking for submounts works well even without comparing the mount ID (i.e., without statx()). The only concern is an edge case that, without statx() mount IDs, is utterly broken anyway. Thus, drop said check in lo_init(). Reported-by: Miklos Szeredi Signed-off-by: Max Reitz Message-Id: <20201103164135.169325-1-mreitz@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index ec1008bceb..6c64b03f1a 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -610,14 +610,6 @@ static void lo_init(void *userdata, struct fuse_conn_i= nfo *conn) "does not support it\n"); lo->announce_submounts =3D false; } - -#ifndef CONFIG_STATX - if (lo->announce_submounts) { - fuse_log(FUSE_LOG_WARNING, "lo_init: Cannot announce submounts, th= ere " - "is no statx()\n"); - lo->announce_submounts =3D false; - } -#endif } =20 static void lo_getattr(fuse_req_t req, fuse_ino_t ino, --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206778; cv=none; d=zohomail.com; s=zohoarc; b=e4yqMr2XSXNUmFroDDYi3tD3kmij59rIS8u+peT8G0w/orI5l7LxG1XCblYhbWvRF1/fpHntRqgGoyHkm5Ua3dqggoVevUfDUV9tnVx9uJ5I5aALowUCUwfjCO+pNVZR5PdMin2O4ZlYvKoMvbDOO8mxHqwY5ERva+1PB3mPZNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206778; 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=toogz4jpakVdGhHc6BBe35wtfrdOBYUj5isTm1LGZSI=; b=dHAR2vRxQsbgWHxxYJMBjSCBpmTrX3vjMHsCRVkkb3VPYqz1xvvmmCqezfOOh3L1Az4hQDo95qTIGCr1FPQg9CyeY2qVZQtW45GEa5XfVkHkF/4UlhW2BnywSPu9xUUpbkKhN9ITQNoS8fiGpUkrW2RdoQ27S1OpuZh/ygaBfSg= 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 1605206778199938.2160985079116; Thu, 12 Nov 2020 10:46:18 -0800 (PST) Received: from localhost ([::1]:36138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHbt-00043p-1x for importer@patchew.org; Thu, 12 Nov 2020 13:46:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUl-00035t-Jp for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUg-0006Yl-SB for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:55 -0500 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-188-sSdILpfXO-6vKNQ8bGhPkQ-1; Thu, 12 Nov 2020 13:38:44 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A677AF061; Thu, 12 Nov 2020 18:38:43 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 204575D9E4; Thu, 12 Nov 2020 18:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206328; 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=toogz4jpakVdGhHc6BBe35wtfrdOBYUj5isTm1LGZSI=; b=amdCwThzDLRBcPXFXY7Xpk8UUSaebZ450lRUKnXN/zBj8id8bORI/QXa5nzaSZvr7p0vj4 IuPKp7VG++vti3Jf0Pzd+duT2Bdlg3ivFiNIEP/1Sd9Ki5uJgPWeydJsX04cFpfgyO7tND QXXub/lHkga1OQHYtx0cvKdPURas42g= X-MC-Unique: sSdILpfXO-6vKNQ8bGhPkQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 09/11] tools/virtiofsd/buffer.c: check whether buf is NULL in fuse_bufvec_advance func Date: Thu, 12 Nov 2020 18:37:56 +0000 Message-Id: <20201112183758.203176-10-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 00:52:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Haotian Li In fuse_bufvec_advance func, calling fuse_bufvec_current func may return NULL, so we should check whether buf is NULL before using it. Signed-off-by: Haotian Li Signed-off-by: Zhiqiang Liu Message-Id: <29fc87c2-b87c-4c34-40d4-75381f228849@huawei.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/buffer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c index 27c1377f22..bdc608c221 100644 --- a/tools/virtiofsd/buffer.c +++ b/tools/virtiofsd/buffer.c @@ -246,6 +246,10 @@ static int fuse_bufvec_advance(struct fuse_bufvec *buf= v, size_t len) { const struct fuse_buf *buf =3D fuse_bufvec_current(bufv); =20 + if (!buf) { + return 0; + } + bufv->off +=3D len; assert(bufv->off <=3D buf->size); if (bufv->off =3D=3D buf->size) { --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206653; cv=none; d=zohomail.com; s=zohoarc; b=KprlQ167OGLzrJ/eNqDyn3EhPcBcO4c90zfG39j05gjIK81eOy4xrBVQuXn1edbYzsze2yXb1jnZNiKjR/12T1tpx/psLmC9sdqq22zAHTf58o3RBCWzlmOhAKwQt6pTRl8q7VxJETGe1QW7tv7HndP6oPIG7EY26knLMkVl2V0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206653; 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=fcuHErFPMcHNVdgPBonXztwigpZoR6kVXPrHKyICSLk=; b=G6eHfIDYJNFlaWsD6F5cMxd6iOEakVx+SAI/hCY2Cx6cBl+SUS+tFRmmecGq1c2pSvl4rScTqLB/BAOum57tjDz7cT9mF4WySVxg0qiwe7K1mFsKkvxWr0thi7SccBQ3IczfTFGmTSXyn6jNOn6wollgik4laZPBmQjw9Wa5DEI= 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 1605206653853742.8015303789996; Thu, 12 Nov 2020 10:44:13 -0800 (PST) Received: from localhost ([::1]:57374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHZs-00016J-9k for importer@patchew.org; Thu, 12 Nov 2020 13:44:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUp-00039w-Ow for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUn-0006bI-8Z for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:38:59 -0500 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-31-n47Kf1F-Oz2O6j0UNAMPEQ-1; Thu, 12 Nov 2020 13:38:52 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2EDC801817; Thu, 12 Nov 2020 18:38:50 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68A8D5D9E4; Thu, 12 Nov 2020 18:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206336; 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=fcuHErFPMcHNVdgPBonXztwigpZoR6kVXPrHKyICSLk=; b=WHAsRCW8JApIF40oWuhg9BDoivcnE07/aerqS4UKVD2LBkV5k3qx0kwa/59MV3k1vUVIls tYmKg9hDqv39H4jvcsylMYmJAKMB8XcvVtEVD20Insp23wkS+WQZlk0b7wEI2Iy5MvOvFC f2xCcsw/VISu6pYQXvONy3g05m22Bro= X-MC-Unique: n47Kf1F-Oz2O6j0UNAMPEQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 10/11] virtiofsd: check whether lo_map_reserve returns NULL in, main func Date: Thu, 12 Nov 2020 18:37:57 +0000 Message-Id: <20201112183758.203176-11-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 08:00:44 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Haotian Li In main func, func lo_map_reserve is called without NULL check. If reallocing new_elems fails in func lo_map_grow, the func lo_map_reserve may return NULL. We should check whether lo_map_reserve returns NULL before using it. Signed-off-by: Haotian Li Signed-off-by: Zhiqiang Liu Message-Id: <48887813-1c95-048c-6d10-48e3dd2bac71@huawei.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 6c64b03f1a..9545a0d174 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -3425,6 +3425,7 @@ int main(int argc, char *argv[]) .proc_self_fd =3D -1, }; struct lo_map_elem *root_elem; + struct lo_map_elem *reserve_elem; int ret =3D -1; =20 /* Don't mask creation mode, kernel already did that */ @@ -3444,8 +3445,17 @@ int main(int argc, char *argv[]) * [1] Root inode */ lo_map_init(&lo.ino_map); - lo_map_reserve(&lo.ino_map, 0)->in_use =3D false; + reserve_elem =3D lo_map_reserve(&lo.ino_map, 0); + if (!reserve_elem) { + fuse_log(FUSE_LOG_ERR, "failed to alloc reserve_elem.\n"); + goto err_out1; + } + reserve_elem->in_use =3D false; root_elem =3D lo_map_reserve(&lo.ino_map, lo.root.fuse_ino); + if (!root_elem) { + fuse_log(FUSE_LOG_ERR, "failed to alloc root_elem.\n"); + goto err_out1; + } root_elem->inode =3D &lo.root; =20 lo_map_init(&lo.dirp_map); --=20 2.28.0 From nobody Sun Feb 8 15:46:40 2026 Delivered-To: importer@patchew.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=1605206768; cv=none; d=zohomail.com; s=zohoarc; b=b8dVPdsp//DXRy9c2wzBdAV2S7DRSmNG8nqzfAYkBk9V1tr46eRBKMTCXqJTKhVt7I5x/uQEl+mQsFXGUJItmuwejhq6ldp/dm5LGShVtpLvTQPEvdeksXslbDrIlPnsYREUO35M8fYDX2lWEjtTD9zZUinkzoTtzd3gjRHvKZc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605206768; 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=44aOo1Hs4295NOX01ACaymULxAgiOQSYTEKlmJit1as=; b=epC2s9M+CHR7j1ZiNoOIulk2iyRi28jFKjurObEHcWTcdGpLTUoQhZiycPsnRko9ZgarcOPHsS74LwBW/FDd/h5qDzbWcpxHPlSVWVAf/b2AKPIxO0Rph6wxCbh93JGi8rSdyWhenJkE3wRQ5X7GYwxtSEJuwdcpYCuYZt/wvhw= 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 1605206768670151.43544508239472; Thu, 12 Nov 2020 10:46:08 -0800 (PST) Received: from localhost ([::1]:35498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHbj-0003nn-I8 for importer@patchew.org; Thu, 12 Nov 2020 13:46:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUq-0003C7-On for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:39:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23319) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kdHUo-0006bi-VL for qemu-devel@nongnu.org; Thu, 12 Nov 2020 13:39:00 -0500 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-310-o8sxG84sOr6sX95ed8v7WA-1; Thu, 12 Nov 2020 13:38:54 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id EEA4E101F00C; Thu, 12 Nov 2020 18:38:52 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id F037C5D9E4; Thu, 12 Nov 2020 18:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605206338; 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=44aOo1Hs4295NOX01ACaymULxAgiOQSYTEKlmJit1as=; b=cP6UMimYtsukC4b2bgsZ0/ObS6TSjBuJ/2s9iFmO3W8ig5+gMrNJXahcbP4cDw70S4rJ1m NCnHahE94wt+pYNk7NPNL5+uV7hQndGJ6sxHpTq8qcJOO8jurhtw8A5hbM+UtBX+Hr39Ea SG7vGG6SF5OChflTF4OBObmdIHO5vpM= X-MC-Unique: o8sxG84sOr6sX95ed8v7WA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, kuhn.chenqun@huawei.com, zhengchuan@huawei.com, lihaotian9@huawei.com, longpeng2@huawei.com, liangpeng10@huawei.com, philmd@redhat.com, liuzhiqiang26@huawei.com Subject: [PULL 11/11] virtiofsd: check whether strdup lo.source return NULL in main func Date: Thu, 12 Nov 2020 18:37:58 +0000 Message-Id: <20201112183758.203176-12-dgilbert@redhat.com> In-Reply-To: <20201112183758.203176-1-dgilbert@redhat.com> References: <20201112183758.203176-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 00:52:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Haotian Li In main func, strdup lo.source may fail. So check whether strdup lo.source return NULL before using it. Signed-off-by: Haotian Li Signed-off-by: Zhiqiang Liu Message-Id: Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 9545a0d174..97485b22b4 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -3517,6 +3517,10 @@ int main(int argc, char *argv[]) } } else { lo.source =3D strdup("/"); + if (!lo.source) { + fuse_log(FUSE_LOG_ERR, "failed to strdup source\n"); + goto err_out1; + } } =20 if (lo.xattrmap) { --=20 2.28.0