[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 01/10] xeniface: fix NULL KernelVa dereference in GnttabFreeGrant notify


  • To: david ambu <david.preetham@xxxxxxxxxx>, win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Tue, 13 Oct 2026 14:40:25 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Delivery-date: Tue, 13 Oct 2026 12:40:31 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 08/10/2026 14:05, david ambu wrote:
> For V2 grants with user-supplied memory, KernelVa is NULL.
> Fall back to UserVa for the notify offset write in that case.
> 
> Signed-off-by: david ambu <david.preetham@xxxxxxxxxx>
> Assisted by Claude Sonnet 4.6

Entire series except Patch 10:

Reviewed-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>

Since Patch 10 is still under discussion, IMO we can hold back that 
patch alone and commit the remaining 9 to make sure that we have the 
necessary driver fixes.

> ---
>   src/xeniface/ioctl_gnttab.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/src/xeniface/ioctl_gnttab.c b/src/xeniface/ioctl_gnttab.c
> index 770f0dc..35767a2 100644
> --- a/src/xeniface/ioctl_gnttab.c
> +++ b/src/xeniface/ioctl_gnttab.c
> @@ -482,7 +482,17 @@ GnttabFreeGrant(
>       ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
>   
>       if (Context->Flags & XENIFACE_GNTTAB_USE_NOTIFY_OFFSET) {
> -        ((PCHAR)Context->KernelVa)[Context->NotifyOffset] = 0;
> +        if (Context->KernelVa != NULL) {
> +            ((PCHAR)Context->KernelVa)[Context->NotifyOffset] = 0;
> +        } else {
> +#pragma prefast(suppress:6320)
> +            try {
> +                ((PCHAR)Context->UserVa)[Context->NotifyOffset] = 0;
> +            } except(EXCEPTION_EXECUTE_HANDLER) {
> +                Error("Failed to write notify offset 0x%x: 0x%x\n",
> +                      Context->NotifyOffset, GetExceptionCode());
> +            }
> +        }
>       }
>   
>       if (Context->Flags & XENIFACE_GNTTAB_USE_NOTIFY_PORT) {



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.