From: vdso@mailbox.org
To: Anirudh Rayabharam <anirudh@anirudhrb.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com, longli@microsoft.com,
decui@microsoft.com, wei.liu@kernel.org,
linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] mshv: release mutex on region invalidation failure
Date: Tue, 16 Dec 2025 07:14:40 -0800 (PST) [thread overview]
Message-ID: <912772765.178375.1765898080667@app.mailbox.org> (raw)
In-Reply-To: <20251216142030.4095527-4-anirudh@anirudhrb.com>
> On 12/16/2025 6:20 AM Anirudh Rayabharam <anirudh@anirudhrb.com> wrote:
>
>
> From: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
>
> In the region invalidation failure path in
> mshv_region_interval_invalidate(), the region mutex is not released. Fix
> it by releasing the mutex in the failure path.
>
> Signed-off-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Reviewed-by: Roman Kisel <vdso@mailbox.org>
> ---
> drivers/hv/mshv_regions.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hv/mshv_regions.c b/drivers/hv/mshv_regions.c
> index 8abf80129f9b..30bacba6aec3 100644
> --- a/drivers/hv/mshv_regions.c
> +++ b/drivers/hv/mshv_regions.c
> @@ -511,7 +511,7 @@ static bool mshv_region_interval_invalidate(struct mmu_interval_notifier *mni,
> ret = mshv_region_remap_pages(region, HV_MAP_GPA_NO_ACCESS,
> page_offset, page_count);
> if (ret)
> - goto out_fail;
> + goto out_unlock;
>
> mshv_region_invalidate_pages(region, page_offset, page_count);
>
> @@ -519,6 +519,8 @@ static bool mshv_region_interval_invalidate(struct mmu_interval_notifier *mni,
>
> return true;
>
> +out_unlock:
> + mutex_unlock(®ion->mutex);
> out_fail:
> WARN_ONCE(ret,
> "Failed to invalidate region %#llx-%#llx (range %#lx-%#lx, event: %u, pages %#llx-%#llx, mm: %#llx): %d\n",
> --
> 2.34.1
next prev parent reply other threads:[~2025-12-16 15:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 14:20 [PATCH 0/3] Fixes for movable pages Anirudh Rayabharam
2025-12-16 14:20 ` [PATCH 1/3] hyperv: add definitions for arm64 gpa intercepts Anirudh Rayabharam
2025-12-16 15:07 ` vdso
2025-12-17 5:08 ` Anirudh Rayabharam
2025-12-17 5:46 ` vdso
2025-12-18 20:06 ` Wei Liu
2025-12-16 14:20 ` [PATCH 2/3] mshv: handle gpa intercepts for arm64 Anirudh Rayabharam
2025-12-16 16:11 ` Stanislav Kinsburskii
2025-12-17 5:10 ` Anirudh Rayabharam
2025-12-16 14:20 ` [PATCH 3/3] mshv: release mutex on region invalidation failure Anirudh Rayabharam
2025-12-16 15:14 ` vdso [this message]
2025-12-16 16:18 ` Stanislav Kinsburskii
2025-12-18 20:01 ` Wei Liu
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=912772765.178375.1765898080667@app.mailbox.org \
--to=vdso@mailbox.org \
--cc=anirudh@anirudhrb.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longli@microsoft.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox