From nobody Mon Feb 9 04:03:23 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=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1678111396; cv=none; d=zohomail.com; s=zohoarc; b=Y8xuK2wJUQUL8zHSbce2sLNj0xW+Ni5o0pJOD6AZPj7XhIZh2BtVqmHwnCZlQQEgdHSADPEifEdk6j5IinYZBVmPqeH+IY+3OPW9zPyOQkpOvVKxI9NdPa7jWpBI3bSXQC3wYir43X2TSqyEFvlihll7RfxAx78AzoK3GLnsHRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678111396; 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:Reply-To:References:Sender:Subject:To; bh=U3eWGrFh/8n8UwX2BP1T9+0n7x4DFNDosh04doAgT1I=; b=XFsAjSc/WdNflerjgtJP/oNN7SIMII1yiZIjH9MBTI3C9iSiF8a/0N2nLzb5m0ocXfmKoMxv7aVseOarHUmPSb6ul3rXXP8UCK7o/83CwyBPdpERIIMwyDLnjYNhnDFcQ8bRHxdxAy2J4QzIZKEm8rmYg0QRBj1dFcbeO/Moff8= 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=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 1678111396293551.9016207684268; Mon, 6 Mar 2023 06:03:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZBQ0-000163-BH; Mon, 06 Mar 2023 09:02:24 -0500 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 1pZBPn-0000ya-HA for qemu-devel@nongnu.org; Mon, 06 Mar 2023 09:02:17 -0500 Received: from esa1.hc3370-68.iphmx.com ([216.71.145.142]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZBPl-0006ad-BL for qemu-devel@nongnu.org; Mon, 06 Mar 2023 09:02:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678111329; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xqbhbmVsgYeksMRIYxPoEYSellA1egwE3nLd6Vki9DY=; b=bSXCiGkeymlGl07jzhe8BW+yDCTYOfNhJFV/GgBFSdOzUZI9obtdZqj0 ofaQK9BcNmJY0u/mbwILrM8gsEvVUzKkuoToAcSOhVHHsyJ0U8MGvQuae Bcdt0d3FfbzOjj4ye3xDm2/eqHWOSoi+9d6cZw8ZukkEY7mpdxfX3VBRh E=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100081144 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:RQfnka7AcQGgWA5ctePcfAxRtDDHchMFZxGqfqrLsTDasY5as4F+v jBOW2CHOKrZMDekL9ojaNyz8kIF6JeGmtc2QFdvqHpjHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5m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fNcyL clU4UWMqyWMbGit7eZ3OBvKadE/OW6 X-IronPort-AV: E=Sophos;i="5.98,238,1673931600"; d="scan'208";a="100081144" To: CC: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD Subject: [PULL 2/2] hw/xen/xen_pt: fix uninitialized variable Date: Mon, 6 Mar 2023 14:00:44 +0000 Message-ID: <20230306140044.44076-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230306140044.44076-1-anthony.perard@citrix.com> References: <20230306140044.44076-1-anthony.perard@citrix.com> MIME-Version: 1.0 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.71.145.142; envelope-from=prvs=4224746ab=anthony.perard@citrix.com; helo=esa1.hc3370-68.iphmx.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Anthony PERARD From: Anthony PERARD via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1678111530847100001 From: Marek Marczykowski-G=C3=B3recki xen_pt_config_reg_init() reads only that many bytes as the size of the register that is being initialized. It uses xen_host_pci_get_{byte,word,long} and casts its last argument to expected pointer type. This means for smaller registers higher bits of 'val' are not initialized. Then, the function fails if any of those higher bits are set. Fix this by initializing 'val' with zero. Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Stefano Stabellini Message-Id: <20230127050815.4155276-1-marmarek@invisiblethingslab.com> Signed-off-by: Anthony PERARD --- hw/xen/xen_pt_config_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index cde898b744..8b9b554352 100644 --- a/hw/xen/xen_pt_config_init.c +++ b/hw/xen/xen_pt_config_init.c @@ -1924,7 +1924,7 @@ static void xen_pt_config_reg_init(XenPCIPassthroughS= tate *s, if (reg->init) { uint32_t host_mask, size_mask; unsigned int offset; - uint32_t val; + uint32_t val =3D 0; =20 /* initialize emulate register */ rc =3D reg->init(s, reg_entry->reg, --=20 Anthony PERARD