From nobody Sun Feb 8 17:14:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1692281147; cv=none; d=zohomail.com; s=zohoarc; b=IBZP9zm2d97YCC0zLIP6zHuTtsKgVNZWCTbVGfXshZaAFPW2CUSYskFYiJLkyOjfyDYyB34eDyKR8suxpqYDO1j26S154N8GWQq6W55uTplMto++3mhcecxGao2wy+FxvW7JnLGE4v70Lt6esE1xmJkb5sYYj2dEXVI+vETWYNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692281147; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pIVjey37hE/oINENORPFWBcHJwoYuNvc2YP6vaCnum4=; b=dKVb7dt61Z0FxAajFUpxLd8p0oPCsVhBU2lbakDd44tU81YK5h5xNPivLh21IrYz7n5MiHu9IMjL9C06obNGvfmtCL8FBptJj6R/Qu1BvW2FMkpL6kqxtRTmXSoWpp8RwLFCu/Y0bWkMNCWC3x6AEfN1XN8fWAcmd2NVVGwg6rI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1692281147112497.10185300879346; Thu, 17 Aug 2023 07:05:47 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-357-d8l3kDD4NdyzfHcgBWEUPg-1; Thu, 17 Aug 2023 10:05:44 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B4E3805585; Thu, 17 Aug 2023 14:05:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63CF6140E962; Thu, 17 Aug 2023 14:05:41 +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 4A1111946A48; Thu, 17 Aug 2023 14:05:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9DE251946587 for ; Thu, 17 Aug 2023 14:05:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 899D4C15E6B; Thu, 17 Aug 2023 14:05:20 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3158BC159F2 for ; Thu, 17 Aug 2023 14:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692281146; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=pIVjey37hE/oINENORPFWBcHJwoYuNvc2YP6vaCnum4=; b=JLdkV/aHoIqosBxG9YZHmV1Uy983a/hgsJFLfKZbC5PpbVEn2AdimTKoGJwKWbSr8q4nBM xEpLlj5XN96VylQqiro8WHrihRsfAyoVY5tdZREc6AIBYhiaHNOjP8GuoQ38QO5k7kuZ5r nSpHav6Cc1neEQcNkjt9Gc2Jk1eGOlI= X-MC-Unique: d8l3kDD4NdyzfHcgBWEUPg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/9] qemu_hotplug: validate address on memory device change Date: Thu, 17 Aug 2023 16:05:10 +0200 Message-ID: <6c4c8b128743b7efd7dbb496be227e00529869ec.1692281096.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692281148288100001 Content-Type: text/plain; charset="utf-8"; x-default="true" As of v7.9.0-rc1~296 users have ability to adjust what portion of virtio-mem is exposed to the guest. Then, as of v9.4.0-rc2~5 they have ability to set address where the memory is mapped. But due to a missing check it was possible to feed virDomainUpdateDeviceFlags() API with memory device XML that changes the address. This is of course not possible and should be forbidden. Add the missing check. Signed-off-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 2e3c99760d..03a50191ef 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -7102,6 +7102,13 @@ qemuDomainChangeMemoryLiveValidateChange(const virDo= mainMemoryDef *oldDef, return false; } =20 + if (oldDef->address !=3D newDef->address) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory address from '0x%1$llx' to = '0x%2$llx'"), + oldDef->address, newDef->address); + return false; + } + return true; } =20 --=20 2.41.0