From nobody Sun Jul 26 11:01:59 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=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1782913349; cv=none; d=zohomail.com; s=zohoarc; b=JRXcGoKhLEpIMemqPce7l6W3X29fUyX6KjLqmWQHKwomszhozFMN/XVulTd9C5fHtjrWkv1mUrleQ1rDgWbnKZ5itMl3SFxnbxwyKbzRR6c3dDlQoJeE7iAXEhKp4yr7IPAjv51V1bki26aRJ4LymKgYd08emZYqmcmTUS8ScGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1782913349; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kVz1zZt/CMMZD1+uAdeBculce4IuSuzbOoL09L0x5TI=; b=OAGJF5/RGEOEu3c/G9apcpF5tFHXozAUzun7+WmUWmQBLkDFX5a0dnB/t9ovfH7ZbkOWgVZ1yYASClyep23t2RXbjCZQhgaqw4dvCkXbDUVx3aA5yXCdZ4FERgQhQDnmOMpLrswxUH5uBfkjcqXU6M9lvXGXze/uUgJsnGHTJsA= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1782913349519998.7176773081076; Wed, 1 Jul 2026 06:42:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wevCq-0004dT-8r; Wed, 01 Jul 2026 09:42:24 -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 1wevCp-0004ar-1H for qemu-devel@nongnu.org; Wed, 01 Jul 2026 09:42:23 -0400 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wevCn-0005Vy-Bg for qemu-devel@nongnu.org; Wed, 01 Jul 2026 09:42:22 -0400 Received: from DESKTOP-TUU1E5L.localdomain (unknown [167.220.208.73]) by linux.microsoft.com (Postfix) with ESMTPSA id 7B77C20B7166; Wed, 1 Jul 2026 06:42:16 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7B77C20B7166 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1782913338; bh=kVz1zZt/CMMZD1+uAdeBculce4IuSuzbOoL09L0x5TI=; h=From:To:Cc:Subject:Date:From; b=I/7yYIdxB4gJoyUAs36KWz0ENQclbXatT5szLZKs4JtUA0roE29K5Z27xX3MFi+DH qOSkyNPeWzoNq+9c2oqHuG6Bxx4Hp4TRDiuqnZSWq2xsJfTwjLLwn8AcCr1GZgnVsP hkhP6/Ntvu1iYH+vKYUYeC0ORWFx3++YFUoxPSIM= From: Magnus Kulke To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= , Magnus Kulke , Peter Maydell , =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= , Wei Liu , Wei Liu , Magnus Kulke Subject: [PATCH] target/i386/mshv: zero-init msr hvcall args Date: Wed, 1 Jul 2026 15:42:14 +0200 Message-Id: <20260701134214.419806-1-magnuskulke@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=13.77.154.182; envelope-from=magnuskulke@linux.microsoft.com; helo=linux.microsoft.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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 @linux.microsoft.com) X-ZM-MESSAGEID: 1782913350304158500 Content-Type: text/plain; charset="utf-8" In the current code we leave the argument arrays for the get/set hvcall unitialized, setting only individual fields. some fields will be populated during the hvcall, but in any case the arg arrays will contain unitialized data (e.g. in reserved fields), to which static analysis objects to. Fixes: c38eb12c85 Signed-off-by: Magnus Kulke Reviewed-by: Doru Bl=C3=A2nzeanu Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/mshv/msr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/mshv/msr.c b/target/i386/mshv/msr.c index 8c220a9942..a35415ed9d 100644 --- a/target/i386/mshv/msr.c +++ b/target/i386/mshv/msr.c @@ -326,7 +326,7 @@ int mshv_get_msrs(CPUState *cpu) { int ret =3D 0; size_t n_assocs =3D MSHV_MSR_TOTAL_COUNT; - struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT]; + struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT] =3D { 0 }; size_t i, j; uint32_t name; =20 @@ -386,7 +386,7 @@ static void load_from_env(const CPUState *cpu, struct h= v_register_assoc *assocs, int mshv_set_msrs(const CPUState *cpu) { size_t n_assocs =3D MSHV_MSR_TOTAL_COUNT; - struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT]; + struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT] =3D { 0 }; int ret; size_t i, j; =20 --=20 2.34.1