From: sashiko-bot@kernel.org
To: "Thara Gopinath" <tgopinath@linux.microsoft.com>
Cc: linux-hyperv@vger.kernel.org
Subject: Re: [RFC PATCH 11/12] drivers: hv: hv_vsm_boot: Boot primary processor in VTL1
Date: Tue, 01 Sep 2026 17:35:13 +0000 [thread overview]
Message-ID: <20260901173513.ABCF51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260901165647.3160413-12-tgopinath@linux.microsoft.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Ignored error status from VTL1 boot handshake allows the system to continue in an insecure state, bypassing a security-critical kernel panic.
--
commit 91cb8ed727ae4b19c3d3be7dbd03c34def48f245
Author: Thara Gopinath <tgopinath@linux.microsoft.com>
drivers: hv: hv_vsm_boot: Boot primary processor in VTL1
This commit introduces the final step of the primary-CPU bring-up to
transition into VTL1 and start executing the secure kernel. It issues
the first vtlcall on the primary CPU to pass initialization arguments.
It also adds a check to see if Mode-Based Execution Control (MBEC) is
enabled after booting into VTL1.
> diff --git a/drivers/hv/hv_vsm_boot.c b/drivers/hv/hv_vsm_boot.c
> index abe82e03e1897..c4f15c42df1f6 100644
> --- a/drivers/hv/hv_vsm_boot.c
> +++ b/drivers/hv/hv_vsm_boot.c
[ ... ]
> +static int __init hv_vsm_boot_vtl1(void)
> +{
> + struct hv_vtlcall_param args = {0};
> + u16 vp_enabled_vtl_set = 0;
> + u8 active_mbec_enabled = 0;
> + int ret;
> + s64 sk_status;
> +
> + args.a0 = num_possible_cpus();
> + args.a1 = sk_res.start;
> + args.a2 = resource_size(&sk_res);
> +
> + /* Kick start vtl1 boot on the primary cpu. */
> + sk_status = hv_vsm_vtlcall(&args);
> + if (sk_status)
> + pr_warn("VTL1 boot returned status %lld\n", sk_status);
> +
> + ret = hv_vsm_get_vp_status(&vp_enabled_vtl_set, &active_mbec_enabled);
> + if (ret)
> + return ret;
> +
> + if (!active_mbec_enabled) {
> + pr_err("Failed to enable MBEC for VP0\n");
> + hv_vsm_mbec_enabled = false;
> + }
> + return 0;
> +}
^^^^
[Severity: High]
Does this code silently ignore a VTL1 boot failure?
If hv_vsm_vtlcall() returns a non-zero error in sk_status, this function
merely logs a warning and proceeds to call hv_vsm_get_vp_status().
If hv_vsm_get_vp_status() succeeds despite the VTL1 boot failure,
hv_vsm_boot_vtl1() will return 0, because vp_enabled_vtl_set is never
validated to confirm VTL1 actually booted.
This could allow the system to continue by bypassing failure handling in the
caller. If VTL1 setup fails, could the partition be left in an exposed state
where an attacker might race to configure VTL1 themselves and gain a
higher-privilege foothold than VTL0?
Should this return an error code when hv_vsm_vtlcall() fails?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260901165647.3160413-1-tgopinath@linux.microsoft.com?part=11
next prev parent reply other threads:[~2026-09-01 17:35 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 16:55 [RFC PATCH 00/12] Introduce LVBS support for Hyper-V guests Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 01/12] drivers: hv: Add HYPERV_VSM kconfig option Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 02/12] drivers: hv: hv_common: Allocate Hyper-V output arg page when VSM is enabled Thara Gopinath
2026-09-01 17:12 ` sashiko-bot
2026-09-01 22:56 ` Wei Liu
2026-09-01 16:55 ` [RFC PATCH 03/12] drivers: hv: Reserve memory for VSM secure kernel during early boot Thara Gopinath
2026-09-01 17:10 ` sashiko-bot
2026-09-02 0:59 ` Wei Liu
2026-09-02 13:38 ` Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 04/12] firmware: efi: libstub: x86-stub: Enable VSM awareness in efi os indications variable Thara Gopinath
2026-09-01 17:09 ` sashiko-bot
2026-09-02 1:09 ` Wei Liu
2026-09-02 14:23 ` Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 05/12] include: hyperv: hvgdk_mini.h: Add VTL-specific structures and bits Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 06/12] drivers: hv: Add VSM boot driver and enable VTL1 at the partition level Thara Gopinath
2026-09-01 17:24 ` sashiko-bot
2026-09-02 1:16 ` Wei Liu
2026-09-02 14:28 ` Thara Gopinath
2026-09-02 4:43 ` Wei Liu
2026-09-04 13:23 ` Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 07/12] drivers: hv: hv_vsm_boot: load secure kernel image from firmware Thara Gopinath
2026-09-01 17:20 ` sashiko-bot
2026-09-02 4:37 ` Wei Liu
2026-09-02 16:22 ` Thara Gopinath
2026-09-02 22:58 ` Wei Liu
2026-09-01 16:55 ` [RFC PATCH 08/12] arch: x86: hyperv: Build initial vCPU context for VTL1 secure kernel Thara Gopinath
2026-09-01 17:25 ` sashiko-bot
2026-09-01 16:55 ` [RFC PATCH 09/12] drivers: hv: hv_vsm_boot: Enable VTL1 on the boot processor Thara Gopinath
2026-09-01 17:36 ` sashiko-bot
2026-09-01 16:55 ` [RFC PATCH 10/12] arch: x86: hyperv: hv_vtl_vsm: Introduce vtlcall Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 11/12] drivers: hv: hv_vsm_boot: Boot primary processor in VTL1 Thara Gopinath
2026-09-01 17:35 ` sashiko-bot [this message]
2026-09-01 16:55 ` [RFC PATCH 12/12] drivers: hv: hv_vsm_boot: Boot secondary processors " Thara Gopinath
2026-09-01 17:44 ` sashiko-bot
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=20260901173513.ABCF51F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tgopinath@linux.microsoft.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox