|
[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
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |