From nobody Fri Aug 28 00:12:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1786702231; cv=none; d=zohomail.com; s=zohoarc; b=KYEYIgE1v3gu8ZIX8tfx/V23BulfmVooriM8CSZ864eaA0taGQiGIsK5YmQm4NZUNLcGEL33qaVwHu72aRiVatTo+nrRTn4mk/JU7/q0r2/hAgSr6TqT5SOIMnmNlgutOih2SrFo5w9cvRJvtai/HQXlN0A0TwjunXrxOeUbeVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786702231; 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=pBBMSST484Z/zskwvysc/XPgewB70i/Ya1qnX88pKTk=; b=N4TphEyii+vM4NbvO2IOHAWmkGeGL0e93d8AaIsmI3xXAkveHePM2QryddQcYqgc7qf6Ckb9xRlh+hESj6knxEQceZnqDXInmntZ4sUnf4UsPPnXwWuVH5HV5zHbh7csW2zIAQeW1+EaeOfSDZ04XSw7AN4KO6QBvU/DWglptQc= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786702231422789.1016065857066; Fri, 14 Aug 2026 03:10:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuor0-0002Yk-Px; Fri, 14 Aug 2026 06:09:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuoqx-0002YE-3w for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:32 -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 1wuoqv-0001hK-6l for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:30 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61-aO5WDmx0OdeP7hbhFDnecg-1; Fri, 14 Aug 2026 06:09:24 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 81436180035C; Fri, 14 Aug 2026 10:09:23 +0000 (UTC) Received: from thuth-p1g4.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3CD8A427; Fri, 14 Aug 2026 10:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786702167; 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=pBBMSST484Z/zskwvysc/XPgewB70i/Ya1qnX88pKTk=; b=SPENARlzl3SrGluxVqXh1TUwmbZVuBl+5PI1ogD/5gsJIA40YKDYnwMNPC+/4HOcB1nc4P hKa+ZXFSG/6iPS+HhP8hKzQYbkr4WrPc1GCAuCkS+1Op/B4vOXzdhcNfY9pdtbU+8x/SNI YHnE6EumKCapb87l74ES2I1hTCznKaE= X-MC-Unique: aO5WDmx0OdeP7hbhFDnecg-1 X-Mimecast-MFC-AGG-ID: aO5WDmx0OdeP7hbhFDnecg_1786702163 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Lei Yang , Maksim Davydov , Ben Chaney Subject: [PULL 1/6] tests/functional: add skipWithoutSudo() decorator Date: Fri, 14 Aug 2026 12:09:12 +0200 Message-ID: <20260814100917.163448-2-thuth@redhat.com> In-Reply-To: <20260814100917.163448-1-thuth@redhat.com> References: <20260814100917.163448-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.759, 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_H2=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development 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: 1786702233309158500 From: Vladimir Sementsov-Ogievskiy To be used in the next commit: that would be a test for TAP networking, and it will need to setup TAP device. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Thomas Huth Tested-by: Lei Yang Reviewed-by: Maksim Davydov Reviewed-by: Ben Chaney Message-ID: <20260729091334.1863155-15-vsementsov@yandex-team.ru> Signed-off-by: Thomas Huth --- tests/functional/qemu_test/decorators.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qe= mu_test/decorators.py index fcf236ecfdf..aa135acc785 100644 --- a/tests/functional/qemu_test/decorators.py +++ b/tests/functional/qemu_test/decorators.py @@ -6,6 +6,7 @@ import os import platform import resource +import subprocess from unittest import skipIf, skipUnless =20 from .cmd import which @@ -177,3 +178,18 @@ def skipLockedMemoryTest(locked_memory): ulimit_memory =3D=3D resource.RLIM_INFINITY or ulimit_memory >=3D = locked_memory * 1024, f'Test required {locked_memory} kB of available locked memory', ) + +''' +Decorator to skip execution of a test if passwordless +sudo command is not available. +''' +def skipWithoutSudo(): + proc =3D subprocess.run(["sudo", "-n", "/bin/true"], + stdin=3Dsubprocess.PIPE, + stdout=3Dsubprocess.PIPE, + stderr=3Dsubprocess.STDOUT, + universal_newlines=3DTrue, + check=3DFalse) + + return skipUnless(proc.returncode =3D=3D 0, + f'requires password-less sudo access: {proc.stdout}') --=20 2.55.0 From nobody Fri Aug 28 00:12:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1786702227; cv=none; d=zohomail.com; s=zohoarc; b=HlhUV7p+6OrtV3E+0T+OaN5LwxibaiinR8mFnoYRZcgzY9bKMJ+yCfSZW1xP8mFXZGNbf9YgjXpKjWrdF3T8FJtap8O/5+XmaxEtR8F7LIZSiBGbqw2WCrarb5mdp6oNEAiz3uhlsTwN80UZXDIXlnvYk6Su0zzSp83NFeKpkWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786702227; h=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=eajPihqaIKakud96xK9ImxfArzHQS6U2yhtiTwTnHe8=; b=eGZL5o13dtre4lO2h1K+9vjwgPSutegFEQtruVL3BSz9a1lcz3HN4ctG2MoqwNpBqaqnTGRxaWDXRFVpNnYIMPDwpU/R9C6yXaG8DGSVjv4OZiSqV1VjjuWeXieui2pq1pcTsiyNw+Tn51+qq12ri3LOOdlVOjFf+tnFL4ooL4w= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786702227150980.7075429798738; Fri, 14 Aug 2026 03:10:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuorG-0002bp-26; Fri, 14 Aug 2026 06:09:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuorA-0002aD-4O for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:45 -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 1wuor8-0001jF-1I for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:43 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-4aMjAmREMfmIiybqECAhfg-1; Fri, 14 Aug 2026 06:09:26 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9E33B1956096; Fri, 14 Aug 2026 10:09:25 +0000 (UTC) Received: from thuth-p1g4.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E5CB4423; Fri, 14 Aug 2026 10:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786702181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eajPihqaIKakud96xK9ImxfArzHQS6U2yhtiTwTnHe8=; b=iCH4G1C33Dp0hueYixMaGsN/U49wVFZssw29hQxlOA4NS6oc9WjTQ64DzIfNmRcCuFxVX0 GLFmULuhvqPXQ/151YWNmucCjE5oF3WERv7HTkVzNx36yXH8HP0WxPUc5M2cjrpUkaKTT7 0DGU9RUqTlj6qO6WrpZWjR0PcL/ZDCc= X-MC-Unique: 4aMjAmREMfmIiybqECAhfg-1 X-Mimecast-MFC-AGG-ID: 4aMjAmREMfmIiybqECAhfg_1786702165 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Vladimir Sementsov-Ogievskiy Subject: [PULL 2/6] tests/functional/qemu_test: drop *args argument from .get_vm() Date: Fri, 14 Aug 2026 12:09:13 +0200 Message-ID: <20260814100917.163448-3-thuth@redhat.com> In-Reply-To: <20260814100917.163448-1-thuth@redhat.com> References: <20260814100917.163448-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.759, 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_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1786702229791158500 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy It's redundant. Only one caller use it, and it may be simply substituted by .add_args(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Thomas Huth Message-ID: <20260729093146.1893719-3-vsementsov@yandex-team.ru> Signed-off-by: Thomas Huth --- tests/functional/migration.py | 3 ++- tests/functional/qemu_test/testcase.py | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/functional/migration.py b/tests/functional/migration.py index 4344e03be41..8d2428efc24 100644 --- a/tests/functional/migration.py +++ b/tests/functional/migration.py @@ -63,7 +63,8 @@ def migrate_vms(self, dst_uri, src_uri, dst_vm, src_vm): self.assert_dest_vm(dst_vm) =20 def migrate(self, dst_uri, src_uri=3DNone): - dst_vm =3D self.get_vm('-incoming', 'defer', name=3D"dst-qemu") + dst_vm =3D self.get_vm("dst-qemu") + dst_vm.add_args('-incoming', 'defer') self.configure_machine(dst_vm) dst_vm.launch() =20 diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu= _test/testcase.py index e4179d165c0..12ef84281c4 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -381,7 +381,7 @@ def require_device(self, devicename): if helptxt.find(devicename) < 0: self.skipTest('no support for device ' + devicename) =20 - def _new_vm(self, name, *args): + def _new_vm(self, name): vm =3D QEMUMachine(self.qemu_bin, name=3Dname, base_temp_dir=3Dself.workdir, @@ -394,20 +394,17 @@ def _new_vm(self, name, *args): vm.add_args("-chardev", f"socket,id=3Dbackdoor,path=3D{sockpath},server=3D= on,wait=3Doff", "-mon", "chardev=3Dbackdoor,mode=3Dcontrol") - - if args: - vm.add_args(*args) return vm =20 @property def vm(self): return self.get_vm(name=3D'default') =20 - def get_vm(self, *args, name=3DNone): + def get_vm(self, name=3DNone): if not name: name =3D str(uuid.uuid4()) if self._vms.get(name) is None: - self._vms[name] =3D self._new_vm(name, *args) + self._vms[name] =3D self._new_vm(name) if self.cpu is not None: self._vms[name].add_args('-cpu', self.cpu) if self.machine is not None: --=20 2.55.0 From nobody Fri Aug 28 00:12:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1786702249; cv=none; d=zohomail.com; s=zohoarc; b=fQR2aTm36DRDHc7uQG3asiFaNwdq56AmsPO/STzVWLDfMFVMf+XlvTDj7P/meTu3m4FZfL3f6B+GmFyMNkcR+MpcYSh4+vVMhGf3PBi5Jva2rVio5ZRHX0SNdfECUmw1G4Ob05/5T49Kez62hg7QJw4P1rF8ATOI3wJtXDrXPYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786702249; h=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=aiA1ZyU6TsIQ6qr9x0rVqaV+1oNs0PWDubrPSqeotPs=; b=cxDvatJr2PfkwfbSeec+2Hd/2morCAiLRr4N094j0FegcCuc88Ys6cRdll3X7wZZdute+an5VqUGykRfLkG2ys8J1mnqs8uvJptmgNYmO5BxHe0Xv8GKHYY1qTHZv27DNiJPysJbB2yxd3fIZ4BuhzIAWUj18wzCI810oagzTTA= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786702249229476.6794727007484; Fri, 14 Aug 2026 03:10:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuorD-0002al-Sj; Fri, 14 Aug 2026 06:09:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuor6-0002Zd-HX for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuor3-0001ih-FS for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:40 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-380-0NO-ltn0NDCB0Wm1PELCCg-1; Fri, 14 Aug 2026 06:09:28 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5E9CC19560A2; Fri, 14 Aug 2026 10:09:27 +0000 (UTC) Received: from thuth-p1g4.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3BA35423; Fri, 14 Aug 2026 10:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786702176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aiA1ZyU6TsIQ6qr9x0rVqaV+1oNs0PWDubrPSqeotPs=; b=PLlys6apOyZsfMGzs26lMchtMwZJJhdpYo9uPPpOVvpNTvDNVRnXjRJF3iD9NSdUWYGrNX QeK0GhjZErU/NUToCQG6P+XSn2+fSvmjBQdCwaJOGuPswjT7vAJy+D+gF1UVAkLnkUmppD 7VV7rezkEndMLj9cLJGeYLxQ6koWQEM= X-MC-Unique: 0NO-ltn0NDCB0Wm1PELCCg-1 X-Mimecast-MFC-AGG-ID: 0NO-ltn0NDCB0Wm1PELCCg_1786702167 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Vladimir Sementsov-Ogievskiy Subject: [PULL 3/6] tests/testcase.py: passthrough monitor_address Date: Fri, 14 Aug 2026 12:09:14 +0200 Message-ID: <20260814100917.163448-4-thuth@redhat.com> In-Reply-To: <20260814100917.163448-1-thuth@redhat.com> References: <20260814100917.163448-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.759, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1786702251362158500 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy We'll need it soon to implement test for cpr-exec mode of tap-fd-migration. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Thomas Huth Message-ID: <20260729093146.1893719-5-vsementsov@yandex-team.ru> Signed-off-by: Thomas Huth --- tests/functional/qemu_test/testcase.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu= _test/testcase.py index 12ef84281c4..69d3d06cc0e 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -381,11 +381,12 @@ def require_device(self, devicename): if helptxt.find(devicename) < 0: self.skipTest('no support for device ' + devicename) =20 - def _new_vm(self, name): + def _new_vm(self, name, monitor_address): vm =3D QEMUMachine(self.qemu_bin, name=3Dname, base_temp_dir=3Dself.workdir, - log_dir=3Dself.log_file()) + log_dir=3Dself.log_file(), + monitor_address=3Dmonitor_address) self.log.debug('QEMUMachine "%s" created', name) self.log.debug('QEMUMachine "%s" temp_dir: %s', name, vm.temp_dir) =20 @@ -400,11 +401,11 @@ def _new_vm(self, name): def vm(self): return self.get_vm(name=3D'default') =20 - def get_vm(self, name=3DNone): + def get_vm(self, name=3DNone, monitor_address=3DNone): if not name: name =3D str(uuid.uuid4()) if self._vms.get(name) is None: - self._vms[name] =3D self._new_vm(name) + self._vms[name] =3D self._new_vm(name, monitor_address) if self.cpu is not None: self._vms[name].add_args('-cpu', self.cpu) if self.machine is not None: --=20 2.55.0 From nobody Fri Aug 28 00:12:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1786702227; cv=none; d=zohomail.com; s=zohoarc; b=En/RMCXuvKKU0v4VT33+f+Kn+DRmtruwcNlmvRVftnwXrGhznyniz44ONHqMs557G3k75Hk7ouP03Rl4omDDSjUzX61bTUIe8mwxAOV6IJNmvewDtdyjxcIz3XEqVpOoEac5NZ5yc7m2h1Tx1n0ydK9eObUQOXFDPWr5zrsrULg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786702227; h=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=sDnA5EbS2SujH8j99fbEfzBj9813RFIjqUx0PvCdrt8=; b=mE1bRgpmgArj9uV3UB43jrGJ/CNEJkxfctxMsX0mKxdPNpjnaUPuuNzNd+7xoS+HKPV/Ptc6gBRxApBpmy5qAx5YYjCjYY8MilU04g/Rg6V6CVKNzh2rRu1ZTwtlmcW4qXZKMD331h3jBRhdAicAk3EG0HEm9t4i34uQTjJyekk= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786702227327532.7522931743473; Fri, 14 Aug 2026 03:10:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuor9-0002Zz-W8; Fri, 14 Aug 2026 06:09:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuor2-0002Z2-KH for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:38 -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 1wuoqy-0001i5-84 for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:34 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-685-pCrUw5trO6qmOODjPJ4iMQ-1; Fri, 14 Aug 2026 06:09:30 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC021195608E; Fri, 14 Aug 2026 10:09:28 +0000 (UTC) Received: from thuth-p1g4.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C2657423; Fri, 14 Aug 2026 10:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786702171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sDnA5EbS2SujH8j99fbEfzBj9813RFIjqUx0PvCdrt8=; b=KUdLch0jyJ+tZ80pxSEg7jOPS+e8y/4D4GrP+xaSHtpKiWwxxiF8ROyDsHsNl3ZL4BjZRU ibSie50cToflWopzNKdaE7SUL4A7SsX8L48ijXH6JXqV4Ohq2/fcwMsbX8+c2Hv/R5FoXU gwJHTe+pyTOrVDhgu9j3o3FlkD5m4aI= X-MC-Unique: pCrUw5trO6qmOODjPJ4iMQ-1 X-Mimecast-MFC-AGG-ID: pCrUw5trO6qmOODjPJ4iMQ_1786702169 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Feifan Qian Subject: [PULL 4/6] hw/usb/dev-uas: Don't abort if guest provided an undersized buffer for status Date: Fri, 14 Aug 2026 12:09:15 +0200 Message-ID: <20260814100917.163448-5-thuth@redhat.com> In-Reply-To: <20260814100917.163448-1-thuth@redhat.com> References: <20260814100917.163448-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.759, 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_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1786702229679158500 Content-Type: text/plain; charset="utf-8" QEMU currently aborts if the guest provides an undersized buffer for the status packet (8 bytes): hw/usb/core.c:623: usb_packet_copy: Assertion `p->actual_length + bytes <=3D iov->size' failed. If we hit this situation, log a guest error and continue by simply only providing the bytes that the guest asked for. (Note: This is e.g. similar to the UAS_PIPE_ID_COMMAND case that also clamps the length with: length =3D MIN(sizeof(iu), p->iov.size)) Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3900 Reported-by: Feifan Qian Signed-off-by: Thomas Huth Message-ID: <20260730163901.1154791-1-thuth@redhat.com> --- hw/usb/dev-uas.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index 963c0433b38..be8c3667e83 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -359,6 +359,7 @@ static void usb_uas_send_status_bh(void *opaque) UASDevice *uas =3D opaque; UASStatus *st; USBPacket *p; + uint32_t length; =20 while ((st =3D QTAILQ_FIRST(&uas->results)) !=3D NULL) { if (uas_using_streams(uas)) { @@ -373,7 +374,14 @@ static void usb_uas_send_status_bh(void *opaque) break; } =20 - usb_packet_copy(p, &st->status, st->length); + length =3D st->length; + if (length > p->iov.size) { + qemu_log_mask(LOG_GUEST_ERROR, + "usb uas: packet (%zd) too small for status (%d)= \n", + p->iov.size, length); + length =3D p->iov.size; + } + usb_packet_copy(p, &st->status, length); QTAILQ_REMOVE(&uas->results, st, next); g_free(st); =20 @@ -875,7 +883,14 @@ static void usb_uas_handle_data(USBDevice *dev, USBPac= ket *p) break; } } - usb_packet_copy(p, &st->status, st->length); + length =3D st->length; + if (length > p->iov.size) { + qemu_log_mask(LOG_GUEST_ERROR, + "usb uas: packet (%zd) too small for status (%d)= \n", + p->iov.size, length); + length =3D p->iov.size; + } + usb_packet_copy(p, &st->status, length); QTAILQ_REMOVE(&uas->results, st, next); g_free(st); break; --=20 2.55.0 From nobody Fri Aug 28 00:12:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1786702227; cv=none; d=zohomail.com; s=zohoarc; b=MhuKctqXMXf5fg6evu/9rzFHqU8Sm4UqRtyXsnVEA5kSLYFupXZ2Eb9Misl+SO7uEBkK30GB6liJANZtxrVtMON5oLeksU8ZiunUzJDmS5W2mb8d6a+fSaYW6OXQcddfyMuhPSaGKcobfSeTqGPmR+oU5z/NepsaHVGpjeGprNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786702227; 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=PjtLSYFnFZ7LjtaY6dnlUcg+NDfdXxsRAcuTbxUkWCA=; b=LVx2ETIoeZcoO00eZGyK9r9xq6iwoK6jwXGLdZDt26m/x4TWa+aH/M44FSz7z/iix0qbZC00tNyZCt8eHRVGNfaaahnvWQXLatKCC2Yry5ZZ8W7wYMldAyW6tdrTGws55DkASQlaOCqINvCTirLoRq9CT5skBEYY5cBUfv4g1uU= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786702227477585.7117146159244; Fri, 14 Aug 2026 03:10:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuorB-0002aE-TZ; Fri, 14 Aug 2026 06:09:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuor6-0002ZO-B3 for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:40 -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 1wuor2-0001iX-Dv for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:38 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-183-rDjQeXcpPwS19SFsamrYkA-1; Fri, 14 Aug 2026 06:09:31 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 95DED1800637; Fri, 14 Aug 2026 10:09:30 +0000 (UTC) Received: from thuth-p1g4.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5A933422; Fri, 14 Aug 2026 10:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786702175; 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=PjtLSYFnFZ7LjtaY6dnlUcg+NDfdXxsRAcuTbxUkWCA=; b=QVyip7HZvKKYyxFO7R1oiJfvzL4LpVIlpl+OCedxqVdMMxciXaSI7zPXQaWFg7hy1XlTTj 1+IdxEiiXZAo9by3U5o0GSpoujESPboUdwfLxQcb1OVOfNDfiu7y39rvMA7LXpM5CAahf+ O120k93AD5VMqVJkSp7Pr/QqilLLTbk= X-MC-Unique: rDjQeXcpPwS19SFsamrYkA-1 X-Mimecast-MFC-AGG-ID: rDjQeXcpPwS19SFsamrYkA_1786702170 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 5/6] hw/net/vmxnet3: Do not abort if guest provides bad interrupt numbers Date: Fri, 14 Aug 2026 12:09:16 +0200 Message-ID: <20260814100917.163448-6-thuth@redhat.com> In-Reply-To: <20260814100917.163448-1-thuth@redhat.com> References: <20260814100917.163448-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.759, 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_H2=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development 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: 1786702229761158500 vmxnet3_validate_interrupts() currently aborts via hw_error() if the guest provided bad interrupt numbers. This should not happen, QEMU should rather refuse to activate the device in this case instead. Thus propagate the error to the callers to handle it more gracefully there. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/539 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth Message-ID: <20260731113352.189066-1-thuth@redhat.com> --- hw/net/vmxnet3.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 8569484b2f2..24c551a0547 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -1336,32 +1336,46 @@ static bool vmxnet3_verify_intx(VMXNET3State *s, in= t intx) || intx =3D=3D pci_get_byte(s->parent_obj.config + PCI_INTERRUPT_P= IN) - 1; } =20 -static void vmxnet3_validate_interrupt_idx(bool is_msix, int idx) +static bool vmxnet3_validate_irq_idx(const char *type, bool is_msix, int i= dx) { int max_ints =3D is_msix ? VMXNET3_MAX_INTRS : VMXNET3_MAX_NMSIX_INTRS; + if (idx >=3D max_ints) { - hw_error("Bad interrupt index: %d\n", idx); + qemu_log_mask(LOG_GUEST_ERROR, + "vmxnet3: Bad %s queue interrupt index: %d\n", + type, idx); + return false; } + + return true; } =20 -static void vmxnet3_validate_interrupts(VMXNET3State *s) +static bool vmxnet3_validate_interrupts(VMXNET3State *s) { int i; =20 VMW_CFPRN("Verifying event interrupt index (%d)", s->event_int_idx); - vmxnet3_validate_interrupt_idx(s->msix_used, s->event_int_idx); + if (!vmxnet3_validate_irq_idx("event", s->msix_used, s->event_int_idx)= ) { + return false; + } =20 for (i =3D 0; i < s->txq_num; i++) { int idx =3D s->txq_descr[i].intr_idx; VMW_CFPRN("Verifying TX queue %d interrupt index (%d)", i, idx); - vmxnet3_validate_interrupt_idx(s->msix_used, idx); + if (!vmxnet3_validate_irq_idx("TX", s->msix_used, idx)) { + return false; + } } =20 for (i =3D 0; i < s->rxq_num; i++) { int idx =3D s->rxq_descr[i].intr_idx; VMW_CFPRN("Verifying RX queue %d interrupt index (%d)", i, idx); - vmxnet3_validate_interrupt_idx(s->msix_used, idx); + if (!vmxnet3_validate_irq_idx("RX", s->msix_used, idx)) { + return false; + } } + + return true; } =20 static bool vmxnet3_validate_queues(VMXNET3State *s) @@ -1554,7 +1568,9 @@ static void vmxnet3_activate_device(VMXNET3State *s) sizeof(s->rxq_descr[i].rxq_stats)); } =20 - vmxnet3_validate_interrupts(s); + if (!vmxnet3_validate_interrupts(s)) { + return; + } =20 /* Make sure everything is in place before device activation */ smp_wmb(); @@ -2392,7 +2408,9 @@ static int vmxnet3_post_load(void *opaque, int versio= n_id) if (!vmxnet3_validate_queues(s)) { return -1; } - vmxnet3_validate_interrupts(s); + if (!vmxnet3_validate_interrupts(s)) { + return -1; + } =20 return 0; } --=20 2.55.0 From nobody Fri Aug 28 00:12:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1786702251; cv=none; d=zohomail.com; s=zohoarc; b=BqS1N8GHhflvi7qLhHVHraFdsA8qTa05MCpSm7CFOQz8To+4XyLf3UNzCzcnRHwHY/UbrRemsrln/DCUidON/wwaNx9WaHduWxoqn2h+opN4GJuNd5r6QOZ2YtVUYaO2/6j4eWlUtenWQjkRth5v9uRVsiN9PrdZi+PHWdYsykk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786702251; h=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=weNCvrYxiG1ry/VVeRBPbdMpdQuUb6BkoTQLxb0Mqas=; b=Qr0BWv4wlzANz/GB6cfQjOzS5l6XwjWM7sqFcKjobqhPimBDz2mBFp6zSTJh/d6ancG0vHvhWE6497qay9gyDClyBSbmJFAGsFjXQo5WYZ7+gVO3Hr2aR+SRLqqUcAC90AG+UNzUKAs4i9d3CyAk0Q87DVKRcwv/1LrA0qrYAqo= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178670225190742.888507827872445; Fri, 14 Aug 2026 03:10:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuorF-0002bV-0u; Fri, 14 Aug 2026 06:09:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuor8-0002Zy-7c for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuor4-0001ij-8R for qemu-devel@nongnu.org; Fri, 14 Aug 2026 06:09:40 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-336-Ym4cSchnN3iQCUNHilpgIw-1; Fri, 14 Aug 2026 06:09:33 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3F6C71956080; Fri, 14 Aug 2026 10:09:32 +0000 (UTC) Received: from thuth-p1g4.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 01876422; Fri, 14 Aug 2026 10:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786702176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=weNCvrYxiG1ry/VVeRBPbdMpdQuUb6BkoTQLxb0Mqas=; b=HyKYou2YcmzgNFfXMocUtvPxGZmURLMbBORCpaHginr/A2vxkVKxS5KiVuGFVa6utBl2mZ +Aj8RV2BwXYrRdqHy9mwWSvKy9MVxiAWJGZJ2cUFb5WT75+DMg6GYr94zxvO1hxM1+iRfR BSl2i2zr0PiTniD9W7ZXN/Gzae5B8e8= X-MC-Unique: Ym4cSchnN3iQCUNHilpgIw-1 X-Mimecast-MFC-AGG-ID: Ym4cSchnN3iQCUNHilpgIw_1786702172 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Alejandro Jimenez Subject: [PULL 6/6] hw/i386/amd_iommu: Avoid undefined behavior in amdvi_setevent_bits() Date: Fri, 14 Aug 2026 12:09:17 +0200 Message-ID: <20260814100917.163448-7-thuth@redhat.com> In-Reply-To: <20260814100917.163448-1-thuth@redhat.com> References: <20260814100917.163448-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.759, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1786702253224158500 Content-Type: text/plain; charset="utf-8" The code in amdvi_encode_event() calls amdvi_setevent_bits() with start =3D 64: amdvi_setevent_bits(evt, addr, 64, 64); and amdvi_setevent_bits() then calculates: uint64_t mask =3D MAKE_64BIT_MASK(start, length); but this MAKE_64BIT_MASK() macro shifts a value left by "start" bit positions. Shifting left by more than 63 is undefined behavior and could have unexpected results with different compilers / architectures. Fix it by using "bitpos" instead, which was likely the original intended behavior anyway. (bitpos is calculated as bitpos =3D start % 64). Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3633 Fixes: 1d5b128cbeea ("hw/iommu: Fix problems reported by Coverity scan") Reviewed-by: Alejandro Jimenez Signed-off-by: Thomas Huth Message-ID: <20260731140229.259272-1-thuth@redhat.com> --- hw/i386/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 90252c52af4..578c27ccbef 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -323,7 +323,7 @@ static void amdvi_setevent_bits(uint64_t *buffer, uint6= 4_t value, int start, int length) { int index =3D start / 64, bitpos =3D start % 64; - uint64_t mask =3D MAKE_64BIT_MASK(start, length); + uint64_t mask =3D MAKE_64BIT_MASK(bitpos, length); buffer[index] &=3D ~mask; buffer[index] |=3D (value << bitpos) & mask; } --=20 2.55.0