From nobody Tue Feb 10 01:15:56 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=philmd@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=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639843770; cv=none; d=zohomail.com; s=zohoarc; b=NG6rzL5aTY7WrQEf9haOEd34QyIQNdawMdhbnTdTPSeUQ3wBqriVDVQDq7UVRLU5H4qRmiM7xsxWvQxuHwAXPfkF9/DkgSGBMJrxsUMeTfOFC7UHlB3bu6qklF1OzSlRRgiGx3d4JifqeSxmRu1y7ZzXXAB/e+CUXtcXDPd6hb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639843770; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=lm+2VsrdWbkYCrKuR4VdYcv+nYRPOsvJEvTZMZQRV2Y=; b=jdU+dq63lLggBCD12tq0HyG/VptdkCel9cxmwMmjeHs5FvoiBQSVbmRP77TNUIXK/zVW3hajTwQSHbJn454ZRlPjBxvseGk1DFEjx9Ta9D02aTW8h/zAP3tdMUFtvTDXOtX3+XmR+rZVuyJe8xhCg28DqDRdPVm72/ucSYZsGCg= 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=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1639843770831521.534548750051; Sat, 18 Dec 2021 08:09:30 -0800 (PST) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-139-_-w73lf-NC2pTowXFzn6zA-1; Sat, 18 Dec 2021 11:09:26 -0500 Received: by mail-wr1-f70.google.com with SMTP id t30-20020adfa2de000000b001a24004e1fbso1553172wra.10 for ; Sat, 18 Dec 2021 08:09:26 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (174.red-83-50-185.dynamicip.rima-tde.net. [83.50.185.174]) by smtp.gmail.com with ESMTPSA id n14sm12592890wrf.69.2021.12.18.08.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Dec 2021 08:09:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639843769; 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=lm+2VsrdWbkYCrKuR4VdYcv+nYRPOsvJEvTZMZQRV2Y=; b=LJk43c5q8vi5/C7+hL6ud8YDahyRQjLrW1syVvxDFSullb2PTqUDjnFCFeDydHOUIU/rNH Fe2MfLQkuFP45hTxRU4WLNLatMoGlf3Pe0mBPstHMMmXmDLFXSmzAF8STsa2Cbo+vHVRnJ exasQ7+XI1Ay2giJ+yjFPtF/fGPUPSQ= X-MC-Unique: _-w73lf-NC2pTowXFzn6zA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lm+2VsrdWbkYCrKuR4VdYcv+nYRPOsvJEvTZMZQRV2Y=; b=WrySH7HrJeW9Kg/JMr3Qf3TVB7tjQJFENba1/JBIbAe6sethLfzXsV4Wb2CsCA9ZoE l/sJSewoG1ecigJ5Y9ZAYi++5zQmojJEBBhjAzZzm9qX25c9VPGeEUVfUpTs+VZ9PGBR vJ4S2wBNgXbFj/m93oQOQGQ9cxgnrrVyqPbj9PpRnI/WrvgbDrglhpu0ZOqPhaVIEexm zU2qUj0q5NVxv25onRNS1pbMtrDMjvdTwcs9n/ei+DQD/LTNmMO3COPYY5FeDt6YKZOu xQQQHm40UOfVNYf9JdCfp+y1c6SuqbbmUcN07gaw7E1xyukflkXm95O+L+1n3/JFSumg VwaQ== X-Gm-Message-State: AOAM531yaRbdi6Us6638z7vcd4S7fkco4QS1045RCsBcl8UQCf+QIEs3 ggmckmOOIL25+R2G/mB3J4Ls4Gn/wZ8EfYzyb/qWhxxV+iyrs6ZjDzFy8J4ZRpmz3WVi2VCScbg 0saT6CnzEZo0ezg== X-Received: by 2002:a1c:ed18:: with SMTP id l24mr14300478wmh.99.1639843765465; Sat, 18 Dec 2021 08:09:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpIma0FuFr5JTICHr7wNGKHr9Iab9Z1P81sMyy5GzyOWGYrxYrYfy3H2ujCfeZEWs7/X/aGw== X-Received: by 2002:a1c:ed18:: with SMTP id l24mr14300465wmh.99.1639843765253; Sat, 18 Dec 2021 08:09:25 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Laurent Vivier , Jon Maloy , crazybyte@protonmail.com, Thomas Huth , Gianluca Gabruelli , Mauro Matteo Cascella , Matt Parker , Alexander Bulekov , Paolo Bonzini , Qiuhao Li , Gerd Hoffmann , Martin Schrodt , Li Qiang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 2/3] hw/audio/intel-hda: Restrict DMA engine to memories (not MMIO devices) Date: Sat, 18 Dec 2021 17:09:11 +0100 Message-Id: <20211218160912.1591633-3-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211218160912.1591633-1-philmd@redhat.com> References: <20211218160912.1591633-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639843773375100001 Issue #542 reports a reentrancy problem when the DMA engine accesses the HDA controller I/O registers. Fix by restricting the DMA engine to memories regions (forbidding MMIO devices such the HDA controller). Reported-by: OSS-Fuzz (Issue 28435) Reported-by: Alexander Bulekov Resolves: https://gitlab.com/qemu-project/qemu/-/issues/542 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- Likely intel_hda_xfer() and intel_hda_corb_run() should be restricted too. --- hw/audio/intel-hda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 0c1017edbbf..3aa57d274e6 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -345,7 +345,7 @@ static void intel_hda_corb_run(IntelHDAState *d) =20 static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32= _t response) { - const MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; + const MemTxAttrs attrs =3D { .memory =3D true }; HDACodecBus *bus =3D HDA_BUS(dev->qdev.parent_bus); IntelHDAState *d =3D container_of(bus, IntelHDAState, codecs); hwaddr addr; --=20 2.33.1