[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b1fe0df0-efee-4940-9865-8bcabcd5809e@linux.microsoft.com>
Date: Fri, 21 Mar 2025 09:49:53 -0700
From: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>,
Dexuan Cui <decui@...rosoft.com>,
Praveen K Paladugu <prapal@...ux.microsoft.com>,
Roman Kisel <romank@...ux.microsoft.com>,
Jinank Jain <jinankjain@...rosoft.com>,
Mukesh Rathor <mrathor@...ux.microsoft.com>, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH next] Drivers: hv: mshv: Fix uninitialize variable in
mshv_ioctl_passthru_hvcall()
On 3/21/2025 7:35 AM, Dan Carpenter wrote:
> The "ret" variable could be uninitialized on the success path depending
> on if "is_async" is true of false. Initialized it to zero.
>
> Fixes: f5288d14069b ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
> drivers/hv/mshv_root_main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c
> index 29fa6d5a3994..b94d8fe0f691 100644
> --- a/drivers/hv/mshv_root_main.c
> +++ b/drivers/hv/mshv_root_main.c
> @@ -151,13 +151,14 @@ static int mshv_ioctl_passthru_hvcall(struct mshv_partition *partition,
> void __user *user_args)
> {
> u64 status;
> - int ret, i;
> bool is_async;
> struct mshv_root_hvcall args;
> struct page *page;
> unsigned int pages_order;
> void *input_pg = NULL;
> void *output_pg = NULL;
> + int ret = 0;
> + int i;
>
> if (copy_from_user(&args, user_args, sizeof(args)))
> return -EFAULT;
Thanks Dan, I already sent a fixup for this:
https://lore.kernel.org/linux-hyperv/1742492693-21960-1-git-send-email-nunodasneves@linux.microsoft.com/
Powered by blists - more mailing lists