From nobody Tue Feb 10 16:22:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697017082; cv=none; d=zohomail.com; s=zohoarc; b=j+NCIrqzXBlIJFZx1uLHQL2ZexUbFLSgks4Rboc9bFpFKr1OSpPDwdETw4otwuJfCNLTlpPWBh81s7pyPAYKE8k22Iq2sf0eDaD11Ik6z/IMCCOevQtFW5qh74c5gDCERIgwfRcEYOAfgLsxMm58v8aOpOW87vNyegdMYfQX2+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697017082; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dTJUXRqg9j/QZHqHINbtsWukLfS8RvwXkaMG/1hsMMo=; b=NDygizjik877JbtaRoYw/uQrHn4isQqHVYkRixTVHikqPyCpuqlAxpg8FcT7Frj7eIkNQTltRsPv509N4GaVmOf2wXZAZcdeKiiwPrXJpQfsuDMKKrEezsVt9kJCUd/5mXJ+m3zx0vkrSmDCCVwjTkKQZt50UW2As5/X1NeYmDk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169701708297088.69333334675127; Wed, 11 Oct 2023 02:38:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqVQ0-00075y-S6; Wed, 11 Oct 2023 05:22:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqVPz-00075R-7l for qemu-devel@nongnu.org; Wed, 11 Oct 2023 05:22:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqVPx-0004oY-4p for qemu-devel@nongnu.org; Wed, 11 Oct 2023 05:22:14 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.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-563-3wOIJo5ENZ-H2nzEYikgDg-1; Wed, 11 Oct 2023 05:22:08 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 6FC6F381458D; Wed, 11 Oct 2023 09:22:08 +0000 (UTC) Received: from secure.mitica (unknown [10.39.195.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A5261C060AE; Wed, 11 Oct 2023 09:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697016132; 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=dTJUXRqg9j/QZHqHINbtsWukLfS8RvwXkaMG/1hsMMo=; b=dJG5rVa16ms7vmdAcQTEOkNje8QuGUGM5hukNESPvHxR4WD+CaZhl6T/NJtV1OczKSRFou 5dJk3w5Z9dR93wvfQl02qEHG/hofLFsL+wMTAcYlPBLfShHZrWSwag54Tz7W/uUU0d8r6b YZcZOvhHsd9NPkMZIjpn1KcNCpvu/Eg= X-MC-Unique: 3wOIJo5ENZ-H2nzEYikgDg-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Laurent Vivier , Peter Xu , Paolo Bonzini , Markus Armbruster , Juan Quintela , Thomas Huth , Li Zhijian , Leonardo Bras , Eric Blake , Fabiano Rosas , qemu-stable@nongnu.org, =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 01/65] migration/qmp: Fix crash on setting tls-authz with null Date: Wed, 11 Oct 2023 11:20:59 +0200 Message-ID: <20231011092203.1266-2-quintela@redhat.com> In-Reply-To: <20231011092203.1266-1-quintela@redhat.com> References: <20231011092203.1266-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697017083432100007 From: Peter Xu QEMU will crash if anyone tries to set tls-authz (which is a type StrOrNull) with 'null' value. Fix it in the easy way by converting it to qstring just like the other two tls parameters. Cc: qemu-stable@nongnu.org # v4.0+ Fixes: d2f1d29b95 ("migration: add support for a "tls-authz" migration para= meter") Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Fabiano Rosas Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela Signed-off-by: Peter Xu Signed-off-by: Juan Quintela Message-ID: <20230905162335.235619-2-peterx@redhat.com> --- migration/options.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/migration/options.c b/migration/options.c index 1d1e1321b0..6bbfd4853d 100644 --- a/migration/options.c +++ b/migration/options.c @@ -1408,20 +1408,25 @@ void qmp_migrate_set_parameters(MigrateSetParameter= s *params, Error **errp) { MigrationParameters tmp; =20 - /* TODO Rewrite "" to null instead */ + /* TODO Rewrite "" to null instead for all three tls_* parameters */ if (params->tls_creds && params->tls_creds->type =3D=3D QTYPE_QNULL) { qobject_unref(params->tls_creds->u.n); params->tls_creds->type =3D QTYPE_QSTRING; params->tls_creds->u.s =3D strdup(""); } - /* TODO Rewrite "" to null instead */ if (params->tls_hostname && params->tls_hostname->type =3D=3D QTYPE_QNULL) { qobject_unref(params->tls_hostname->u.n); params->tls_hostname->type =3D QTYPE_QSTRING; params->tls_hostname->u.s =3D strdup(""); } + if (params->tls_authz + && params->tls_authz->type =3D=3D QTYPE_QNULL) { + qobject_unref(params->tls_authz->u.n); + params->tls_authz->type =3D QTYPE_QSTRING; + params->tls_authz->u.s =3D strdup(""); + } =20 migrate_params_test_apply(params, &tmp); =20 --=20 2.41.0