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

Re: [PATCH 1/3] xenbus/dma: fail on unknown DMA operations version


  • To: david ambu <david.preetham@xxxxxxxxxx>, win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Fri, 11 Sep 2026 00:20:51 +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: Thu, 10 Sep 2026 22:20:59 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 10/09/2026 18:13, david ambu wrote:
> Return STATUS_NOT_SUPPORTED instead of ASSERT(FALSE) when an unknown
> DMA operations size is encountered, preventing copy with unvalidated size.
> 
> Assisted-by: ClaudeCode:claude-sonnet-4-6
> Signed-off-by: david ambu <david.preetham@xxxxxxxxxx>

I'm not too familiar with this code but it looks OK at first glance.

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

> ---
>   src/xenbus/dma.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/xenbus/dma.c b/src/xenbus/dma.c
> index 206143e..07d4540 100644
> --- a/src/xenbus/dma.c
> +++ b/src/xenbus/dma.c
> @@ -1657,7 +1657,10 @@ DmaGetAdapter(
>           break;
>   
>       default:
> -        ASSERT(FALSE);
> +        Error("Unknown DMA operations size %lu\n",
> +              Context->LowerOperations->Size);
> +        status = STATUS_NOT_SUPPORTED;
> +        goto fail3;
>       }
>   
>       // Copy in the requisite number of operations
> @@ -1688,6 +1691,11 @@ DmaGetAdapter(
>   done:
>       return Adapter;
>   
> +fail3:
> +    Error("fail3\n");
> +
> +    DmaDestroyContext(Context);
> +
>   fail2:
>       Error("fail2\n");
>   



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