mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Yuho Choi <oss.patchbox@gmail.com>
Cc: Wei Liu <wei.liu@kernel.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Dexuan Cui <decui@microsoft.com>,
	Nuno Das Neves <nunodasneves@linux.microsoft.com>,
	Easwar Hariharan <easwar.hariharan@linux.microsoft.com>,
	Praveen K Paladugu <prapal@linux.microsoft.com>,
	Tianyu Lan <tiala@microsoft.com>,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] mshv: Don't free overlay pages after a failed unmap
Date: Mon, 2 Nov 2026 16:48:20 -0800	[thread overview]
Message-ID: <20261103004820.GA1862133@liuwe-devbox-debian-v2.local> (raw)
In-Reply-To: <20261102025754.257856-2-oss.patchbox@gmail.com>

On Sun, Nov 01, 2026 at 09:57:42PM -0500, Yuho Choi wrote:
> On L1VH partitions where the VMM can provide overlay GPFNs, the kernel
> allocates the VP state and stats pages and supplies them to the
> hypervisor as overlay locations through hv_map_vp_state_page() and
> hv_map_stats_page(). The hypervisor may write intercept messages,
> register state, and statistics to these pages. Only a successful
> HVCALL_UNMAP_VP_STATE_PAGE or HVCALL_UNMAP_STATS_PAGE confirms that the
> corresponding overlay has been revoked.
> 
> hv_unmap_vp_state_page() and hv_unmap_stats_page() free the overlay
> page regardless of the hypercall result. If the unmap fails, revocation
> is unconfirmed, but dropping the driver's page reference may still
> allow the page to be returned to the allocator and reused. A subsequent
> hypervisor write through a retained overlay could then corrupt an
> unrelated kernel or user allocation.
> 
> Free an overlay page only after the unmap hypercall succeeds. On failure,
> leak the page rather than return memory that the hypervisor may still be
> able to access. This matches how the rest of drivers/hv handles pages
> whose state is unknown after a failed hypervisor operation; for example,
> hv_free_page() leaks a page that could not be re-encrypted. Log the
> leaked page in both helpers, as some of their callers discard the
> return value.
> 
> Fixes: 19c515c27cee ("mshv: Allocate vp state page for HVCALL_MAP_VP_STATE_PAGE on L1VH")
> Fixes: d62313bdf596 ("mshv: Introduce new hypercall to map stats page for L1VH partitions")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>

Applied. Thanks.

      reply	other threads:[~2026-11-03  0:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02  2:57 Yuho Choi
2026-11-03  0:48 ` Wei Liu [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=20261103004820.GA1862133@liuwe-devbox-debian-v2.local \
    --to=wei.liu@kernel.org \
    --cc=decui@microsoft.com \
    --cc=easwar.hariharan@linux.microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nunodasneves@linux.microsoft.com \
    --cc=oss.patchbox@gmail.com \
    --cc=prapal@linux.microsoft.com \
    --cc=stable@vger.kernel.org \
    --cc=tiala@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

all inboxes | Powered by JetHome®