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

Re: [PATCH 4/5] xeniface: Size converted MAP_FOREIGN_PAGES input with the V2 header


  • To: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>, win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Tue, 20 Oct 2026 14:22:14 +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, 20 Oct 2026 12:22:20 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 20/10/2026 13:55, Césaire Mounah wrote:
> The legacy IOCTL_XENIFACE_GNTTAB_MAP_FOREIGN_PAGES input is converted
> into a XENIFACE_GNTTAB_MAP_FOREIGN_PAGES_IN_V2 buffer, but that buffer
> was sized with the V1 header, which also holds RequestId. This
> over-allocated it by 4 bytes. Use the V2 header size.
> 
> Assisted-by: Claude:Opus-5.5
> Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>

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

> ---
>   src/xeniface/ioctl_gnttab.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/xeniface/ioctl_gnttab.c b/src/xeniface/ioctl_gnttab.c
> index 8256012..c6d82bc 100644
> --- a/src/xeniface/ioctl_gnttab.c
> +++ b/src/xeniface/ioctl_gnttab.c
> @@ -676,7 +676,7 @@ IoctlGnttabMapForeignPages(
>           // legacy IOCTL, convert the input to v2
>           status = STATUS_NO_MEMORY;
>           In = __AllocatePoolWithTag(NonPagedPool,
> -                                   
> (ULONG)FIELD_OFFSET(XENIFACE_GNTTAB_MAP_FOREIGN_PAGES_IN, References) + 
> ReferenceSize,
> +                                   
> (ULONG)FIELD_OFFSET(XENIFACE_GNTTAB_MAP_FOREIGN_PAGES_IN_V2, References) + 
> ReferenceSize,
>                                      XENIFACE_POOL_TAG);
>           if (In == NULL)
>               goto fail5;



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