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

Re: [PATCH] Check Fragment is non-null


  • To: Owen Smith <owen.smith@xxxxxxxxxx>, win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Wed, 22 Apr 2026 13:49:34 +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: Wed, 22 Apr 2026 11:49:42 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 22/04/2026 11:30, Owen Smith wrote:
> When processing a response, the id value should indicate the index into
> the Pending array, of the relevant Fragment. In some situations, its
> possible that the Pending array entry has already been NULLed, likely
> due to a backend inserted response coinciding with a frontend faked
> response. If the Fragment returned from the Pending array is NULL, then
> any attempt to access this NULL Fragment will result in a bugcheck.
> Skip any responses where the related Pending entry has already been NULLed.
> 
> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>

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

Thanks,

NB: IMO while we're not faking receiver responses, we may eventually 
need a similar adjustment in ReceiverRingPoll and some other places 
given that a backend can give out bogus IDs.

> ---
>   src/xenvif/transmitter.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
> index 0f7deb1..58f8575 100644
> --- a/src/xenvif/transmitter.c
> +++ b/src/xenvif/transmitter.c
> @@ -2525,7 +2525,9 @@ TransmitterRingPoll(
>               Fragment = Ring->Pending[id];
>               Ring->Pending[id] = NULL;
>   
> -            ASSERT(Fragment != NULL);
> +            if (Fragment == NULL)
> +                continue;
> +
>               ASSERT3U(Fragment->Id, ==, id);
>   
>               switch (Fragment->Type) {



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