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

Re: [RFC PATCH 1/7] xeniface: Avoid accessing grant IRPs after they are pended


  • To: Rafał Wojdyła <omeg@xxxxxxxxxxxxxxxxxxxxxx>, win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Sat, 21 Nov 2026 13:52:03 +0100
  • 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:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Cc: Rafał Wojdyła <omeg@xxxxxxx>
  • Delivery-date: Sat, 21 Nov 2026 12:52:13 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 10/11/2026 19:36, Rafał Wojdyła wrote:
> From: Rafał Wojdyła <omeg@xxxxxxx>
> 
> A cancel-safe queue can hand a pending grant request to its cancellation
> worker before the IOCTL handler returns. Only set IoStatus and complete the
> IRP when the handler did not return STATUS_PENDING, avoiding an access after
> another path has completed the request.
> 
> Assisted-by: LLM
> Signed-off-by: Rafał Wojdyła <omeg@xxxxxxxxxxxxxxxxxxxxxx>

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

> ---
>   src/xeniface/ioctls.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/xeniface/ioctls.c b/src/xeniface/ioctls.c
> index f9c959e..3d55d5a 100644
> --- a/src/xeniface/ioctls.c
> +++ b/src/xeniface/ioctls.c
> @@ -374,10 +374,11 @@ XenIfaceIoctl(
>   
>   done:
>   
> -    Irp->IoStatus.Status = status;
> -
> -    if (status != STATUS_PENDING)
> +    // A pending request can already belong to a cancellation/cleanup worker.
> +    if (status != STATUS_PENDING) {
> +        Irp->IoStatus.Status = status;
>           IoCompleteRequest(Irp, IO_NO_INCREMENT);
> +    }
>   
>       return status;
>   }



--
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®.