All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Doru Blânzeanu" <dblanzeanu@linux.microsoft.com>
To: Magnus Kulke <magnuskulke@linux.microsoft.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Doru Blânzeanu" <doru.blanzeanu@microsoft.com>,
	"Magnus Kulke" <magnuskulke@microsoft.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Wei Liu" <liuwe@microsoft.com>, "Wei Liu" <wei.liu@kernel.org>
Subject: Re: [PATCH] target/i386/mshv: zero-init msr hvcall args
Date: Thu, 2 Jul 2026 16:50:44 +0300	[thread overview]
Message-ID: <akZstNFMGpCmJDDO@linux.microsoft.com> (raw)
In-Reply-To: <20260701134214.419806-1-magnuskulke@linux.microsoft.com>

On Wed, Jul 01, 2026 at 03:42:14PM +0200, Magnus Kulke wrote:
> 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 <magnuskulke@linux.microsoft.com>
> ---
>  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 = 0;
>      size_t n_assocs = MSHV_MSR_TOTAL_COUNT;
> -    struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT];
> +    struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT] = { 0 };
>      size_t i, j;
>      uint32_t name;
>  
> @@ -386,7 +386,7 @@ static void load_from_env(const CPUState *cpu, struct hv_register_assoc *assocs,
>  int mshv_set_msrs(const CPUState *cpu)
>  {
>      size_t n_assocs = MSHV_MSR_TOTAL_COUNT;
> -    struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT];
> +    struct hv_register_assoc assocs[MSHV_MSR_TOTAL_COUNT] = { 0 };
>      int ret;
>      size_t i, j;
>  
> -- 
> 2.34.1

Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com>


      parent reply	other threads:[~2026-07-02 13:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 13:42 [PATCH] target/i386/mshv: zero-init msr hvcall args Magnus Kulke
2026-07-01 14:11 ` Philippe Mathieu-Daudé
2026-07-02 13:50 ` Doru Blânzeanu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=akZstNFMGpCmJDDO@linux.microsoft.com \
    --to=dblanzeanu@linux.microsoft.com \
    --cc=doru.blanzeanu@microsoft.com \
    --cc=liuwe@microsoft.com \
    --cc=magnuskulke@linux.microsoft.com \
    --cc=magnuskulke@microsoft.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.