From win-pv-devel-bounces@lists.xenproject.org Thu Aug 06 07:45:55 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 06 Aug 2026 07:45:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1384294.1627303 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wrsna-00011Q-3G; Thu, 06 Aug 2026 07:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1384294.1627303; Thu, 06 Aug 2026 07:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wrsna-00011J-0f; Thu, 06 Aug 2026 07:45:54 +0000
Received: by outflank-mailman (input) for mailman id 1384294;
 Thu, 06 Aug 2026 07:45:52 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wrsnY-00011D-GL
 for win-pv-devel@lists.xenproject.org; Thu, 06 Aug 2026 07:45:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wrsnX-00C3bg-AA
 for win-pv-devel@lists.xenproject.org; Thu, 06 Aug 2026 09:45:51 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a743ba4-2eae-0a2a0a5409dd-0a2a4502cf66-36
 for <win-pv-devel@lists.xenproject.org>; Thu, 06 Aug 2026 09:45:51 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a743bae-6ca4-0a2a45020019-a0658308b736-3
 for <win-pv-devel@lists.xenproject.org>; Thu, 06 Aug 2026 09:45:51 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id C4038449C9FC;
 Thu,  6 Aug 2026 03:44:11 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 1/2] Remove redundant RtlZeroMemory on CacheCreateSlab
Date: Thu,  6 Aug 2026 08:45:44 +0100
Message-ID: <20260806074545.990-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1786002351-67ABD2AC-F4FE41BE/0/0
X-purgate-type: clean
X-purgate-size: 595

__CacheAllocate already returns zeroed memory, it is redundant to
call RtlZeroMemory after allocation.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/cache.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c
index eb7020d..81cd3eb 100644
--- a/src/xenbus/cache.c
+++ b/src/xenbus/cache.c
@@ -424,8 +424,6 @@ CacheCreateSlab(
     if (Slab == NULL)
         goto fail2;
 
-    RtlZeroMemory(Slab, NumberOfBytes);
-
     Slab->Magic = XENBUS_CACHE_SLAB_MAGIC;
     Slab->Cache = Cache;
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Thu Aug 06 07:45:56 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 06 Aug 2026 07:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1384295.1627307 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wrsnc-00012n-4P; Thu, 06 Aug 2026 07:45:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1384295.1627307; Thu, 06 Aug 2026 07:45:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wrsnc-00012g-1q; Thu, 06 Aug 2026 07:45:56 +0000
Received: by outflank-mailman (input) for mailman id 1384295;
 Thu, 06 Aug 2026 07:45:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wrsna-00012S-LT
 for win-pv-devel@lists.xenproject.org; Thu, 06 Aug 2026 07:45:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wrsna-00C3bg-1d
 for win-pv-devel@lists.xenproject.org; Thu, 06 Aug 2026 09:45:54 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a743bb0-2eae-0a2a0a5409dd-0a2a450b9bc6-10
 for <win-pv-devel@lists.xenproject.org>; Thu, 06 Aug 2026 09:45:53 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a743bb0-b7e8-0a2a450b0019-a06583088706-3
 for <win-pv-devel@lists.xenproject.org>; Thu, 06 Aug 2026 09:45:53 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 7780D449C9FC;
 Thu,  6 Aug 2026 03:44:14 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 2/2] cache: Dont linearly scan magazine slots for objects
Date: Thu,  6 Aug 2026 08:45:45 +0100
Message-ID: <20260806074545.990-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260806074545.990-1-owen.smith@citrix.com>
References: <20260806074545.990-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1786002353-ABCD79EA-2C9EC072/0/0
X-purgate-type: clean
X-purgate-size: 2323

Add an occupancy count to the cache magazine, and use this as an index
into the magazine slots for the current get/put location.
This avoids a linear scan of magazine slots when looking for a valid
slot during CacheGetObjectFromMagazine or CachePutObjectToMagazine,
reducing the algorithm from O(n) to O(1).

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/cache.c | 34 +++++++++++++++-------------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c
index 81cd3eb..90aea08 100644
--- a/src/xenbus/cache.c
+++ b/src/xenbus/cache.c
@@ -50,6 +50,7 @@ RtlRandomEx (
 #define XENBUS_CACHE_MAGAZINE_SLOTS   6
 
 typedef struct _XENBUS_CACHE_MAGAZINE {
+    ULONG   Count;
     PVOID   Slot[XENBUS_CACHE_MAGAZINE_SLOTS];
 } XENBUS_CACHE_MAGAZINE, *PXENBUS_CACHE_MAGAZINE;
 
@@ -167,20 +168,16 @@ CacheGetObjectFromMagazine(
     _In_ PXENBUS_CACHE_MAGAZINE Magazine
     )
 {
-    ULONG                       Index;
-
-    for (Index = 0; Index < XENBUS_CACHE_MAGAZINE_SLOTS; Index++) {
-        PVOID   Object;
+    PVOID                       Object;
 
-        if (Magazine->Slot[Index] != NULL) {
-            Object = Magazine->Slot[Index];
-            Magazine->Slot[Index] = NULL;
+    if (Magazine->Count == 0)
+        return NULL;
 
-            return Object;
-        }
-    }
+    Object = Magazine->Slot[--Magazine->Count];
+    Magazine->Slot[Magazine->Count] = NULL;
 
-    return NULL;
+    ASSERT(Object != NULL);
+    return Object;
 }
 
 static NTSTATUS
@@ -189,16 +186,15 @@ CachePutObjectToMagazine(
     _In_ PVOID                  Object
     )
 {
-    ULONG                       Index;
+    ASSERT(Object != NULL);
 
-    for (Index = 0; Index < XENBUS_CACHE_MAGAZINE_SLOTS; Index++) {
-        if (Magazine->Slot[Index] == NULL) {
-            Magazine->Slot[Index] = Object;
-            return STATUS_SUCCESS;
-        }
-    }
+    if (Magazine->Count == XENBUS_CACHE_MAGAZINE_SLOTS)
+        return STATUS_UNSUCCESSFUL;
+
+    ASSERT(Magazine->Slot[Magazine->Count] == NULL);
+    Magazine->Slot[Magazine->Count++] = Object;
 
-    return STATUS_UNSUCCESSFUL;
+    return STATUS_SUCCESS;
 }
 
 static PXENBUS_CACHE_MASK
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 07 11:42:49 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 07 Aug 2026 11:42:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1385962.1628232 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wsIyN-0002am-Tz; Fri, 07 Aug 2026 11:42:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1385962.1628232; Fri, 07 Aug 2026 11:42:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wsIyN-0002ae-Qw; Fri, 07 Aug 2026 11:42:47 +0000
Received: by outflank-mailman (input) for mailman id 1385962;
 Fri, 07 Aug 2026 11:42:46 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fdc0857d1000e099@swg.vates.tech>)
 id 1wsIyM-0002aY-7Q
 for win-pv-devel@lists.xenproject.org; Fri, 07 Aug 2026 11:42:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wsIyK-006mde-UV
 for win-pv-devel@lists.xenproject.org; Fri, 07 Aug 2026 13:42:45 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fdc0857d1000e099@swg.vates.tech>)
 id 6a75c4b3-bab6-0a2a0a5309dd-0a2a4502d5c6-6
 for <win-pv-devel@lists.xenproject.org>; Fri, 07 Aug 2026 13:42:44 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fdc0857d1000e099@swg.vates.tech>)
 id 6a75c4b4-6ca4-0a2a45020019-b9ff1c239cc7-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 07 Aug 2026 13:42:44 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fdc0857d1000e099.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 07 Aug 2026 11:42:42 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 470C482B2E;
 Fri,  7 Aug 2026 13:42:41 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=16guSo+WJuN0UQu6twWBIoctj5q8zzAK5BQTUzB/gcc=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=oE6KHFm/cNJrOhu06tZflhmZOTm+Ap0elhnRe3GXN1xN+WhLoOFiahhVKwktUdW0pLXNBvqGt
 rbdB2pPCnDVye38bO2Rl2IX+J1ChJRaIzvpZOsCWVRH8jC4NLZolW0XYWCMQZj4A/kwtvI2iRWY
 JSLSQMhNCZ8xayNlCaiLLqLwOHEsH1m8HfEAsjmqlFfkyVkGgyZL+zDfXsttvHTsdT05TZH8nZn
 b5oo6sJtpcvSMNCEbGEVKXB6oa31EnGHw4osJTaNAz3BLZeNZofof60s4NoAC9HAAz3k9hYQCLC
 HOvSMRTyc31PUV8nW+vJi6TdhT4kyoVJLKMOKQCQW4iQ==
X-Zone-Loop: 428fc0acce24871c0a6338334320a0230e542c79e904
x-campaign-type: default
x-transaction-id: 9a911d2b-04f6-4de4-9831-94e1d36aa0f8
x-swg-uid: 01-40abf1de-2eeb-453a-ae2f-448cbf62e7bf
X-Mailer: Sweego
Message-ID:
 <1786102962.8631fc262581453bbf619ec5b2062170.19fdc0857d1000e099@vates.tech>
x-swg-bid: 1786102962.8631fc262581453bbf619ec5b2062170.19fdc0857d1000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 7 Aug 2026 13:42:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/2] Remove redundant RtlZeroMemory on CacheCreateSlab
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260806074545.990-1-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260806074545.990-1-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1ec3.8512d480895ce444.19fdc0854c5.7ff25471dfd26c09=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786102961350
X-purgate-ID: tlsNG-720697/1786102964-323D42AC-41C672EC/0/0
X-purgate-type: clean
X-purgate-size: 1094

---=Part.1ec3.8512d480895ce444.19fdc0854c5.7ff25471dfd26c09=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 06/08/2026 09:46, Owen Smith wrote:
> __CacheAllocate already returns zeroed memory, it is redundant to
> call RtlZeroMemory after allocation=2E
>=20
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

> ---
>   src/xenbus/cache=2Ec | 2 --
>   1 file changed, 2 deletions(-)
>=20
> diff --git a/src/xenbus/cache=2Ec b/src/xenbus/cache=2Ec
> index eb7020d=2E=2E81cd3eb 100644
> --- a/src/xenbus/cache=2Ec
> +++ b/src/xenbus/cache=2Ec
> @@ -424,8 +424,6 @@ CacheCreateSlab(
>       if (Slab =3D=3D NULL)
>           goto fail2;
>  =20
> -    RtlZeroMemory(Slab, NumberOfBytes);
> -
>       Slab->Magic =3D XENBUS_CACHE_SLAB_MAGIC;
>       Slab->Cache =3D Cache;
>  =20



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.1ec3.8512d480895ce444.19fdc0854c5.7ff25471dfd26c09=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 07 11:43:01 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 07 Aug 2026 11:43:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1385963.1628236 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wsIya-0002d9-V5; Fri, 07 Aug 2026 11:43:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1385963.1628236; Fri, 07 Aug 2026 11:43:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wsIya-0002d2-Sa; Fri, 07 Aug 2026 11:43:00 +0000
Received: by outflank-mailman (input) for mailman id 1385963;
 Fri, 07 Aug 2026 11:43:00 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fdc088618000e099@swg.vates.tech>)
 id 1wsIyZ-0002cs-Ss
 for win-pv-devel@lists.xenproject.org; Fri, 07 Aug 2026 11:42:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wsIyZ-006mlf-9d
 for win-pv-devel@lists.xenproject.org; Fri, 07 Aug 2026 13:42:59 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fdc088618000e099@swg.vates.tech>)
 id 6a75c4a9-bab6-0a2a0a5309dd-0a2a4501bb2a-46
 for <win-pv-devel@lists.xenproject.org>; Fri, 07 Aug 2026 13:42:59 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fdc088618000e099@swg.vates.tech>)
 id 6a75c4c2-5984-0a2a45010019-b9ff1c22963f-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 07 Aug 2026 13:42:59 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fdc088618000e099.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 07 Aug 2026 11:42:53 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 57D0282B2E;
 Fri,  7 Aug 2026 13:42:53 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=4oNqW41O3vWqXQjSUHyNrstUx4aWL4sKydfoctQjWW0=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=N2C9u1Ta4JOE8kDiOinJhWuW8Unw9VK+M2SBzLjeUqppK9zvKVZaYGyXTblJq1vYAJiGKb0hX
 z6jsVieMNxjvx07oO7yROvehaDgTZD5uB10o4KtK2PIq3aVVqyaIA+KvpSfxrlq2F2sW9Q4WmNn
 zNYnBlFoLYQ6ymJuSN3cycd5FD4AaBuwYm04bYzCLMGLcUCs5uMv3ZKuNtZhHcVL3B6JgYVP8Ue
 B3u/bMGwgUiAXlIbcaUDoYs+3RJgis9/cIqIoDZUPuBlShB/IydPDEAhT1A3mQaO3hEw3oMAzcF
 af0kZU8W2VZHVtQufzJ4QTioQVvZ6fWX6mjs+ady11kw==
X-Zone-Loop: c3fd75bc93e65b013d818292aaf88e05f9b1e23014ad
x-campaign-type: default
x-transaction-id: bbbb7337-f874-4611-8d8a-4b945c457179
x-swg-uid: 01-db8de2c5-6325-4077-9c55-7339090d6845
X-Mailer: Sweego
Message-ID:
 <1786102974.8631fc262581453bbf619ec5b2062170.19fdc088618000e099@vates.tech>
x-swg-bid: 1786102974.8631fc262581453bbf619ec5b2062170.19fdc088618000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 7 Aug 2026 13:42:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] cache: Dont linearly scan magazine slots for objects
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260806074545.990-1-owen.smith@citrix.com>
 <20260806074545.990-2-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260806074545.990-2-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1ec4.8e6f9ec076ee174a.19fdc0883dd.8fc0e836ba848f28=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786102973405
X-purgate-ID: tlsNG-d62444/1786102979-C5146757-12821EAF/0/0
X-purgate-type: clean
X-purgate-size: 2993

---=Part.1ec4.8e6f9ec076ee174a.19fdc0883dd.8fc0e836ba848f28=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 06/08/2026 09:46, Owen Smith wrote:
> Add an occupancy count to the cache magazine, and use this as an index
> into the magazine slots for the current get/put location=2E
> This avoids a linear scan of magazine slots when looking for a valid
> slot during CacheGetObjectFromMagazine or CachePutObjectToMagazine,
> reducing the algorithm from O(n) to O(1)=2E
>=20
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

> ---
>   src/xenbus/cache=2Ec | 34 +++++++++++++++-------------------
>   1 file changed, 15 insertions(+), 19 deletions(-)
>=20
> diff --git a/src/xenbus/cache=2Ec b/src/xenbus/cache=2Ec
> index 81cd3eb=2E=2E90aea08 100644
> --- a/src/xenbus/cache=2Ec
> +++ b/src/xenbus/cache=2Ec
> @@ -50,6 +50,7 @@ RtlRandomEx (
>   #define XENBUS_CACHE_MAGAZINE_SLOTS   6
>  =20
>   typedef struct _XENBUS_CACHE_MAGAZINE {
> +    ULONG   Count;
>       PVOID   Slot[XENBUS_CACHE_MAGAZINE_SLOTS];
>   } XENBUS_CACHE_MAGAZINE, *PXENBUS_CACHE_MAGAZINE;
>  =20
> @@ -167,20 +168,16 @@ CacheGetObjectFromMagazine(
>       _In_ PXENBUS_CACHE_MAGAZINE Magazine
>       )
>   {
> -    ULONG                       Index;
> -
> -    for (Index =3D 0; Index < XENBUS_CACHE_MAGAZINE_SLOTS; Index++) {
> -        PVOID   Object;
> +    PVOID                       Object;
>  =20
> -        if (Magazine->Slot[Index] !=3D NULL) {
> -            Object =3D Magazine->Slot[Index];
> -            Magazine->Slot[Index] =3D NULL;
> +    if (Magazine->Count =3D=3D 0)
> +        return NULL;
>  =20
> -            return Object;
> -        }
> -    }
> +    Object =3D Magazine->Slot[--Magazine->Count];
> +    Magazine->Slot[Magazine->Count] =3D NULL;
>  =20
> -    return NULL;
> +    ASSERT(Object !=3D NULL);
> +    return Object;
>   }
>  =20
>   static NTSTATUS
> @@ -189,16 +186,15 @@ CachePutObjectToMagazine(
>       _In_ PVOID                  Object
>       )
>   {
> -    ULONG                       Index;
> +    ASSERT(Object !=3D NULL);
>  =20
> -    for (Index =3D 0; Index < XENBUS_CACHE_MAGAZINE_SLOTS; Index++) {
> -        if (Magazine->Slot[Index] =3D=3D NULL) {
> -            Magazine->Slot[Index] =3D Object;
> -            return STATUS_SUCCESS;
> -        }
> -    }
> +    if (Magazine->Count =3D=3D XENBUS_CACHE_MAGAZINE_SLOTS)
> +        return STATUS_UNSUCCESSFUL;
> +
> +    ASSERT(Magazine->Slot[Magazine->Count] =3D=3D NULL);
> +    Magazine->Slot[Magazine->Count++] =3D Object;
>  =20
> -    return STATUS_UNSUCCESSFUL;
> +    return STATUS_SUCCESS;
>   }
>  =20
>   static PXENBUS_CACHE_MASK



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.1ec4.8e6f9ec076ee174a.19fdc0883dd.8fc0e836ba848f28=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 07:30:05 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 07:30:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390795.1630951 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMe-0005tU-Pb; Fri, 14 Aug 2026 07:30:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390795.1630951; Fri, 14 Aug 2026 07:30:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMe-0005t9-Lt; Fri, 14 Aug 2026 07:30:04 +0000
Received: by outflank-mailman (input) for mailman id 1390795;
 Fri, 14 Aug 2026 07:30:03 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wumMd-0005XV-5f
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 07:30:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wumMc-001tP2-IB
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:30:02 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3f9-8faa-0a2a0a5109dd-0a2a45079fa8-2
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:02 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3f9-b4ea-0a2a45070019-a0658308e554-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:02 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id E586B453CE07;
 Fri, 14 Aug 2026 03:28:18 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 0/8] Use AI to detected issues
Date: Fri, 14 Aug 2026 08:29:45 +0100
Message-ID: <20260814072954.915-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1786692602-346CAAE4-F2978FFB/0/0
X-purgate-type: clean
X-purgate-size: 1033

Issues detected with ClaudeCode:claude-opus-4.8 and patches
generated manually. AI was not used to generate any patches.
Adds the 'Assisted-by' tag to all commits to show which AI model
detected these issues.

Owen Smith (8):
  log: Avoid buffer overrun in DbgPrint interception
  store: Detect bad response from xenstored
  fdo: Use IoFreeMdl when IoAllocateMdl was uesd to allocate
  registry: Fix wrong truncation of Unicode.Length
  evtchn: Dont Release SHARED_INFO interface if Acquire failed
  monitor: Check allocated pointer, not Context
  high: Zero the HIGH_LOCK value, not the pointer
  Correct printf parameters

 src/common/high.h      |  2 +-
 src/common/registry.c  |  4 +++-
 src/monitor/monitor.c  |  6 +++---
 src/xen/bug_check.c    |  1 -
 src/xen/log.c          | 10 ++++++++--
 src/xenbus/evtchn_2l.c |  2 --
 src/xenbus/fdo.c       |  4 ++--
 src/xenbus/gnttab.c    |  1 +
 src/xenbus/store.c     |  4 ++++
 9 files changed, 22 insertions(+), 12 deletions(-)

-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 07:30:05 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 07:30:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390796.1630956 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMe-0005tr-ST; Fri, 14 Aug 2026 07:30:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390796.1630956; Fri, 14 Aug 2026 07:30:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMe-0005tX-NC; Fri, 14 Aug 2026 07:30:04 +0000
Received: by outflank-mailman (input) for mailman id 1390796;
 Fri, 14 Aug 2026 07:30:03 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wumMd-0005f2-NC
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 07:30:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wumMd-0039Cl-3c
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:30:03 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fa-bab6-0a2a0a5309dd-0a2a45068f16-2
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:03 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fa-195a-0a2a45060019-a0658308e8b0-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:02 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id AEC95453CE06;
 Fri, 14 Aug 2026 03:28:19 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 1/8] log: Avoid buffer overrun in DbgPrint interception
Date: Fri, 14 Aug 2026 08:29:46 +0100
Message-ID: <20260814072954.915-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260814072954.915-1-owen.smith@citrix.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1786692603-FCA0477B-98225222/0/0
X-purgate-type: clean
X-purgate-size: 1194

Truncate incomming strings to fit inside a Slot's Buffer

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xen/log.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xen/log.c b/src/xen/log.c
index 8673105..93039f6 100644
--- a/src/xen/log.c
+++ b/src/xen/log.c
@@ -545,6 +545,7 @@ LogDebugPrint(
 {
     PLOG_CONTEXT        Context = &LogContext;
     KIRQL               Irql;
+    ULONG               Length;
     PLOG_SLOT           Slot;
 
     UNREFERENCED_PARAMETER(ComponentId);
@@ -571,9 +572,14 @@ LogDebugPrint(
 
     Slot = &Context->Slot[Context->Pending++];
 
+    // truncate long log lines - avoid buffer overrun on Slot->Buffer
+    Length = Ansi->Length >= LOG_BUFFER_SIZE ?
+                            LOG_BUFFER_SIZE - 1:
+                            Ansi->Length;
+
     Slot->Level = 1 << Level;
-    RtlCopyMemory(Slot->Buffer, Ansi->Buffer, Ansi->Length);
-    Slot->Offset = Ansi->Length;
+    RtlCopyMemory(Slot->Buffer, Ansi->Buffer, Length);
+    Slot->Offset = Length;
 
     ReleaseHighLock(&Context->Lock, Irql);
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 07:30:05 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 07:30:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390797.1630960 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMf-00065j-SQ; Fri, 14 Aug 2026 07:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390797.1630960; Fri, 14 Aug 2026 07:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMf-00065P-OI; Fri, 14 Aug 2026 07:30:05 +0000
Received: by outflank-mailman (input) for mailman id 1390797;
 Fri, 14 Aug 2026 07:30:04 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wumMe-0005oT-HO
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 07:30:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wumMd-008Xdh-Tu
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:30:03 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3f0-e002-0a2a0a5209dd-0a2a45049546-46
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:03 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fa-b57f-0a2a45040019-a0658308e020-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:03 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 78277453CE10;
 Fri, 14 Aug 2026 03:28:20 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 2/8] store: Detect bad response from xenstored
Date: Fri, 14 Aug 2026 08:29:47 +0100
Message-ID: <20260814072954.915-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260814072954.915-1-owen.smith@citrix.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1786692603-530CDB50-09D14D83/0/0
X-purgate-type: clean
X-purgate-size: 866

Detect when Header.len is larger than allowed, and fail the request.

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/store.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/xenbus/store.c b/src/xenbus/store.c
index 503144a..e2a0031 100644
--- a/src/xenbus/store.c
+++ b/src/xenbus/store.c
@@ -519,9 +519,13 @@ StoreReceiveResponse(
 
     ASSERT(StoreVerifyHeader(&Response->Header));
 
+    status = STATUS_INVALID_BUFFER_SIZE;
     if (Response->Header.len == 0)
         goto done;
 
+    if (Response->Header.len >= XENSTORE_PAYLOAD_MAX)
+        goto done;
+
     Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT].Length = Response->Header.len;
     Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT].Data = Response->Data;
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 07:30:06 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 07:30:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390798.1630961 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMg-0006Cy-SN; Fri, 14 Aug 2026 07:30:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390798.1630961; Fri, 14 Aug 2026 07:30:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMg-0006Ct-PS; Fri, 14 Aug 2026 07:30:06 +0000
Received: by outflank-mailman (input) for mailman id 1390798;
 Fri, 14 Aug 2026 07:30:05 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wumMf-0005zZ-C7
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 07:30:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wumMe-001tP2-PD
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:30:04 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3f4-8faa-0a2a0a5109dd-0a2a450c8e4a-34
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:04 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fb-f479-0a2a450c0019-a0658308c1e6-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:04 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 43B36453CE07;
 Fri, 14 Aug 2026 03:28:21 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 3/8] fdo: Use IoFreeMdl when IoAllocateMdl was uesd to allocate
Date: Fri, 14 Aug 2026 08:29:48 +0100
Message-ID: <20260814072954.915-4-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260814072954.915-1-owen.smith@citrix.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1786692604-5073FA5B-327A5DAC/0/0
X-purgate-type: clean
X-purgate-size: 509

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/fdo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 6b46c8c..2e8f2e6 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -3387,7 +3387,7 @@ FdoPciHoleFree(
                               Count);
     ASSERT(NT_SUCCESS(status));
 
-    ExFreePool(Mdl);
+    IoFreeMdl(Mdl);
 }
 
 static PMDL
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 07:30:07 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 07:30:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390799.1630965 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMh-0006Kp-T0; Fri, 14 Aug 2026 07:30:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390799.1630965; Fri, 14 Aug 2026 07:30:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMh-0006Kk-Qc; Fri, 14 Aug 2026 07:30:07 +0000
Received: by outflank-mailman (input) for mailman id 1390799;
 Fri, 14 Aug 2026 07:30:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wumMg-000683-4t
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 07:30:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wumMf-0039Cl-HX
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:30:05 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3f8-bab6-0a2a0a5309dd-0a2a45038b30-22
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:05 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fc-fae8-0a2a45030019-a0658308daac-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:05 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 0CE3D453CE14;
 Fri, 14 Aug 2026 03:28:21 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 4/8] registry: Fix wrong truncation of Unicode.Length
Date: Fri, 14 Aug 2026 08:29:49 +0100
Message-ID: <20260814072954.915-5-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260814072954.915-1-owen.smith@citrix.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1786692605-6E8CD4E9-48787F30/0/0
X-purgate-type: clean
X-purgate-size: 829

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/common/registry.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/common/registry.c b/src/common/registry.c
index 1f7a73c..204e2e8 100644
--- a/src/common/registry.c
+++ b/src/common/registry.c
@@ -1460,11 +1460,13 @@ RegistryAnsiToSz(
     if (Partial == NULL)
         goto fail1;
 
+    ASSERT3U(Length * sizeof (WCHAR), <=, 0xFFFF); // MAX_USHORT
+
     Partial->TitleIndex = 0;
     Partial->Type = REG_SZ;
     Partial->DataLength = Length * sizeof (WCHAR);
 
-    Unicode.MaximumLength = (UCHAR)Partial->DataLength;
+    Unicode.MaximumLength = (USHORT)Partial->DataLength;
     Unicode.Buffer = (PWCHAR)Partial->Data;
     Unicode.Length = 0;
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 07:30:08 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 07:30:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390800.1630970 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMi-0006Mx-Um; Fri, 14 Aug 2026 07:30:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390800.1630970; Fri, 14 Aug 2026 07:30:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMi-0006Mp-Rg; Fri, 14 Aug 2026 07:30:08 +0000
Received: by outflank-mailman (input) for mailman id 1390800;
 Fri, 14 Aug 2026 07:30:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wumMg-0006Cs-UX
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 07:30:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wumMg-008XfG-BB
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:30:06 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fc-2eae-0a2a0a5409dd-0a2a4504a7b6-12
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:06 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fd-b57f-0a2a45040019-a0658308ae7c-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:06 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id C91EB453CE06;
 Fri, 14 Aug 2026 03:28:22 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 5/8] evtchn: Dont Release SHARED_INFO interface if Acquire failed
Date: Fri, 14 Aug 2026 08:29:50 +0100
Message-ID: <20260814072954.915-6-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260814072954.915-1-owen.smith@citrix.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1786692606-502E4B50-D462BABE/0/0
X-purgate-type: clean
X-purgate-size: 609

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/evtchn_2l.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/xenbus/evtchn_2l.c b/src/xenbus/evtchn_2l.c
index 21b48f0..0dfb60a 100644
--- a/src/xenbus/evtchn_2l.c
+++ b/src/xenbus/evtchn_2l.c
@@ -194,8 +194,6 @@ done:
 fail1:
     Error("fail1 (%08x)\n", status);
 
-    XENBUS_SHARED_INFO(Release, &Context->SharedInfoInterface);
-
     --Context->References;
     ASSERT3U(Context->References, ==, 0);
     KeReleaseSpinLock(&Context->Lock, Irql);
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 07:30:10 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 07:30:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390801.1630973 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMj-0006P5-Vi; Fri, 14 Aug 2026 07:30:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390801.1630973; Fri, 14 Aug 2026 07:30:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMj-0006Ov-Sm; Fri, 14 Aug 2026 07:30:09 +0000
Received: by outflank-mailman (input) for mailman id 1390801;
 Fri, 14 Aug 2026 07:30:08 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wumMi-0006MD-Ir
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 07:30:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wumMh-0039Cl-Ve
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:30:07 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fa-bab6-0a2a0a5309dd-0a2a45068f16-12
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:07 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fe-195a-0a2a45060019-a0658308eb14-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:07 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 5C10E453CE07;
 Fri, 14 Aug 2026 03:28:24 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 7/8] high: Zero the HIGH_LOCK value, not the pointer
Date: Fri, 14 Aug 2026 08:29:52 +0100
Message-ID: <20260814072954.915-8-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260814072954.915-1-owen.smith@citrix.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1786692607-F4A0477B-DAB39C9C/0/0
X-purgate-type: clean
X-purgate-size: 540

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/common/high.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/high.h b/src/common/high.h
index bdebc7f..61ba2a6 100644
--- a/src/common/high.h
+++ b/src/common/high.h
@@ -83,7 +83,7 @@ InitializeHighLock(
     _In_ PHIGH_LOCK Lock
     )
 {
-    RtlZeroMemory(&Lock, sizeof (HIGH_LOCK));
+    RtlZeroMemory(Lock, sizeof (HIGH_LOCK));
 }
 
 #endif  // _COMMON_HIGH_H
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 07:30:10 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 07:30:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390802.1630978 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMk-0006PN-2O; Fri, 14 Aug 2026 07:30:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390802.1630978; Fri, 14 Aug 2026 07:30:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMj-0006P8-Tq; Fri, 14 Aug 2026 07:30:09 +0000
Received: by outflank-mailman (input) for mailman id 1390802;
 Fri, 14 Aug 2026 07:30:08 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wumMi-0006MI-Lb
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 07:30:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wumMi-0039Cl-1u
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:30:08 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3f0-bab6-0a2a0a5309dd-0a2a450b939c-30
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:06 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fe-b7e8-0a2a450b0019-a0658308cc62-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:06 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 93344453CE04;
 Fri, 14 Aug 2026 03:28:23 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 6/8] monitor: Check allocated pointer, not Context
Date: Fri, 14 Aug 2026 08:29:51 +0100
Message-ID: <20260814072954.915-7-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260814072954.915-1-owen.smith@citrix.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1786692606-AA2C49EA-4D3716F4/0/0
X-purgate-type: clean
X-purgate-size: 1232

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/monitor/monitor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 904badd..b7ee7ba 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1215,7 +1215,7 @@ GetDialogParameters(
     TitleSize = (MaxValueLength + 1) * sizeof(TCHAR);
 
     Context->Title = calloc(1, TitleSize);
-    if (Context == NULL)
+    if (Context->Title == NULL)
         goto fail2;
 
     Error = RegQueryValueEx(Context->ParametersKey,
@@ -1237,7 +1237,7 @@ GetDialogParameters(
     TextSize = (MaxValueLength + 1) * sizeof (TCHAR);
 
     Context->Text = calloc(1, TextSize);
-    if (Context == NULL)
+    if (Context->Text == NULL)
         goto fail5;
 
     Error = RegQueryValueEx(Context->ParametersKey,
@@ -1259,7 +1259,7 @@ GetDialogParameters(
     QuestionSize = (MaxValueLength + 1) * sizeof (TCHAR);
 
     Context->Question = calloc(1, QuestionSize);
-    if (Context == NULL)
+    if (Context->Question == NULL)
         goto fail8;
 
     Error = RegQueryValueEx(Context->ParametersKey,
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 07:30:11 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 07:30:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390803.1630981 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMl-0006Se-1d; Fri, 14 Aug 2026 07:30:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390803.1630981; Fri, 14 Aug 2026 07:30:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wumMk-0006SV-V2; Fri, 14 Aug 2026 07:30:10 +0000
Received: by outflank-mailman (input) for mailman id 1390803;
 Fri, 14 Aug 2026 07:30:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wumMj-0006N8-3Z
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 07:30:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wumMi-008XfG-G1
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:30:08 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3fc-2eae-0a2a0a5409dd-0a2a4504a7b6-20
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:08 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7ec3ff-b57f-0a2a45040019-a0658308a614-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 09:30:08 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 28CB8453CE06;
 Fri, 14 Aug 2026 03:28:25 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 8/8] Correct printf parameters
Date: Fri, 14 Aug 2026 08:29:53 +0100
Message-ID: <20260814072954.915-9-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260814072954.915-1-owen.smith@citrix.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1786692608-526CAB50-955BE5CC/0/0
X-purgate-type: clean
X-purgate-size: 1614

Adds missing or remove incorrect parameters passed to printf style
logging calls

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xen/bug_check.c | 1 -
 src/xenbus/fdo.c    | 2 +-
 src/xenbus/gnttab.c | 1 +
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xen/bug_check.c b/src/xen/bug_check.c
index cc77ef0..2a118d3 100644
--- a/src/xen/bug_check.c
+++ b/src/xen/bug_check.c
@@ -760,7 +760,6 @@ BugCheckSystemThreadExceptionNotHandled(
                       "%s|BUGCHECK: %08X AT %p\n",
                       __MODULE__,
                       Code,
-                      Name,
                       Address);
 
         BugCheckDumpExceptionRecord(Exception);
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 2e8f2e6..c86d311 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -5783,7 +5783,7 @@ FdoSetWatchdog(
     ConfigFreeSzValue(Option);
 
     if (Value && Value < 10) {
-        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
+        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n", Value);
         Value = 10;
     }
 
diff --git a/src/xenbus/gnttab.c b/src/xenbus/gnttab.c
index 71f8ec1..3adcef4 100644
--- a/src/xenbus/gnttab.c
+++ b/src/xenbus/gnttab.c
@@ -821,6 +821,7 @@ GnttabDebugCallback(
         XENBUS_DEBUG(Printf,
                     &Context->DebugInterface,
                      "[%u] Address = %08x.%08x\n",
+                     Index,
                      Address.HighPart,
                      Address.LowPart);
     }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 09:58:05 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 09:58:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390975.1631048 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuofs-0007f3-Ly; Fri, 14 Aug 2026 09:58:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390975.1631048; Fri, 14 Aug 2026 09:58:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuofs-0007ev-JK; Fri, 14 Aug 2026 09:58:04 +0000
Received: by outflank-mailman (input) for mailman id 1390975;
 Fri, 14 Aug 2026 09:58:03 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffb4f6cb000c4f3@swg.vates.tech>)
 id 1wuofq-0007ep-K0
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:58:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuofp-003Z24-RF
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 11:58:01 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffb4f6cb000c4f3@swg.vates.tech>)
 id 6a7ee69c-bab6-0a2a0a5309dd-0a2a450ca966-40
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 11:58:01 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffb4f6cb000c4f3@swg.vates.tech>)
 id 6a7ee6a9-f479-0a2a450c0019-b9ff1c2299c9-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 11:58:01 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fffb4f6cb000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 09:57:57 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id D880381BED;
 Fri, 14 Aug 2026 11:57:56 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=SiO0zz4TRI/YNzZPwdTavOrg1QZdYCZU9FMxoJqN47w=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=EnFLkNVS8qKUUk/6MyzVMiK3dUtWVxzsB2HemWQg4q8M6vagmWSDYsEjsF8qaFc8Er/4pcAdZ
 YMGwDiqKRPXsZv7ZmgtfFawERFEFjKbEBpg41X+JZsxwT78lrukynhIc8BHiAST+W5STbhxrVsD
 qVvmbMba1VG+CQN8N7XHW9OxC4+hIs52ncUta4GmbMw7hE01hRXik9ic46RAGPSSHmkEO6YeNue
 /lXT7lDO/r13FF4Tta30AAavL/cwz19HfmTQs/ZAl3vjY/VIwtD1cqeejqQYhxaTLfDjfjGFZIh
 kZQyR7gRuit2JmrM5rqW7xf904lE8tT6mrfrwFRVoGcw==
X-Zone-Loop: 911070944195b881f28fb6e22b9afbb1d24b20baa5e8
x-campaign-type: default
x-transaction-id: eea84fdf-6378-4c88-a816-aaf8ffa3b4a8
x-swg-uid: 01-57f2d6d7-df53-4485-9e27-7b1a6a100e95
X-Mailer: Sweego
Message-ID:
 <1786701477.8631fc262581453bbf619ec5b2062170.19fffb4f6cb000c4f3@vates.tech>
x-swg-bid: 1786701477.8631fc262581453bbf619ec5b2062170.19fffb4f6cb000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 11:57:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/8] high: Zero the HIGH_LOCK value, not the pointer
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-8-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260814072954.915-8-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.22ef.6829523db9ab3a86.19fffb4f448.80d5f12259e35818=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786701476936
X-purgate-ID: tlsNG-d25034/1786701481-038D5A5B-1CE1371E/0/0
X-purgate-type: clean
X-purgate-size: 1023

---=Part.22ef.6829523db9ab3a86.19fffb4f448.80d5f12259e35818=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 09:30, Owen Smith wrote:
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

> ---
>   src/common/high=2Eh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/src/common/high=2Eh b/src/common/high=2Eh
> index bdebc7f=2E=2E61ba2a6 100644
> --- a/src/common/high=2Eh
> +++ b/src/common/high=2Eh
> @@ -83,7 +83,7 @@ InitializeHighLock(
>       _In_ PHIGH_LOCK Lock
>       )
>   {
> -    RtlZeroMemory(&Lock, sizeof (HIGH_LOCK));
> +    RtlZeroMemory(Lock, sizeof (HIGH_LOCK));
>   }
>  =20
>   #endif  // _COMMON_HIGH_H



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.22ef.6829523db9ab3a86.19fffb4f448.80d5f12259e35818=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 09:58:23 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 09:58:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390976.1631053 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuogB-0007hW-Nq; Fri, 14 Aug 2026 09:58:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390976.1631053; Fri, 14 Aug 2026 09:58:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuogB-0007hP-LD; Fri, 14 Aug 2026 09:58:23 +0000
Received: by outflank-mailman (input) for mailman id 1390976;
 Fri, 14 Aug 2026 09:58:22 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffb541b6000c4f3@swg.vates.tech>)
 id 1wuogA-0007hJ-9h
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 09:58:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuog9-005kkx-MU
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 11:58:21 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffb541b6000c4f3@swg.vates.tech>)
 id 6a7ee6b4-2eae-0a2a0a5409dd-0a2a4505eb30-32
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 11:58:21 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffb541b6000c4f3@swg.vates.tech>)
 id 6a7ee6bd-4cb1-0a2a45050019-b9ff1c23af2d-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 11:58:21 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fffb541b6000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 09:58:16 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 45C6B83293;
 Fri, 14 Aug 2026 11:58:16 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=cCPAN4TldICg9WEqDgskBheBvtx1GWGj4kwP1C7vpUw=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=D2UVgTT2X6v1IifRE1aFSDNNVOKTZuZCk6FS3ilCxKzcHuIXBSdD/Da1SYk1sG/6dvMnARebk
 owyXpU6VnNbmGWXGy1uIj4VJEqVSPPFYpjrKXn8f6BLX7NspEQrAZ7N7bLL4MBx8mhy/r3GRIMZ
 2CdcgqXq1Xm8GahQbCx0C7ZwtGV7LGjqyqSCisUOEDzCECPeMJi00k5rE8gRGTaQXjXcs9WcRaY
 lXM2IuXMFyGsh8mpebQIoznpdXrLgwrVgcOsg8hOmLompwag3dpEsBbvJ2QYKf3s5pno33mLlou
 O6MPxCUGNTWIUEP5vcS420qshucJi8TWfHjAGSEzO72w==
X-Zone-Loop: 7f8b468feb776f41e4ffd182db3651a3679c746d534c
x-campaign-type: default
x-transaction-id: a444b004-e8da-4437-83aa-caa4feeb889a
x-swg-uid: 01-9f4a4363-97e2-4663-a4ec-850f37eb5d81
X-Mailer: Sweego
Message-ID:
 <1786701496.8631fc262581453bbf619ec5b2062170.19fffb541b6000c4f3@vates.tech>
x-swg-bid: 1786701496.8631fc262581453bbf619ec5b2062170.19fffb541b6000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 11:58:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 8/8] Correct printf parameters
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-9-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260814072954.915-9-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.22f0.584035e20052096b.19fffb54019.881ef4c3045ec432=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786701496345
X-purgate-ID: tlsNG-c201ff/1786701501-F64B42A1-51191BD4/0/0
X-purgate-type: clean
X-purgate-size: 2213

---=Part.22f0.584035e20052096b.19fffb54019.881ef4c3045ec432=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 09:30, Owen Smith wrote:
> Adds missing or remove incorrect parameters passed to printf style
> logging calls
>=20
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

> ---
>   src/xen/bug_check=2Ec | 1 -
>   src/xenbus/fdo=2Ec    | 2 +-
>   src/xenbus/gnttab=2Ec | 1 +
>   3 files changed, 2 insertions(+), 2 deletions(-)
>=20
> diff --git a/src/xen/bug_check=2Ec b/src/xen/bug_check=2Ec
> index cc77ef0=2E=2E2a118d3 100644
> --- a/src/xen/bug_check=2Ec
> +++ b/src/xen/bug_check=2Ec
> @@ -760,7 +760,6 @@ BugCheckSystemThreadExceptionNotHandled(
>                         "%s|BUGCHECK: %08X AT %p\n",
>                         __MODULE__,
>                         Code,
> -                      Name,
>                         Address);
>  =20
>           BugCheckDumpExceptionRecord(Exception);
> diff --git a/src/xenbus/fdo=2Ec b/src/xenbus/fdo=2Ec
> index 2e8f2e6=2E=2Ec86d311 100644
> --- a/src/xenbus/fdo=2Ec
> +++ b/src/xenbus/fdo=2Ec
> @@ -5783,7 +5783,7 @@ FdoSetWatchdog(
>       ConfigFreeSzValue(Option);
>  =20
>       if (Value && Value < 10) {
> -        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
> +        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n", Value);
>           Value =3D 10;
>       }
>  =20
> diff --git a/src/xenbus/gnttab=2Ec b/src/xenbus/gnttab=2Ec
> index 71f8ec1=2E=2E3adcef4 100644
> --- a/src/xenbus/gnttab=2Ec
> +++ b/src/xenbus/gnttab=2Ec
> @@ -821,6 +821,7 @@ GnttabDebugCallback(
>           XENBUS_DEBUG(Printf,
>                       &Context->DebugInterface,
>                        "[%u] Address =3D %08x=2E%08x\n",
> +                     Index,
>                        Address=2EHighPart,
>                        Address=2ELowPart);
>       }



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.22f0.584035e20052096b.19fffb54019.881ef4c3045ec432=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 10:04:21 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 10:04:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390978.1631056 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuolx-0000Sl-3I; Fri, 14 Aug 2026 10:04:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390978.1631056; Fri, 14 Aug 2026 10:04:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuolx-0000Se-0c; Fri, 14 Aug 2026 10:04:21 +0000
Received: by outflank-mailman (input) for mailman id 1390978;
 Fri, 14 Aug 2026 10:04:19 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbac0a7000c4f3@swg.vates.tech>)
 id 1wuolv-0000SY-TC
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 10:04:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuolu-00Cwj9-A7
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 12:04:18 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbac0a7000c4f3@swg.vates.tech>)
 id 6a7ee81a-2eae-0a2a0a5409dd-0a2a450a8adc-42
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:04:18 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbac0a7000c4f3@swg.vates.tech>)
 id 6a7ee821-f2d2-0a2a450a0019-b9ff1c23aebd-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:04:18 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fffbac0a7000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 10:04:16 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5159281FDA;
 Fri, 14 Aug 2026 12:04:16 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=8HN2e8+71FKPGH6g10XpiyMFsK6vYcs7vZ5ls/+t3sM=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=MqaQ0i7h/5vLzE76vtW9m8I4ui/YUBwUepaaaK68YF7/NU0ebQnJSefDLvgupx0JHZgPnJDu1
 EUYhyfLwyZt39fukZXX1hr93X3i/9OKiWIGbBu6iehUZP/7V0uAAvogKFA8Ec3PqrNxbHiEXFm0
 DbesrKLrQF5mZJfSNe73q7tSWg8O4NdhlPMwx+6/KvUD8AOHcVE+JGu+4jkornoE6ExVfFiEBOe
 ohrh1RuS4gM+n8OBvMWNM1RQdZkNCeKxqc4T7viK9i0gjMHu+AEqHrzzzHj9Xz9I2qaGWx+U8o9
 imRVlcVunwwQ2EloYSd/l6u1iPUoaMn1ZK2XTU320lew==
X-Zone-Loop: 1e9046f40f001caee96b252025162bad0fd987c15767
x-campaign-type: default
x-transaction-id: f7c7116f-f923-4ab8-8b64-37229982555f
x-swg-uid: 01-505cd3f0-986e-4030-a52e-c7883f9f2e6c
X-Mailer: Sweego
Message-ID:
 <1786701857.8631fc262581453bbf619ec5b2062170.19fffbac0a7000c4f3@vates.tech>
x-swg-bid: 1786701857.8631fc262581453bbf619ec5b2062170.19fffbac0a7000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 12:04:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/8] registry: Fix wrong truncation of Unicode.Length
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-5-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260814072954.915-5-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.22f1.9d937ca66d467dff.19fffbabe7c.5beac3fe141de54b=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786701856381
X-purgate-ID: tlsNG-4011c0/1786701858-595C3CFC-486037B9/0/0
X-purgate-type: clean
X-purgate-size: 1673

---=Part.22f1.9d937ca66d467dff.19fffbabe7c.5beac3fe141de54b=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 09:30, Owen Smith wrote:
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>
> ---
>   src/common/registry=2Ec | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>=20
> diff --git a/src/common/registry=2Ec b/src/common/registry=2Ec

Other drivers will need the same patch as well=2E

> index 1f7a73c=2E=2E204e2e8 100644
> --- a/src/common/registry=2Ec
> +++ b/src/common/registry=2Ec
> @@ -1460,11 +1460,13 @@ RegistryAnsiToSz(

Should RegistryAnsiToMultiSz be updated in the same way?

>       if (Partial =3D=3D NULL)
>           goto fail1;
>  =20
> +    ASSERT3U(Length * sizeof (WCHAR), <=3D, 0xFFFF); // MAX_USHORT
> +

If the intent is to unconditionally truncate if=20
RtlAnsiStringToUnicodeString fails, I don't know if we would want=20
another assert here=2E If that's not the case, wouldn't it be better to=20
simply remove the truncation code path and fail?

>       Partial->TitleIndex =3D 0;
>       Partial->Type =3D REG_SZ;
>       Partial->DataLength =3D Length * sizeof (WCHAR);
>  =20
> -    Unicode=2EMaximumLength =3D (UCHAR)Partial->DataLength;
> +    Unicode=2EMaximumLength =3D (USHORT)Partial->DataLength;
>       Unicode=2EBuffer =3D (PWCHAR)Partial->Data;
>       Unicode=2ELength =3D 0;
>  =20



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.22f1.9d937ca66d467dff.19fffbabe7c.5beac3fe141de54b=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 10:05:47 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 10:05:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390980.1631061 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuonL-0000Y1-7j; Fri, 14 Aug 2026 10:05:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390980.1631061; Fri, 14 Aug 2026 10:05:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuonL-0000Xt-4q; Fri, 14 Aug 2026 10:05:47 +0000
Received: by outflank-mailman (input) for mailman id 1390980;
 Fri, 14 Aug 2026 10:05:46 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbc0977000c4f3@swg.vates.tech>)
 id 1wuonK-0000Xn-BB
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 10:05:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuonJ-00Cwua-OB
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 12:05:45 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbc0977000c4f3@swg.vates.tech>)
 id 6a7ee871-8faa-0a2a0a5109dd-0a2a4501db82-40
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:05:45 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbc0977000c4f3@swg.vates.tech>)
 id 6a7ee877-5984-0a2a45010019-b9ff1c128c1b-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:05:44 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fffbc0977000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 10:05:41 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 8B3C08117D;
 Fri, 14 Aug 2026 12:05:40 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=7mNeOjvWUjDxL2sZpFfHpOoScDhWcu7NATLCNx3CaC0=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=WR/KkGP1t5PLBuY7wfIr2ZOLsEkAT/c3PxLGKvy8mK+Xho7tz6pkGUUeS0KsGl8pZuzumak7n
 623eDJYcCMN8rC2ntC67Xdpc8bijjOXGvXzIM6yZHyJSMVc4pHeLOBK0mcbx4HJrvCdXqZSWnyx
 eQWCWbxbo8BdO5v30pqzo95qHjjBNerk71wxEjUAWb/wu0rmD0lY0dueXOru/X3GIrJiLapZ3rF
 MvQwZWO2KNPL51vzSFmllj9Gk+k8Se47WFZPKOcHFd8gCmSwEWTaoJax72yKvCdRkBIp5LKNbVj
 Iz3moFSk60Bdofaiu+5fi3xa9KrZ3jBDqjLQwqvlaQYA==
X-Zone-Loop: b3e28a16316d4911fd29731096e354d0cdf86c558faa
x-campaign-type: default
x-transaction-id: 74d94b13-74e4-4ba4-9640-550246b1d37a
x-swg-uid: 01-3928ba2d-7d7d-4e8e-b246-4dd41c728362
X-Mailer: Sweego
Message-ID:
 <1786701941.8631fc262581453bbf619ec5b2062170.19fffbc0977000c4f3@vates.tech>
x-swg-bid: 1786701941.8631fc262581453bbf619ec5b2062170.19fffbc0977000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 12:05:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/8] store: Detect bad response from xenstored
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-3-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260814072954.915-3-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.22f2.fa56e45af500ed65.19fffbc078a.28f1d2cc5bf69f97=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786701940619
X-purgate-ID: tlsNG-d62444/1786701944-BE07B757-B459997A/0/0
X-purgate-type: clean
X-purgate-size: 1476

---=Part.22f2.fa56e45af500ed65.19fffbc078a.28f1d2cc5bf69f97=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 09:30, Owen Smith wrote:
> Detect when Header=2Elen is larger than allowed, and fail the request=2E
>=20
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

NB: xencrsh/store=2Ec would likely benefit from the same change=2E

> ---
>   src/xenbus/store=2Ec | 4 ++++
>   1 file changed, 4 insertions(+)
>=20
> diff --git a/src/xenbus/store=2Ec b/src/xenbus/store=2Ec
> index 503144a=2E=2Ee2a0031 100644
> --- a/src/xenbus/store=2Ec
> +++ b/src/xenbus/store=2Ec
> @@ -519,9 +519,13 @@ StoreReceiveResponse(
>  =20
>       ASSERT(StoreVerifyHeader(&Response->Header));
>  =20
> +    status =3D STATUS_INVALID_BUFFER_SIZE;
>       if (Response->Header=2Elen =3D=3D 0)
>           goto done;
>  =20
> +    if (Response->Header=2Elen >=3D XENSTORE_PAYLOAD_MAX)
> +        goto done;
> +
>       Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT]=2ELength =
=3D Response->Header=2Elen;
>       Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT]=2EData =
=3D Response->Data;
>  =20



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.22f2.fa56e45af500ed65.19fffbc078a.28f1d2cc5bf69f97=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 10:07:32 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 10:07:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390989.1631074 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuop2-00016y-Mr; Fri, 14 Aug 2026 10:07:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390989.1631074; Fri, 14 Aug 2026 10:07:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuop2-00016r-Jv; Fri, 14 Aug 2026 10:07:32 +0000
Received: by outflank-mailman (input) for mailman id 1390989;
 Fri, 14 Aug 2026 10:07:31 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbdb100000c4f3@swg.vates.tech>)
 id 1wuop1-00015B-FJ
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 10:07:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuop0-008zgm-SA
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 12:07:30 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbdb100000c4f3@swg.vates.tech>)
 id 6a7ee8e2-bab6-0a2a0a5309dd-0a2a4501af14-2
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:07:30 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbdb100000c4f3@swg.vates.tech>)
 id 6a7ee8e2-5984-0a2a45010019-b9ff1c229d51-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:07:30 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fffbdb100000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 10:07:29 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id E2E4C81BDC;
 Fri, 14 Aug 2026 12:07:28 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=/Y2M1HCFk6IGTjtwU65H/CMQ9pKhIECWTPXj+wIPcS8=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=CFlSaqujAY8B/H3j0AlHI01VpBKNU6fiJ/Xcp0n/sUFqgSOTlawODny3W+bkCY2M0uyu1ndl8
 q7P/BBOgqQgNbG+oA3CJYRUJMgyIPTu3eN0/qFfNQ9TlyKU9mbuU51LYhXLD1MssnLBylseqMUr
 qrrdR4Z/OUfTlSCDDKRAyseZLBGUtVKJGOrLEAgZSS6Wz+4VxeFMbmEdT4m5Qz2GZ7bZ9EDFLvO
 kVIQrVcMu8i6Ax3ww21dsRIeoBaJUpvyDppv7Sv0MYXMkf57MBlSYZG8syze/5+pcH2QIXI2ZF4
 SicEp/Tp6ol05YXpqw6FERpzfzXcsumO5sJJtToL7xCg==
X-Zone-Loop: 26e525e147ffabf717b099a27eb76bed7d1e1b6e36fb
x-campaign-type: default
x-transaction-id: 0779ab5a-e8c8-4a91-9445-2be165133164
x-swg-uid: 01-d8abad2a-2536-4aa2-b086-4b6302faa762
X-Mailer: Sweego
Message-ID:
 <1786702049.8631fc262581453bbf619ec5b2062170.19fffbdb100000c4f3@vates.tech>
x-swg-bid: 1786702049.8631fc262581453bbf619ec5b2062170.19fffbdb100000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 12:07:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/8] log: Avoid buffer overrun in DbgPrint interception
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-2-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260814072954.915-2-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.22f3.5a8b2de27159610a.19fffbdaeec.3ef98e1fcb027c2e=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786702049005
X-purgate-ID: tlsNG-d62444/1786702050-1FA6E757-00BC6E60/0/0
X-purgate-type: clean
X-purgate-size: 1744

---=Part.22f3.5a8b2de27159610a.19fffbdaeec.3ef98e1fcb027c2e=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 09:30, Owen Smith wrote:
> Truncate incomming strings to fit inside a Slot's Buffer
>=20
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

> ---
>   src/xen/log=2Ec | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
>=20
> diff --git a/src/xen/log=2Ec b/src/xen/log=2Ec
> index 8673105=2E=2E93039f6 100644
> --- a/src/xen/log=2Ec
> +++ b/src/xen/log=2Ec
> @@ -545,6 +545,7 @@ LogDebugPrint(
>   {
>       PLOG_CONTEXT        Context =3D &LogContext;
>       KIRQL               Irql;
> +    ULONG               Length;
>       PLOG_SLOT           Slot;
>  =20
>       UNREFERENCED_PARAMETER(ComponentId);
> @@ -571,9 +572,14 @@ LogDebugPrint(
>  =20
>       Slot =3D &Context->Slot[Context->Pending++];
>  =20
> +    // truncate long log lines - avoid buffer overrun on Slot->Buffer
> +    Length =3D Ansi->Length >=3D LOG_BUFFER_SIZE ?
> +                            LOG_BUFFER_SIZE - 1:
> +                            Ansi->Length;
> +
>       Slot->Level =3D 1 << Level;
> -    RtlCopyMemory(Slot->Buffer, Ansi->Buffer, Ansi->Length);
> -    Slot->Offset =3D Ansi->Length;
> +    RtlCopyMemory(Slot->Buffer, Ansi->Buffer, Length);
> +    Slot->Offset =3D Length;
>  =20
>       ReleaseHighLock(&Context->Lock, Irql);
>  =20



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.22f3.5a8b2de27159610a.19fffbdaeec.3ef98e1fcb027c2e=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 10:08:13 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 10:08:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390994.1631078 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuoph-0001gL-Pp; Fri, 14 Aug 2026 10:08:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390994.1631078; Fri, 14 Aug 2026 10:08:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuoph-0001gE-NF; Fri, 14 Aug 2026 10:08:13 +0000
Received: by outflank-mailman (input) for mailman id 1390994;
 Fri, 14 Aug 2026 10:08:12 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbe431b000c4f3@swg.vates.tech>)
 id 1wuopg-0001g4-5T
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 10:08:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuopf-005mXP-4d
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 12:08:11 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbe431b000c4f3@swg.vates.tech>)
 id 6a7ee8ff-e002-0a2a0a5209dd-0a2a450cd88e-28
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:08:11 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbe431b000c4f3@swg.vates.tech>)
 id 6a7ee90a-f479-0a2a450c0019-b9ff1c22acf9-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:08:11 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fffbe431b000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 10:08:06 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5171281BED;
 Fri, 14 Aug 2026 12:08:06 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=ZfvZDarWLwBmp0sC6lQrZt4x8KYtBBHtbWVjsgP+Hxs=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=f9aS7hFDvEebHQudxoNS98YYaMuQgOb2bAYRJgRvS86RrgzyPpYdc+4HYXBieBo9VpJuwdT8f
 sg08AYx1QAOhjrxSO+4JBOkVMx5Zh7kQjFWVx1Sq/6FhuGV+NaDGO5mZUyweyZbc0B7cZ4lwBKS
 Hu3RNpQc7bZVlzZThicqy5GOJ+OlqBvUUb8X8lcM4DMbyKyaE946gp3DJ5tUx+ju0vSxmZ2Vv78
 ZmMdcYGCgX6dNNrKNX8O9xjax2NBGYvItGwWjJGcb6dBO9QyyTSOnh7ry7haavrGabAHzaN2gjm
 904uOFdIN3v5SpQ3rszXYdf9vjtqrUFz06kUZ2LB/KNg==
X-Zone-Loop: 7dabb7932017e234410350d20e5ba45fa80f14d8fb7c
x-campaign-type: default
x-transaction-id: 8fb68156-e68d-41c4-83ed-726db0786408
x-swg-uid: 01-1b16943c-e596-4994-a649-9dfec94bb113
X-Mailer: Sweego
Message-ID:
 <1786702087.8631fc262581453bbf619ec5b2062170.19fffbe431b000c4f3@vates.tech>
x-swg-bid: 1786702087.8631fc262581453bbf619ec5b2062170.19fffbe431b000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 12:08:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/8] evtchn: Dont Release SHARED_INFO interface if Acquire
 failed
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-6-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260814072954.915-6-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.22f4.47d51413680f8db1.19fffbe4107.df24876ee189c845=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786702086407
X-purgate-ID: tlsNG-d25034/1786702091-52132A5B-D9AC2B64/0/0
X-purgate-type: clean
X-purgate-size: 1096

---=Part.22f4.47d51413680f8db1.19fffbe4107.df24876ee189c845=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 09:30, Owen Smith wrote:
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

> ---
>   src/xenbus/evtchn_2l=2Ec | 2 --
>   1 file changed, 2 deletions(-)
>=20
> diff --git a/src/xenbus/evtchn_2l=2Ec b/src/xenbus/evtchn_2l=2Ec
> index 21b48f0=2E=2E0dfb60a 100644
> --- a/src/xenbus/evtchn_2l=2Ec
> +++ b/src/xenbus/evtchn_2l=2Ec
> @@ -194,8 +194,6 @@ done:
>   fail1:
>       Error("fail1 (%08x)\n", status);
>  =20
> -    XENBUS_SHARED_INFO(Release, &Context->SharedInfoInterface);
> -
>       --Context->References;
>       ASSERT3U(Context->References, =3D=3D, 0);
>       KeReleaseSpinLock(&Context->Lock, Irql);



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.22f4.47d51413680f8db1.19fffbe4107.df24876ee189c845=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 10:08:23 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 10:08:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390996.1631082 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuopr-0001jW-S0; Fri, 14 Aug 2026 10:08:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390996.1631082; Fri, 14 Aug 2026 10:08:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuopr-0001jP-PB; Fri, 14 Aug 2026 10:08:23 +0000
Received: by outflank-mailman (input) for mailman id 1390996;
 Fri, 14 Aug 2026 10:08:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbe73f1000c4f3@swg.vates.tech>)
 id 1wuopq-0001j8-4Y
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 10:08:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuopp-000mLC-HV
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 12:08:21 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbe73f1000c4f3@swg.vates.tech>)
 id 6a7ee910-8faa-0a2a0a5109dd-0a2a45018500-16
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:08:21 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffbe73f1000c4f3@swg.vates.tech>)
 id 6a7ee915-5984-0a2a45010019-b9ff1c128f19-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:08:21 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fffbe73f1000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 10:08:19 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id EE21881BED;
 Fri, 14 Aug 2026 12:08:18 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=4c7QJTdoDxXFqYOERvVPC32lj2pcYPvmO9aNOYsomss=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=gv1IZdMggv2cIzO4kT5yY1Xmd+q+r/0D/TG6BTnZjLYrsxacYY2eTq0ok8MMPeHL5rOYM8lM8
 R7f5Wl08YTbzipM1Q3xgrAUJarJTKyGVTSa/Yp/nrHhAx19By2cfwCIBwVlzZ8wawHqKIzPfjtZ
 cHLDm2usXXLmGYUTq6THgo+Fx0re4nfIGDtrZ2g7eXp+grLXaqPUNfIO2lJVl/82+QE5v9gW109
 i30wMfD9SPPQz4rxWVR6zun4gDn9ZXkha9PPan16/CRguIvMszFtxtkFvBdwTTJBJ4JfeL3N/6+
 03q1vk3VsYRCxZ7PwlAvf6PVBMFqbDvWxe58BKJz34ZA==
X-Zone-Loop: 79ea342b9fda46ee4ec71274205321186e6c33f76a89
x-campaign-type: default
x-transaction-id: 46a22297-7f9e-404d-a005-b73b1fe64fdc
x-swg-uid: 01-15b865ec-3f68-445e-9453-c438684030dc
X-Mailer: Sweego
Message-ID:
 <1786702099.8631fc262581453bbf619ec5b2062170.19fffbe73f1000c4f3@vates.tech>
x-swg-bid: 1786702099.8631fc262581453bbf619ec5b2062170.19fffbe73f1000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 12:08:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 6/8] monitor: Check allocated pointer, not Context
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-7-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260814072954.915-7-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.22f5.cb924ce071f2a7cb.19fffbe7247.861b54713e24f39e=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786702099016
X-purgate-ID: tlsNG-d62444/1786702101-BE867757-014B09BA/0/0
X-purgate-type: clean
X-purgate-size: 1815

---=Part.22f5.cb924ce071f2a7cb.19fffbe7247.861b54713e24f39e=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 09:30, Owen Smith wrote:
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

> ---
>   src/monitor/monitor=2Ec | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>=20
> diff --git a/src/monitor/monitor=2Ec b/src/monitor/monitor=2Ec
> index 904badd=2E=2Eb7ee7ba 100644
> --- a/src/monitor/monitor=2Ec
> +++ b/src/monitor/monitor=2Ec
> @@ -1215,7 +1215,7 @@ GetDialogParameters(
>       TitleSize =3D (MaxValueLength + 1) * sizeof(TCHAR);
>  =20
>       Context->Title =3D calloc(1, TitleSize);
> -    if (Context =3D=3D NULL)
> +    if (Context->Title =3D=3D NULL)
>           goto fail2;
>  =20
>       Error =3D RegQueryValueEx(Context->ParametersKey,
> @@ -1237,7 +1237,7 @@ GetDialogParameters(
>       TextSize =3D (MaxValueLength + 1) * sizeof (TCHAR);
>  =20
>       Context->Text =3D calloc(1, TextSize);
> -    if (Context =3D=3D NULL)
> +    if (Context->Text =3D=3D NULL)
>           goto fail5;
>  =20
>       Error =3D RegQueryValueEx(Context->ParametersKey,
> @@ -1259,7 +1259,7 @@ GetDialogParameters(
>       QuestionSize =3D (MaxValueLength + 1) * sizeof (TCHAR);
>  =20
>       Context->Question =3D calloc(1, QuestionSize);
> -    if (Context =3D=3D NULL)
> +    if (Context->Question =3D=3D NULL)
>           goto fail8;
>  =20
>       Error =3D RegQueryValueEx(Context->ParametersKey,



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.22f5.cb924ce071f2a7cb.19fffbe7247.861b54713e24f39e=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 10:14:27 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 10:14:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390999.1631085 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuovi-0002xW-9N; Fri, 14 Aug 2026 10:14:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390999.1631085; Fri, 14 Aug 2026 10:14:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuovi-0002xP-6u; Fri, 14 Aug 2026 10:14:26 +0000
Received: by outflank-mailman (input) for mailman id 1390999;
 Fri, 14 Aug 2026 10:14:24 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffc3f5ff000c4f3@swg.vates.tech>)
 id 1wuovg-0002xE-Bn
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 10:14:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuovf-005nf2-OP
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 12:14:23 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffc3f5ff000c4f3@swg.vates.tech>)
 id 6a7eea7f-e002-0a2a0a5209dd-0a2a450bbb94-4
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:14:23 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffc3f5ff000c4f3@swg.vates.tech>)
 id 6a7eea7f-b7e8-0a2a450b0019-b9ff1c22af65-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:14:23 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fffc3f5ff000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 10:14:20 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id C781A80513;
 Fri, 14 Aug 2026 12:14:19 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=eouhNKdEf4Yx7JnL2Udj9zlfIYrRnwsxXkn9/VUkps0=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=N6Ujmf55+iEQQ6NUahXZq1NWaGSK1YRMQTjLCk8RwAz8djwaP3Z/e2tNz687gqeRzj4nEJ4TV
 ObyVk+PyBFJvK8OgCMrdUAIeTIz4bMy/SN25l68xPHK1bzcxTbZ4JoeXVyWCVcGFQsnTHshALmf
 X5Nn3EMY2O6/ckE889ZobSJTWr6n8jLXq58t+vSnP7Llfn4PyVr04AO3Rfo34Pb0/f7BjGRVDwu
 VuA1xUYUaIWNJ7ntQx4wX53dW4bxH+Ye9W6PYWBHocVDjCBlf6w+bx49vOaNpE4Rs2JGSta2gaz
 ZOWRPRzmUvxIgnU6XF2qam7Y56DQxfs/IrXF14jeAwCQ==
X-Zone-Loop: f4f3bf27ca5a6f0c4ddd5028f3d12c165766af72dc9c
x-campaign-type: default
x-transaction-id: 34a70b27-0550-4e77-a3e6-74a9a39b359c
x-swg-uid: 01-1d9c26fe-8fa9-4a56-bacb-9109ace90f4d
X-Mailer: Sweego
Message-ID:
 <1786702460.8631fc262581453bbf619ec5b2062170.19fffc3f5ff000c4f3@vates.tech>
x-swg-bid: 1786702460.8631fc262581453bbf619ec5b2062170.19fffc3f5ff000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 12:14:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/8] fdo: Use IoFreeMdl when IoAllocateMdl was uesd to
 allocate
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-4-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260814072954.915-4-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.22f6.2bdaf8b966c1a90b.19fffc3f3e7.957d272886f0e241=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786702459880
X-purgate-ID: tlsNG-42698a/1786702463-A9EC69EA-ACB611B3/0/0
X-purgate-type: clean
X-purgate-size: 994

---=Part.22f6.2bdaf8b966c1a90b.19fffc3f3e7.957d272886f0e241=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 09:30, Owen Smith wrote:
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

> ---
>   src/xenbus/fdo=2Ec | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/src/xenbus/fdo=2Ec b/src/xenbus/fdo=2Ec
> index 6b46c8c=2E=2E2e8f2e6 100644
> --- a/src/xenbus/fdo=2Ec
> +++ b/src/xenbus/fdo=2Ec
> @@ -3387,7 +3387,7 @@ FdoPciHoleFree(
>                                 Count);
>       ASSERT(NT_SUCCESS(status));
>  =20
> -    ExFreePool(Mdl);
> +    IoFreeMdl(Mdl);
>   }
>  =20
>   static PMDL



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.22f6.2bdaf8b966c1a90b.19fffc3f3e7.957d272886f0e241=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 10:21:00 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 10:21:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1391002.1631090 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wup23-0004UT-PF; Fri, 14 Aug 2026 10:20:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1391002.1631090; Fri, 14 Aug 2026 10:20:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wup23-0004UL-MP; Fri, 14 Aug 2026 10:20:59 +0000
Received: by outflank-mailman (input) for mailman id 1391002;
 Fri, 14 Aug 2026 10:20:58 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffc9f22b000c4f3@swg.vates.tech>)
 id 1wup22-0004UF-Bu
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 10:20:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wup21-0091Yu-Bc
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 12:20:57 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffc9f22b000c4f3@swg.vates.tech>)
 id 6a7eebfe-2eae-0a2a0a5409dd-0a2a4509d82e-16
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:20:57 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fffc9f22b000c4f3@swg.vates.tech>)
 id 6a7eec08-be1a-0a2a45090019-b9ff1c128f93-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 12:20:57 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fffc9f22b000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 10:20:52 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 13C6981C5E;
 Fri, 14 Aug 2026 12:20:52 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=QU3sSKOs7btVaMMIcRGOtmUIw+O+bhr2wT9JijS3yvE=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=mjYAmJI1wGz7M0F0ix7Ip559rxnU4GvIHu0y+TCvFOOQ+C3yTpCdxgasOyJxCOIBXCrm+9R5f
 Fc8H1MGvLMPF7Mu4iTmPGPBWaEPwpkufVHASPF9QSqFxigLgs4cHg6/14GbV+c2k3gY0tpczisD
 6cmf2DRtOu1OKSZs9EInzo0/ci+GrtIcRFHHq7yS2mYCbSzbjVN0z7Vtj6lzilatNojghSAA9v4
 bQGAJguu8Os94f2it6j4eNXnadL2HRVVroUmGEemccUHUpPHnJQcNlLiCbTZpCWHZtBPyAL1W+o
 hLg4X9fwxh1vjmshY7JO7y7y4d12bCC8FWa+Fmbor3fg==
X-Zone-Loop: 9c8667550580dc21a0eb26cacbc6d359d64372cf054c
x-campaign-type: default
x-transaction-id: 2e053674-3336-4ace-8579-7455ce92d790
x-swg-uid: 01-1bbe5845-c443-42b6-967f-cc6c715101fa
X-Mailer: Sweego
Message-ID:
 <1786702852.8631fc262581453bbf619ec5b2062170.19fffc9f22b000c4f3@vates.tech>
x-swg-bid: 1786702852.8631fc262581453bbf619ec5b2062170.19fffc9f22b000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 12:20:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/8] store: Detect bad response from xenstored
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-3-owen.smith@citrix.com>
 <1786701941.8631fc262581453bbf619ec5b2062170.19fffbc0977000c4f3@vates.tech>
Content-Language: en-US
In-Reply-To: <1786701941.8631fc262581453bbf619ec5b2062170.19fffbc0977000c4f3@vates.tech>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.22f8.d1fe3fe31212bc47.19fffc9f025.4333acfbd94e4fc7=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786702852133
X-purgate-ID: tlsNG-bad1c0/1786702857-BD0CD034-1B69DCEE/0/0
X-purgate-type: clean
X-purgate-size: 1668

---=Part.22f8.d1fe3fe31212bc47.19fffc9f025.4333acfbd94e4fc7=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 12:05, Tu Dinh wrote:
> On 14/08/2026 09:30, Owen Smith wrote:
>> Detect when Header=2Elen is larger than allowed, and fail the request=
=2E
>>
>> Assisted-by: ClaudeCode:claude-opus-4=2E8
>> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>
>=20
> Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
>=20
> NB: xencrsh/store=2Ec would likely benefit from the same change=2E
>=20
>> ---
>>    src/xenbus/store=2Ec | 4 ++++
>>    1 file changed, 4 insertions(+)
>>
>> diff --git a/src/xenbus/store=2Ec b/src/xenbus/store=2Ec
>> index 503144a=2E=2Ee2a0031 100644
>> --- a/src/xenbus/store=2Ec
>> +++ b/src/xenbus/store=2Ec
>> @@ -519,9 +519,13 @@ StoreReceiveResponse(
>>   =20
>>        ASSERT(StoreVerifyHeader(&Response->Header));
>>   =20
>> +    status =3D STATUS_INVALID_BUFFER_SIZE;
>>        if (Response->Header=2Elen =3D=3D 0)
>>            goto done;
>>   =20
>> +    if (Response->Header=2Elen >=3D XENSTORE_PAYLOAD_MAX)

Never mind, shouldn't this be Response->Header=2Elen > XENSTORE_PAYLOAD_MA=
X?

>> +        goto done;
>> +
>>        Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT]=2ELengt=
h =3D Response->Header=2Elen;
>>        Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT]=2EData =
=3D Response->Data;
>>   =20
>=20
>=20
>=20



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.22f8.d1fe3fe31212bc47.19fffc9f025.4333acfbd94e4fc7=---


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 11:56:09 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 11:56:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1391063.1631103 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuqW8-0002C8-AM; Fri, 14 Aug 2026 11:56:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1391063.1631103; Fri, 14 Aug 2026 11:56:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuqW8-0002C1-7S; Fri, 14 Aug 2026 11:56:08 +0000
Received: by outflank-mailman (input) for mailman id 1391063;
 Fri, 14 Aug 2026 11:56:07 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wuqW7-0002Bv-7q
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 11:56:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuqW6-009HxW-De
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 13:56:06 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7f0250-bab6-0a2a0a5309dd-0a2a4502acec-16
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 13:56:06 +0200
Received: from [52.101.56.47]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7f0255-6ca4-0a2a45020019-3465382f1329-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 13:56:06 +0200
Received: from SA6PR03MB7760.namprd03.prod.outlook.com (2603:10b6:806:43c::5)
 by MW4PR03MB6396.namprd03.prod.outlook.com (2603:10b6:303:123::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.14; Fri, 14 Aug
 2026 11:56:01 +0000
Received: from SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::4d5b:a91f:46a3:4b38]) by SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::4d5b:a91f:46a3:4b38%3]) with mapi id 15.21.0315.014; Fri, 14 Aug 2026
 11:56:01 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=oGjZsh8im3ROZv0nDoIkVe4JSSrO1mnGw3UIRab6DlbKmR79fl20Wpo5pmvQ3n2X1o+/iKwAYFje/o/EW9EWdfvYQqCsnf/KUmRCUazYtcXSTTwZr6V/DEv+VAeEX9RulZ7y/h4NFZNawxLhe60ZfO3IW08jLqt6vu5JcsD8CStF4TL0wPG0AOlmk0FHSxG0QPDo8UF+F8G4Ai+6eCHe4dbreUyWkAVYFFAhFx/GoeiYI69splCxNdYGCdTjygKeW0aNtjdMw3JFsA606wf0RQwPeehFkYgNxmznNw5UD131RqV8jG1RkWCXzVEWzA2COZkgfPCfFyJXMYPbj4B6sQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=D5gs/OWDMKlku6YJdb4fEcYi0pZDkt3M1wVhW5KMa/M=;
 b=Ypi836H9AnYckyA33u+B55a2w8g7pi1/T+SEwPxWqxbAjbSMzM0DRnL2JufWspVdS8uGSy+hLtnvgYN/F3hAlVpe+jgTLZbq+m96xiDwyBe4hfm3O+6zFS3vRjFBNvrdzILVYDj/uF6z0TeRauj/mIwhLB0L0BECM41767rEZPghXW0jiYCoe9OvvPAf+F928Lks8yBBndyn+WLfqaiVfMiL28pTQY/0DIU1yxxOYm/ib9kqKQ+VwZwQ8jEzgfR/Ku55D3yo8aHSbOdLYshucLBrMz6XwefZh8i9DwVxjRjpEpNd4cfqe4M4Wns/VV8DaDLR1TR5T8sztCXAT4Zs5Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=D5gs/OWDMKlku6YJdb4fEcYi0pZDkt3M1wVhW5KMa/M=;
 b=us8zc+JdP+t34YLxd/ri3yZLuEJgfWC8gz2QwVAVHHvc31f8DIxp+lZ1xpeWyC/1FMmZ+o1RxXbkVcWMQ6k1kiwiIVkk4A2wnPPaO+Jh9vh3M1BkDZpBLj2l4MdupdaU5OCQghrC3JETCsnClzUwy/J7jg8hSiph0mHBrTcV2o0=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/8] store: Detect bad response from xenstored
Thread-Topic: [PATCH 2/8] store: Detect bad response from xenstored
Thread-Index: AQHdK768zhqQw1MYN06mzc7hyPIosLadUW4AgAAEPoCAABoLVA==
Date: Fri, 14 Aug 2026 11:56:01 +0000
Message-ID:
 <SA6PR03MB7760C0CD406C3F87C0893D6AFEDA2@SA6PR03MB7760.namprd03.prod.outlook.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-3-owen.smith@citrix.com>
 <1786701941.8631fc262581453bbf619ec5b2062170.19fffbc0977000c4f3@vates.tech>
 <1786702852.8631fc262581453bbf619ec5b2062170.19fffc9f22b000c4f3@vates.tech>
In-Reply-To:
 <1786702852.8631fc262581453bbf619ec5b2062170.19fffc9f22b000c4f3@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA6PR03MB7760:EE_|MW4PR03MB6396:EE_
x-ms-office365-filtering-correlation-id: 3c824647-5dc4-47bc-0e71-08def9fb02b3
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|366016|23010399003|22082099003|18002099003|56012099006|11063799006|38070700021|10067099003|4143699003;
x-microsoft-antispam-message-info:
 X7cEBhscn3tc2c2CxqLhbScwSYx/D6h3yiT5qDUba6iqj6lw+bt6S8jrUg4cmA3H3y5aJX3/MKdOnKmPvQJsSZXgmb3yRIyLCFG2x9Nzrr5cj11Xo5jxiUcXqv2YYnNIa3COlK34sUA/5j5rzDIihAMKQn74keAmHvt3ntaOy3Voen8tqY862qRybU3ncpDTclrEXs/hDgyyl5fw3Uu5oD6xU6QoeXdAooIuvZHlNL3hhSCOIOl9w+GQjxTFELZ9Ws64JcC95Y71Bqanxa3cBTOcovsTMiX7oSVwTaIjNKO/yvALftju5QB0aKrR6jgxZwt0COUX+QvJQHMXWmcvKgE5lPieavuV+4XD1GTjUzxKjk87o5FovR7ilyY/s7NURtI/DvexMk0imhy0gD5KcWBuTReyMRCS+4uHRTqkK884LQ/8mSY1MmEVn47obhgJ/tqersPhyOgRaCuG1hHJikzYM6MNRSk7g+lqoy0K/hJOlZ0r0Efc0LkKwnzYf7RYGc9ZtqJRq35K7reo3AOntTJPfNoRZc83+Oop0FKQ0ckL7DemTjsTd+UQxBAaGjEDM4F+MOt/MHh2px0y+QLiEr3WHbySHvMPulok4FV6cwMwG712zKwhsLw6SFVuulMHltsYIZ2z8Ww9rAyiBJNl/0MfyFcmTAQbMUIAcXAQLL8W21Fac7apHUtLpfR+YSTgQ48ZT2agt6wRIvC9PN6kaA==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA6PR03MB7760.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(23010399003)(22082099003)(18002099003)(56012099006)(11063799006)(38070700021)(10067099003)(4143699003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?T5YbAdPgXhL1siliPHP5Z0b8icdTEycKfF2aiuFLy9ilGukHyG6S5SisAf?=
 =?iso-8859-1?Q?D1KYXtUMpORYhX0Dy9cLlVMMe2TK5V8RHZCj19Q2eZnm8cR5iUKdbM7vL8?=
 =?iso-8859-1?Q?sLuV8F97HtC8HjerZM6YH2iDibc9i8VJyikgUkTlzkzxELz4kHpuzYoFOj?=
 =?iso-8859-1?Q?IRF0cATVx+ps02I7/SqPxmB2MTGyXeqgoRku5sjbxgvTH36bBD+ia8L7AJ?=
 =?iso-8859-1?Q?Wj9siu0K9qZzYpbMLgYSnY/Eu1h+fGaKSRxx7M9riWp3HnO28/IeGAzGCz?=
 =?iso-8859-1?Q?WOui1OIe58vaYNKDv7iWcdSJDeeR8jVBi1PfVLyo1fZ1EX6peYVb3Cy3Rn?=
 =?iso-8859-1?Q?nuuErAptJHAgtQgrFaepbYgy3sM3ZvlyEWB3VWz+PCzb1FLD7UcDQOaKLE?=
 =?iso-8859-1?Q?mr4FGloaK+tILHCk69bP0rsiAxtkYyxHHiK6yby/7pHZeBkFCEbI3EwH1K?=
 =?iso-8859-1?Q?OJBhIJiWqwdNj2Yq3x5nXAdN6WJQYQetXhs+wi2yvOkhpGcZhQV7wLcVOk?=
 =?iso-8859-1?Q?+O5ZCIcbn1L5X52AyFlmLGmWzhOUaI8aYklE6GEvnTu5qcNLngkW+wCcoR?=
 =?iso-8859-1?Q?GyOFpnUTkRibmBvZ+P/pNFrd5152HD/MxsWUdla4RCSErodX3NEtEKnlgG?=
 =?iso-8859-1?Q?59PEOowzjsvJ6eveo+Fyp5b1SSWT3DxTDddEp+PG8ORUkgI8/fnXz80PYJ?=
 =?iso-8859-1?Q?AVFXN8x14naW24O7Vo229xi1Jl37Q43uTLR+qYltLEKzRRuDe90LIdfHxf?=
 =?iso-8859-1?Q?JPFSbcrYyPsPJTHea1oxNeCESR0KW38IRPDyFWze3Ho++BYUawdjzudUFk?=
 =?iso-8859-1?Q?5LH4jdt4b9unHYg+zaC6rnSsoPaIHDrpnNHIZUbW0lKcKROt2YeOZ3a7uH?=
 =?iso-8859-1?Q?/DKuWdjsvC0qLb/RAjfy/AbhzEwHikvvB9dEwSpzZmPKgfwqiMewt5QxSD?=
 =?iso-8859-1?Q?/Eiqnet4fKY25IOipTAaoodueVsZvQb+QK7T1F1mN/fx/p6Bei9i7+MtBo?=
 =?iso-8859-1?Q?ITCXoMKGJrYSziH+eHuZBircgy/mVMreWqeXoGRc8ER/sVuKQwAX0iCZWj?=
 =?iso-8859-1?Q?zOIGVnxKpV9ziLifivQ49woo+KpuWBMRMaYDCqtpdYMIOVXhcK8FKSk3Lu?=
 =?iso-8859-1?Q?LQuRwqRZOKTWlBQw2E42pbq3K5BrI9JQb2WqdOD/mFL7rHh8Bt2NJcmM2y?=
 =?iso-8859-1?Q?2Yc5L23UrmFCJXweiTjiPxfFYU3Bfl71ziWuWOavMGtVcpbWsIPbWxAiAd?=
 =?iso-8859-1?Q?ztXRtHvxZNCCmd1D/2CeZfaLEV2jJUnvCrCmOb6Z0bVjoHeMAeJli8l4wF?=
 =?iso-8859-1?Q?vJG+xODFIMtnZ/LkFiqtEu26fIvJkYcqehSIz2MRwao9/qW3EXbBnwlOJW?=
 =?iso-8859-1?Q?XkLb8rBRJEQ26oJc6h5o4hCN9G0yOg3j1m6tRDctCWtK5n/34q/QgOsnKi?=
 =?iso-8859-1?Q?poqUoXn+ZRtmBwTVH9dgimtsGpQ/8ude1uuVDYNkEdq4rff48esPjrd/DW?=
 =?iso-8859-1?Q?LrSsZKWgBl71U3tOmZnBxCK8UgfEYgMnlhqCIV2wSoQjbCpT6OhpCiCeol?=
 =?iso-8859-1?Q?nKioagShEO690UmT7+HA76J9ifdwQnBvOn/3IpubG0kzaxHd6EHYfhIAY5?=
 =?iso-8859-1?Q?ipQF/+FXQye7mfxYaFEWic6zYZoXGnHwJq+XsAZhlrBQ0ByYD2eUq+mSBt?=
 =?iso-8859-1?Q?PQ0Kf5LkjqefH7NEbX5XYNf5SdKo2NuHqkIsdyr1N4Q0DQVQ+sMRQa43nU?=
 =?iso-8859-1?Q?BMnatzgzz3UPckr+JX1u+BjSm5LZQAW2H4Cssz9HygnSTc?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA6PR03MB7760.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3c824647-5dc4-47bc-0e71-08def9fb02b3
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2026 11:56:01.0458
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: wrDYNcfxddu/4QT/Sc/cCcdp9zwFVwK72NW9lBvU4zQ0IwhN/RDyQKGVFJ9tyaZnJyxKEQrNbk0fywWOTqM+AQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6396
X-purgate-ID: tlsNG-720697/1786708566-F18AC2AC-19061FE4/0/0
X-purgate-type: clean
X-purgate-size: 1773

>From: Tu Dinh <ngoc-tu.dinh@vates.tech>=0A=
>Sent: 14 August 2026 11:20 AM=0A=
>To: Owen Smith; win-pv-devel@lists.xenproject.org=0A=
>Subject: Re: [PATCH 2/8] store: Detect bad response from xenstored=0A=
>=0A=
>On 14/08/2026 12:05, Tu Dinh wrote:=0A=
>> On 14/08/2026 09:30, Owen Smith wrote:=0A=
>>> Detect when Header.len is larger than allowed, and fail the request.=0A=
>>>=0A=
>>> Assisted-by: ClaudeCode:claude-opus-4.8=0A=
>>> Signed-off-by: Owen Smith <owen.smith@citrix.com>=0A=
>>=0A=
>> Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>=0A=
>>=0A=
>> NB: xencrsh/store.c would likely benefit from the same change.=0A=
>>=0A=
>>> ---=0A=
>>>    src/xenbus/store.c | 4 ++++=0A=
>>>    1 file changed, 4 insertions(+)=0A=
>>>=0A=
>>> diff --git a/src/xenbus/store.c b/src/xenbus/store.c=0A=
>>> index 503144a..e2a0031 100644=0A=
>>> --- a/src/xenbus/store.c=0A=
>>> +++ b/src/xenbus/store.c=0A=
>>> @@ -519,9 +519,13 @@ StoreReceiveResponse(=0A=
>>>=0A=
>>>        ASSERT(StoreVerifyHeader(&Response->Header));=0A=
>>>=0A=
>>> +    status =3D STATUS_INVALID_BUFFER_SIZE;=0A=
>>>        if (Response->Header.len =3D=3D 0)=0A=
>>>            goto done;=0A=
>>>=0A=
>>> +    if (Response->Header.len >=3D XENSTORE_PAYLOAD_MAX)=0A=
>=0A=
>Never mind, shouldn't this be Response->Header.len > XENSTORE_PAYLOAD_MAX?=
=0A=
>=0A=
=0A=
I was thinking that a length of 4096 should fail, so there is space in the =
buffer for a terminating null.=0A=
=0A=
>>> +        goto done;=0A=
>>> +=0A=
>>>        Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT].Length =
=3D Response->Header.len;=0A=
>>>        Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT].Data =
=3D Response->Data;=0A=
>>>=0A=
>>=0A=
>>=0A=
>>=


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 11:58:09 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 11:58:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1391065.1631107 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuqY5-0002d2-HG; Fri, 14 Aug 2026 11:58:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1391065.1631107; Fri, 14 Aug 2026 11:58:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wuqY5-0002cU-EB; Fri, 14 Aug 2026 11:58:09 +0000
Received: by outflank-mailman (input) for mailman id 1391065;
 Fri, 14 Aug 2026 11:58:08 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wuqY4-0002aN-5G
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 11:58:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wuqY3-00G02b-2r
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 13:58:07 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7f02c6-e002-0a2a0a5209dd-0a2a4505d492-30
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 13:58:07 +0200
Received: from [52.101.193.62]
 (helo=CH1PR05CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a7f02cd-4cb1-0a2a45050019-3465c13e9a2a-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 13:58:06 +0200
Received: from SA6PR03MB7760.namprd03.prod.outlook.com (2603:10b6:806:43c::5)
 by SA0PR03MB5545.namprd03.prod.outlook.com (2603:10b6:806:c0::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.15; Fri, 14 Aug
 2026 11:58:02 +0000
Received: from SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::4d5b:a91f:46a3:4b38]) by SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::4d5b:a91f:46a3:4b38%3]) with mapi id 15.21.0315.014; Fri, 14 Aug 2026
 11:58:01 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=SRcPIz9gBJ63WoHkMkf5mJvJyOeFP4dsJT6jUWdTLtxncv84nWrxbwKcv92ZKHh2SYKjweYcgYUcp669hpUuUlhcd9U1vp4642iHrhqPtEXJ1Om8xoDDCTQdsJqz2mRh5qRZVK8nDwIkDaDVb4WkApYk1KRc+rTagRvOTyZUhgeH8nubj3z/7uWcs02ZoE4Ld9vVnScUn1UYH/veWuu1G95/V74M36HSQ6OEa08zpRSnlVjD835Nmwk/AkOVmKSctoq0+BHlh2AmuhERwMDC7z2W5fRcr+vAeyuFTLxT0/EHLDv3PEkLCIY/OJKbn5hlOp+8D2VpjCWYPbz8ZjjDgA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RAFnGhvrcwPPgmz5IRYh4beY2DEJr+2vb2ASy2CBPDg=;
 b=iDdmq2tDlkC0VuCUV6kqjBT1LFwSi5yjX5jCe0bVul4p2Gfkmf9KrQ72QrOlfJJ9luyyUsq2VkdPkgDxV3yzNAymEm0bbb9J4NOUz6MsRr2RAqT0JiUwHGVFRJOe6D4EFGjyA9GRjSvDniz2RDfRqaovL6kZxn9yEPZMrx/ukS25h0tg/oBMScRQ7p4owSpuxJqw7CHnkqHfT2GUQsI+bqc+e0lWl9MSYp6AStS+/HPOflPCIqT1eLWg27+JY2ZxTfb0CHNf1lMKmJZMareyQ16XkqeLzrNKbF6z2/srnl9Nts+ab41WcABD51ToM++/oU0VfpnQT0/uUA1k2iGIqA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RAFnGhvrcwPPgmz5IRYh4beY2DEJr+2vb2ASy2CBPDg=;
 b=FJRBIENCv47gZVIHTWwbN1h/07901kO2qcBkXcLizlkMvqv6i93D1u3vUSHbNMhvz+WT0MZBSfwM1DzDZxDQBUcRjSEuYe1qdnsvyre4lp1+k1xelokizcXi4S2eo/VIfvUKsz5Xh1VpywiOQ+Vqk3AMzkwNA1gAS8PSE86RviY=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH 4/8] registry: Fix wrong truncation of Unicode.Length
Thread-Topic: [PATCH 4/8] registry: Fix wrong truncation of Unicode.Length
Thread-Index: AQHdK7681agTujSIwE+S8mNzjuInbradUQiAgAAfdVk=
Date: Fri, 14 Aug 2026 11:58:01 +0000
Message-ID:
 <SA6PR03MB77601D3AED98A67D8E25CFB3FEDA2@SA6PR03MB7760.namprd03.prod.outlook.com>
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-5-owen.smith@citrix.com>
 <1786701857.8631fc262581453bbf619ec5b2062170.19fffbac0a7000c4f3@vates.tech>
In-Reply-To:
 <1786701857.8631fc262581453bbf619ec5b2062170.19fffbac0a7000c4f3@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA6PR03MB7760:EE_|SA0PR03MB5545:EE_
x-ms-office365-filtering-correlation-id: fdcd6165-70c1-4ef1-4120-08def9fb4a5a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|23010399003|376014|366016|18002099003|22082099003|38070700021|56012099006|10067099003|4143699003|11063799006;
x-microsoft-antispam-message-info:
 xw1s5IAieIk+5UmQ6nxDk03TZEYefA/SlOSrMTuLNhe97FfNonP87XjpLwTj/3VzOUpsXD4myxnkHLYugGLJQF2W+4wZnDd5cZaYz9mgdImX4C8yNpm2HtpMyaK5Agoh5LFLZY4/bQfhQNR3e7kJWGyF8wFTm6hyJnygvt/aGvfZwgrcMXMZbYwF4OtloxiXSdhmZhpqOXIzdP6Clduyb/TXSkpOkm6yOvVDVqY/Ux4SxOx7aiJOEpSUOn6dN64EhwTQZ/NS2OSXV5BWhHUmREPtOfANeVTTxiDfwDIcjl3y0PMSOvm9yN4Gvi5z+O8l9PK3XavbB4+D67sRZPNIkkWi+0MvGw2Tac4+HKUr8jtHk5mdpc0JcO/FxhiHMAEhb/DkttVtt9QmKBkjZjLoGyUrO/tzOZVr3bBpgVOCJZTDPiAjR8oHL/S8W8acPKFQqfHoZef+Yom5X1tx4gyr712UF9pN7kkCq4WEy7cnPLIQB013CNtiv86aworGKbOkNKoZ9GwLW+nzZSSwC8CnpfgohNcqtL/VyGRILKa+OUQG4Rx9Rg8gU+7BihySwzAuY3zyp89fcA+QHNMXxVoAKz8y/bPFp/XAy8LrankI1P6cU6eeVXdlB6qjGzmt4y1EbdzjmCDx0v7ZPRF1az8sFzU1RkfIN+SH6eCPXZrwyuXzdAktJr+DVFemADFBB2QjJR62Q6vF2Se1suQQh1M/++9+fous7RSJkWAK9KTUb2g=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA6PR03MB7760.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(376014)(366016)(18002099003)(22082099003)(38070700021)(56012099006)(10067099003)(4143699003)(11063799006);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?3JrkZVfudM9ifDEJNkZpkkFlF8ZdcbtRMaYmFoqf7oFsDgU1iBW+W/nC1e?=
 =?iso-8859-1?Q?IAP02Ab+m6kdYa0zCY733IL1sWoTPh44Ber+xlAbj6+raVTY5mWqG8HjFG?=
 =?iso-8859-1?Q?bPb80cC9yxkkyqfWlhL5CyOuv8qeouOAL6GOB8acFULo6++ThyB3IeQTIv?=
 =?iso-8859-1?Q?Mra30dvSwtegQOm/8y7PNk8x0uksKEGD+tJn5HI1cux+JlmvlsPW5+fyj0?=
 =?iso-8859-1?Q?6qRinRf+9Ph5wKCMT4bW9BqFVdOkL7DDmDq82IrFeDYjFbOX5gIwESGihT?=
 =?iso-8859-1?Q?kyb4D+r4uNV1Au5OwUW7+LHJqwb8l+sCduAHwH7Ob1kPpB9G2SwyKRCkgN?=
 =?iso-8859-1?Q?myfAHYzN0tIkLvMAn6NbwCEW+0cAGgcMyr+3N6Cg0JdMBBCVyVewLL5c/g?=
 =?iso-8859-1?Q?hkWmFfyjXIaVGMUY9DpH3tG1L8DHSznUJAoDR6ggQVYj6sLXvQDYokRRig?=
 =?iso-8859-1?Q?59DnaHssevuP13BU5nAFCi+qlM0VDoRbYphyhlTYWxRGUDGfXyAhcJXmJ+?=
 =?iso-8859-1?Q?0+66dBmwi8xbGGNy8VxvIgMj30bmgEDy2iyc88kWvbuf1q7DTb31Wl3je9?=
 =?iso-8859-1?Q?tIlPcerxL+znup4qQcI6L5tP77mhFxEZlr0NeW/XiZ2bnpsx9zsGL8l4uP?=
 =?iso-8859-1?Q?eP0xgvIGT5JIgHrDPfG4VFnyHKq1L68+3Fr528cq81JeeVffyseZWIQLLv?=
 =?iso-8859-1?Q?+kC08lQnwHNunwVU8LQ2zWuJQdnqp17SRTXjlfLK479JCdA454WFE1V7ir?=
 =?iso-8859-1?Q?n2HVTZz1ql7lpJO2fD6goGvVWa/i5YIekwnBOL3PqEM9QOzVvDN4R2wP0O?=
 =?iso-8859-1?Q?BkYDnW+eBE7MWx+tTC06piO40Sw+vfMNYwIw568meuC96nbK4N8XLxkK2h?=
 =?iso-8859-1?Q?7jkPXB9/wM4Njtg7Xm5WNr0PKiLyRaOSr/S/BYrtephp2MSNAGgYadBfyO?=
 =?iso-8859-1?Q?qyNyq8HfISTNul2ZFWinEtztBj29nzGKBsRfYHngajMtmcS3RKIZRV5KMc?=
 =?iso-8859-1?Q?DGeSciK5UA+mXUmjJiymWp/JY/4HXt/HlWGZ8rsgBftxA0+o9p8YyD21IK?=
 =?iso-8859-1?Q?83JeP8rIManF371hYNocaq0LH0jjIvirgTQClLpUS9Dd27LM2X8T6o3Yqx?=
 =?iso-8859-1?Q?ex186xMVPL/QmKwFL15hT+8y28ifkGXGx2yz5GZvU49tUn8vvZnblTZkLn?=
 =?iso-8859-1?Q?m1AyiKcqK6cyWdc8WaGat6BNfSTCMnURN4+c6z04aCs+H7smI8ATqgrpLz?=
 =?iso-8859-1?Q?MYzWMpOr0Qfmt719ifuV/iT535rNymBMhXEYG5v65uGKFHRuc7YtrQJXuO?=
 =?iso-8859-1?Q?VyNmjAXjO0aCvgASE1Ve8QxaApAf55gSgQ+/xwAk4f4/r16KotmYquu3pU?=
 =?iso-8859-1?Q?09KQ9sHJvufib9sLMbpb2jZO8lttkQ+PdwIFhAF6SPRdS5t9PTNWAsZO52?=
 =?iso-8859-1?Q?Lmagf7KNuwwmhT7sQsupBS3BeNhJLZ9twCVuObtcPMMDc1oAeka9wzJ4kk?=
 =?iso-8859-1?Q?i6a/syTDyzrjul7WRoc//bEaaK2IOyWI0T2PzrA+X4OnfVyv4mScmaPLMp?=
 =?iso-8859-1?Q?rIwjJFJeUeXgaH0d/e7tSahfDc/2H8A8yzA5fYSFCGlmR1wfIWXfXXKTxF?=
 =?iso-8859-1?Q?fyH96abyN2QS9ZVGNgZTq0zUmeNthbKTjNA+8jPR80ZFSYA6Ls5wK7EnuF?=
 =?iso-8859-1?Q?gJkI8VT+PHKraI1Qg1oaZ3LKm87cPM+hT7TKslxl7Hb1vEEnZOvwhc4Uex?=
 =?iso-8859-1?Q?QVEsmDtM3Sb89+Oj1TVinnIKFZKSFgMG0/F4kPthSc3Lpu?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA6PR03MB7760.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: fdcd6165-70c1-4ef1-4120-08def9fb4a5a
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2026 11:58:01.2119
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Q5mv3+EdsVR+tibe3eOqE4v4GZQW7cPuXM+PfTYOwmi3PvnxunYWxll24Xi+xSQUNAZIjSchX1hIM9srfJbIdw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5545
X-purgate-ID: tlsNG-c201ff/1786708686-F56AD2A1-16F976D1/0/0
X-purgate-type: clean
X-purgate-size: 1561

>On 14/08/2026 09:30, Owen Smith wrote:=0A=
>> Assisted-by: ClaudeCode:claude-opus-4.8=0A=
>> Signed-off-by: Owen Smith <owen.smith@citrix.com>=0A=
>> ---=0A=
>>   src/common/registry.c | 4 +++-=0A=
>>   1 file changed, 3 insertions(+), 1 deletion(-)=0A=
>>=0A=
>> diff --git a/src/common/registry.c b/src/common/registry.c=0A=
>=0A=
>Other drivers will need the same patch as well.=0A=
>=0A=
>> index 1f7a73c..204e2e8 100644=0A=
>> --- a/src/common/registry.c=0A=
>> +++ b/src/common/registry.c=0A=
>> @@ -1460,11 +1460,13 @@ RegistryAnsiToSz(=0A=
>=0A=
>Should RegistryAnsiToMultiSz be updated in the same way?=0A=
>=0A=
>>       if (Partial =3D=3D NULL)=0A=
>>           goto fail1;=0A=
>>  =0A=
>> +    ASSERT3U(Length * sizeof (WCHAR), <=3D, 0xFFFF); // MAX_USHORT=0A=
>> +=0A=
>=0A=
>If the intent is to unconditionally truncate if=0A=
>RtlAnsiStringToUnicodeString fails, I don't know if we would want=0A=
>another assert here. If that's not the case, wouldn't it be better to=0A=
>simply remove the truncation code path and fail?=0A=
>=0A=
=0A=
detecting an overrun and failing would be better - I will rework this patch=
=0A=
=0A=
>>       Partial->TitleIndex =3D 0;=0A=
>>       Partial->Type =3D REG_SZ;=0A=
>>       Partial->DataLength =3D Length * sizeof (WCHAR);=0A=
>>  =0A=
>> -    Unicode.MaximumLength =3D (UCHAR)Partial->DataLength;=0A=
>> +    Unicode.MaximumLength =3D (USHORT)Partial->DataLength;=0A=
>>       Unicode.Buffer =3D (PWCHAR)Partial->Data;=0A=
>>       Unicode.Length =3D 0;=0A=
>>  =


From win-pv-devel-bounces@lists.xenproject.org Fri Aug 14 14:45:52 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 14 Aug 2026 14:45:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1391227.1631156 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wutAM-0001oG-W6; Fri, 14 Aug 2026 14:45:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1391227.1631156; Fri, 14 Aug 2026 14:45:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wutAM-0001o8-Su; Fri, 14 Aug 2026 14:45:50 +0000
Received: by outflank-mailman (input) for mailman id 1391227;
 Fri, 14 Aug 2026 14:45:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a000bc6a5d000c4f3@swg.vates.tech>)
 id 1wutAL-0001o2-HV
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 14:45:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wutAK-00DlPo-Da
 for win-pv-devel@lists.xenproject.org; Fri, 14 Aug 2026 16:45:48 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a000bc6a5d000c4f3@swg.vates.tech>)
 id 6a7f2a00-bab6-0a2a0a5309dd-0a2a450b8aa8-32
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 16:45:48 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a000bc6a5d000c4f3@swg.vates.tech>)
 id 6a7f2a1b-b7e8-0a2a450b0019-b9ff1c228355-3
 for <win-pv-devel@lists.xenproject.org>; Fri, 14 Aug 2026 16:45:48 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a000bc6a5d000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 14 Aug 2026 14:45:43 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5AA0583699;
 Fri, 14 Aug 2026 16:45:42 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=fZrfIWR1dAGv1YyrMLZ9LvUszSyzzO9FWtZl5cku4F4=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=jyGxGHtyAUOf2zBgrc83+mAi6iCAnIyTO2td+VeIYaEcg/Pbd9x8085uIPkurEboTznP0m1QK
 OLSbzZ9VtEb9i6JJ6vTT/Kohm7Il+y9V5UQMr6vcxRBJSJtODN5jbj2OjmyHgTFFxKtqcdGRePi
 pT7RJd78VS7emliE1ii7J/HSHYTQByheowwcIjZiLDnPB6I8YfGOsgdKd6ialQzHbH5IcOenzCU
 t5PVCFgNPkPEy7DSiLqo4pP7dQfeqheE4EzRntexYy6pwwSebNZ/553kDitrAXIJVnbBwqatVxX
 7Mb1kerXyG+MAVEjMnSnECDzjJuRIBM+gds53tw1keeg==
X-Zone-Loop: dc471709e45341e5a0b8900acb636b992df87e05a822
x-campaign-type: default
x-transaction-id: 4471767a-ec7a-4aba-8bb8-806b42d5aed3
x-swg-uid: 01-9986793f-c049-40c6-8daf-d81872b0095d
X-Mailer: Sweego
Message-ID:
 <1786718743.8631fc262581453bbf619ec5b2062170.1a000bc6a5d000c4f3@vates.tech>
x-swg-bid: 1786718743.8631fc262581453bbf619ec5b2062170.1a000bc6a5d000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 14 Aug 2026 16:45:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/8] store: Detect bad response from xenstored
To: Owen Smith <owen.smith@citrix.com>,
 "win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
References: <20260814072954.915-1-owen.smith@citrix.com>
 <20260814072954.915-3-owen.smith@citrix.com>
 <1786701941.8631fc262581453bbf619ec5b2062170.19fffbc0977000c4f3@vates.tech>
 <1786702852.8631fc262581453bbf619ec5b2062170.19fffc9f22b000c4f3@vates.tech>
 <SA6PR03MB7760C0CD406C3F87C0893D6AFEDA2@SA6PR03MB7760.namprd03.prod.outlook.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <SA6PR03MB7760C0CD406C3F87C0893D6AFEDA2@SA6PR03MB7760.namprd03.prod.outlook.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2331.5ff58cb6c5351cee.1a000bc6792.e406630dbab54b33=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1786718742418
X-purgate-ID: tlsNG-42698a/1786718748-A9AC09EA-D0614BF7/0/0
X-purgate-type: clean
X-purgate-size: 2326

---=Part.2331.5ff58cb6c5351cee.1a000bc6792.e406630dbab54b33=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 14/08/2026 13:56, Owen Smith wrote:
>> From: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
>> Sent: 14 August 2026 11:20 AM
>> To: Owen Smith; win-pv-devel@lists=2Exenproject=2Eorg
>> Subject: Re: [PATCH 2/8] store: Detect bad response from xenstored
>>
>> On 14/08/2026 12:05, Tu Dinh wrote:
>>> On 14/08/2026 09:30, Owen Smith wrote:
>>>> Detect when Header=2Elen is larger than allowed, and fail the request=
=2E
>>>>
>>>> Assisted-by: ClaudeCode:claude-opus-4=2E8
>>>> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>
>>>
>>> Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
>>>
>>> NB: xencrsh/store=2Ec would likely benefit from the same change=2E
>>>
>>>> ---
>>>>     src/xenbus/store=2Ec | 4 ++++
>>>>     1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/src/xenbus/store=2Ec b/src/xenbus/store=2Ec
>>>> index 503144a=2E=2Ee2a0031 100644
>>>> --- a/src/xenbus/store=2Ec
>>>> +++ b/src/xenbus/store=2Ec
>>>> @@ -519,9 +519,13 @@ StoreReceiveResponse(
>>>>
>>>>         ASSERT(StoreVerifyHeader(&Response->Header));
>>>>
>>>> +    status =3D STATUS_INVALID_BUFFER_SIZE;
>>>>         if (Response->Header=2Elen =3D=3D 0)
>>>>             goto done;
>>>>
>>>> +    if (Response->Header=2Elen >=3D XENSTORE_PAYLOAD_MAX)
>>
>> Never mind, shouldn't this be Response->Header=2Elen > XENSTORE_PAYLOAD=
_MAX?
>>
>=20
> I was thinking that a length of 4096 should fail, so there is space in t=
he buffer for a terminating null=2E
>=20

xenstore=2Etxt specifies that: "The payload length (len field of the=20
header) is limited to 4096 (XENSTORE_PAYLOAD_MAX) in both directions"=2E=
=20
So my understanding is that this field should tolerate a value of 4096=2E

>>>> +        goto done;
>>>> +
>>>>         Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT]=2ELe=
ngth =3D Response->Header=2Elen;
>>>>         Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT]=2EDa=
ta =3D Response->Data;
>>>>
>>>
>>>
>>>



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2331.5ff58cb6c5351cee.1a000bc6792.e406630dbab54b33=---


From win-pv-devel-bounces@lists.xenproject.org Mon Aug 17 12:41:07 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Aug 2026 12:41:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392918.1631881 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweI-00042y-7C; Mon, 17 Aug 2026 12:41:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392918.1631881; Mon, 17 Aug 2026 12:41:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweI-00042r-4g; Mon, 17 Aug 2026 12:41:06 +0000
Received: by outflank-mailman (input) for mailman id 1392918;
 Mon, 17 Aug 2026 12:41:05 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wvweH-00042f-HD
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 12:41:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wvweG-002vl6-F4
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 14:41:04 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a83015e-e002-0a2a0a5209dd-0a2a4504a5f4-8
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:04 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a83015f-b57f-0a2a45040019-a0658308ede8-3
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:04 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id DBABD4434F02;
 Mon, 17 Aug 2026 08:39:18 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v2 0/8] Use AI to detected issues
Date: Mon, 17 Aug 2026 13:40:48 +0100
Message-ID: <20260817124057.831-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1786970464-532CCB50-F03766E5/0/0
X-purgate-type: clean
X-purgate-size: 1166

Issues detected with ClaudeCode:claude-opus-4.8 and patches
generated manually. AI was not used to generate any patches.
Adds the 'Assisted-by' tag to all commits to show which AI model
detected these issues.

* store: correct length test, and allow length of 0
* registry: detect the overrun and fail, rather than ASSERTing

Owen Smith (8):
  log: Avoid buffer overrun in DbgPrint interception
  store: Detect bad response from xenstored
  fdo: Use IoFreeMdl when IoAllocateMdl was uesd to allocate
  registry: Fix wrong truncation of Unicode.Length
  evtchn: Dont Release SHARED_INFO interface if Acquire failed
  monitor: Check allocated pointer, not Context
  high: Zero the HIGH_LOCK value, not the pointer
  Correct printf parameters

 src/common/high.h      |  2 +-
 src/common/registry.c  | 18 +++++++++++++++---
 src/monitor/monitor.c  |  6 +++---
 src/xen/bug_check.c    |  1 -
 src/xen/log.c          | 10 ++++++++--
 src/xenbus/evtchn_2l.c |  2 --
 src/xenbus/fdo.c       |  4 ++--
 src/xenbus/gnttab.c    |  1 +
 src/xenbus/store.c     |  4 ++++
 9 files changed, 34 insertions(+), 14 deletions(-)

-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Aug 17 12:41:08 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Aug 2026 12:41:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392919.1631886 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweK-00044w-9k; Mon, 17 Aug 2026 12:41:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392919.1631886; Mon, 17 Aug 2026 12:41:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweK-00044e-5v; Mon, 17 Aug 2026 12:41:08 +0000
Received: by outflank-mailman (input) for mailman id 1392919;
 Mon, 17 Aug 2026 12:41:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wvweJ-000443-5r
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 12:41:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wvweI-002vl6-J1
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 14:41:06 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a83015e-e002-0a2a0a5209dd-0a2a4504a5f4-22
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:06 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830161-b57f-0a2a45040019-a0658308aa62-3
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:06 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 11B6C4434F16;
 Mon, 17 Aug 2026 08:39:20 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v2 2/8] store: Detect bad response from xenstored
Date: Mon, 17 Aug 2026 13:40:50 +0100
Message-ID: <20260817124057.831-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260817124057.831-1-owen.smith@citrix.com>
References: <20260817124057.831-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1786970466-50EDEB50-88B07A4E/0/0
X-purgate-type: clean
X-purgate-size: 852

Detect when Header.len is larger than allowed, and fail the request.
A length of 0 is valid for some operations.

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/store.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/xenbus/store.c b/src/xenbus/store.c
index 503144a..b40ef3c 100644
--- a/src/xenbus/store.c
+++ b/src/xenbus/store.c
@@ -522,6 +522,10 @@ StoreReceiveResponse(
     if (Response->Header.len == 0)
         goto done;
 
+    status = STATUS_INVALID_BUFFER_SIZE;
+    if (Response->Header.len > XENSTORE_PAYLOAD_MAX)
+        goto done;
+
     Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT].Length = Response->Header.len;
     Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT].Data = Response->Data;
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Aug 17 12:41:08 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Aug 2026 12:41:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392920.1631891 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweK-00045N-Dn; Mon, 17 Aug 2026 12:41:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392920.1631891; Mon, 17 Aug 2026 12:41:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweK-000450-7l; Mon, 17 Aug 2026 12:41:08 +0000
Received: by outflank-mailman (input) for mailman id 1392920;
 Mon, 17 Aug 2026 12:41:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wvweJ-00044M-Oa
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 12:41:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wvweJ-002vl6-5N
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 14:41:07 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830158-e002-0a2a0a5209dd-0a2a4503be5e-26
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:07 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830162-fae8-0a2a45030019-a0658308a502-3
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:07 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 0F89C4434F00;
 Mon, 17 Aug 2026 08:39:21 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v2 3/8] fdo: Use IoFreeMdl when IoAllocateMdl was uesd to allocate
Date: Mon, 17 Aug 2026 13:40:51 +0100
Message-ID: <20260817124057.831-4-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260817124057.831-1-owen.smith@citrix.com>
References: <20260817124057.831-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1786970467-758824E9-DE31EAAF/0/0
X-purgate-type: clean
X-purgate-size: 509

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/fdo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 6b46c8c..2e8f2e6 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -3387,7 +3387,7 @@ FdoPciHoleFree(
                               Count);
     ASSERT(NT_SUCCESS(status));
 
-    ExFreePool(Mdl);
+    IoFreeMdl(Mdl);
 }
 
 static PMDL
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Aug 17 12:41:09 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Aug 2026 12:41:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392922.1631894 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweL-00048C-CX; Mon, 17 Aug 2026 12:41:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392922.1631894; Mon, 17 Aug 2026 12:41:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweL-000484-9Q; Mon, 17 Aug 2026 12:41:09 +0000
Received: by outflank-mailman (input) for mailman id 1392922;
 Mon, 17 Aug 2026 12:41:08 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wvweK-000470-M8
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 12:41:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wvweK-00BtTo-2j
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 14:41:08 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830156-8faa-0a2a0a5109dd-0a2a45059fcc-46
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:08 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830163-4cb1-0a2a45050019-a0658308db2e-3
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:07 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id ECA9C4434F02;
 Mon, 17 Aug 2026 08:39:22 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v2 4/8] registry: Fix wrong truncation of Unicode.Length
Date: Mon, 17 Aug 2026 13:40:52 +0100
Message-ID: <20260817124057.831-5-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260817124057.831-1-owen.smith@citrix.com>
References: <20260817124057.831-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1786970468-71AAF2A1-5B7B431D/0/0
X-purgate-type: clean
X-purgate-size: 1924

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/common/registry.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/common/registry.c b/src/common/registry.c
index 1f7a73c..f22a881 100644
--- a/src/common/registry.c
+++ b/src/common/registry.c
@@ -1460,20 +1460,26 @@ RegistryAnsiToSz(
     if (Partial == NULL)
         goto fail1;
 
+    status = STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > 0xFFFF) // MAX_USHORT
+        goto fail2;
+
     Partial->TitleIndex = 0;
     Partial->Type = REG_SZ;
     Partial->DataLength = Length * sizeof (WCHAR);
 
-    Unicode.MaximumLength = (UCHAR)Partial->DataLength;
+    Unicode.MaximumLength = (USHORT)Partial->DataLength;
     Unicode.Buffer = (PWCHAR)Partial->Data;
     Unicode.Length = 0;
 
     status = RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
 
     return Partial;
 
+fail3:
+
 fail2:
     __RegistryFree(Partial);
 
@@ -1503,6 +1509,10 @@ RegistryAnsiToMultiSz(
     if (Partial == NULL)
         goto fail1;
 
+    status = STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > 0xFFFF) // MAX_USHORT
+        goto fail2;
+
     Partial->TitleIndex = 0;
     Partial->Type = REG_MULTI_SZ;
     Partial->DataLength = Length * sizeof (WCHAR);
@@ -1514,7 +1524,7 @@ RegistryAnsiToMultiSz(
     for (Index = 0; Ansi[Index].Buffer != NULL; Index++) {
         status = RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index], FALSE);
         if (!NT_SUCCESS(status))
-            goto fail2;
+            goto fail3;
 
         Length = Unicode.Length / sizeof (WCHAR);
 
@@ -1527,6 +1537,8 @@ RegistryAnsiToMultiSz(
 
     return Partial;
 
+fail3:
+
 fail2:
     __RegistryFree(Partial);
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Aug 17 12:41:10 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Aug 2026 12:41:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392923.1631898 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweM-0004A6-DI; Mon, 17 Aug 2026 12:41:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392923.1631898; Mon, 17 Aug 2026 12:41:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweM-00049y-AZ; Mon, 17 Aug 2026 12:41:10 +0000
Received: by outflank-mailman (input) for mailman id 1392923;
 Mon, 17 Aug 2026 12:41:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wvweL-00048O-IX
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 12:41:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wvweK-003Zl0-VI
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 14:41:08 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a83015f-2eae-0a2a0a5409dd-0a2a4507a5c0-24
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:08 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830163-b4ea-0a2a45070019-a0658308c64a-3
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:08 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id CD89F4434F16;
 Mon, 17 Aug 2026 08:39:23 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v2 5/8] evtchn: Dont Release SHARED_INFO interface if Acquire failed
Date: Mon, 17 Aug 2026 13:40:53 +0100
Message-ID: <20260817124057.831-6-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260817124057.831-1-owen.smith@citrix.com>
References: <20260817124057.831-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1786970468-A5CC7AE4-C824F2CE/0/0
X-purgate-type: clean
X-purgate-size: 609

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/evtchn_2l.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/xenbus/evtchn_2l.c b/src/xenbus/evtchn_2l.c
index 21b48f0..0dfb60a 100644
--- a/src/xenbus/evtchn_2l.c
+++ b/src/xenbus/evtchn_2l.c
@@ -194,8 +194,6 @@ done:
 fail1:
     Error("fail1 (%08x)\n", status);
 
-    XENBUS_SHARED_INFO(Release, &Context->SharedInfoInterface);
-
     --Context->References;
     ASSERT3U(Context->References, ==, 0);
     KeReleaseSpinLock(&Context->Lock, Irql);
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Aug 17 12:41:11 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Aug 2026 12:41:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392924.1631902 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweN-0004Dr-Ef; Mon, 17 Aug 2026 12:41:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392924.1631902; Mon, 17 Aug 2026 12:41:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweN-0004Dj-Bc; Mon, 17 Aug 2026 12:41:11 +0000
Received: by outflank-mailman (input) for mailman id 1392924;
 Mon, 17 Aug 2026 12:41:10 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wvweM-0004AF-JJ
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 12:41:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wvweL-002vl6-Vg
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 14:41:09 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830164-e002-0a2a0a5209dd-0a2a450595b2-2
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:09 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830164-4cb1-0a2a45050019-a0658308af02-3
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:09 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id B5D2D4434F00;
 Mon, 17 Aug 2026 08:39:24 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v2 6/8] monitor: Check allocated pointer, not Context
Date: Mon, 17 Aug 2026 13:40:54 +0100
Message-ID: <20260817124057.831-7-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260817124057.831-1-owen.smith@citrix.com>
References: <20260817124057.831-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1786970469-722AB2A1-BB745113/0/0
X-purgate-type: clean
X-purgate-size: 1232

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/monitor/monitor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 904badd..b7ee7ba 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1215,7 +1215,7 @@ GetDialogParameters(
     TitleSize = (MaxValueLength + 1) * sizeof(TCHAR);
 
     Context->Title = calloc(1, TitleSize);
-    if (Context == NULL)
+    if (Context->Title == NULL)
         goto fail2;
 
     Error = RegQueryValueEx(Context->ParametersKey,
@@ -1237,7 +1237,7 @@ GetDialogParameters(
     TextSize = (MaxValueLength + 1) * sizeof (TCHAR);
 
     Context->Text = calloc(1, TextSize);
-    if (Context == NULL)
+    if (Context->Text == NULL)
         goto fail5;
 
     Error = RegQueryValueEx(Context->ParametersKey,
@@ -1259,7 +1259,7 @@ GetDialogParameters(
     QuestionSize = (MaxValueLength + 1) * sizeof (TCHAR);
 
     Context->Question = calloc(1, QuestionSize);
-    if (Context == NULL)
+    if (Context->Question == NULL)
         goto fail8;
 
     Error = RegQueryValueEx(Context->ParametersKey,
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Aug 17 12:41:12 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Aug 2026 12:41:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392926.1631906 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweO-0004GJ-Fg; Mon, 17 Aug 2026 12:41:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392926.1631906; Mon, 17 Aug 2026 12:41:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweO-0004GC-Co; Mon, 17 Aug 2026 12:41:12 +0000
Received: by outflank-mailman (input) for mailman id 1392926;
 Mon, 17 Aug 2026 12:41:11 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wvweN-0004Dn-Ir
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 12:41:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wvweM-008XhV-VY
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 14:41:10 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a83015f-8faa-0a2a0a5109dd-0a2a45099574-34
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:10 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830165-be1a-0a2a45090019-a0658308c652-3
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:10 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id A8FCD4434F02;
 Mon, 17 Aug 2026 08:39:25 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v2 7/8] high: Zero the HIGH_LOCK value, not the pointer
Date: Mon, 17 Aug 2026 13:40:55 +0100
Message-ID: <20260817124057.831-8-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260817124057.831-1-owen.smith@citrix.com>
References: <20260817124057.831-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1786970470-3B8D1034-7F14AE6B/0/0
X-purgate-type: clean
X-purgate-size: 540

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/common/high.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/high.h b/src/common/high.h
index bdebc7f..61ba2a6 100644
--- a/src/common/high.h
+++ b/src/common/high.h
@@ -83,7 +83,7 @@ InitializeHighLock(
     _In_ PHIGH_LOCK Lock
     )
 {
-    RtlZeroMemory(&Lock, sizeof (HIGH_LOCK));
+    RtlZeroMemory(Lock, sizeof (HIGH_LOCK));
 }
 
 #endif  // _COMMON_HIGH_H
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Aug 17 12:41:13 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Aug 2026 12:41:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392927.1631912 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweP-0004Ic-Jc; Mon, 17 Aug 2026 12:41:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392927.1631912; Mon, 17 Aug 2026 12:41:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweP-0004IT-E1; Mon, 17 Aug 2026 12:41:13 +0000
Received: by outflank-mailman (input) for mailman id 1392927;
 Mon, 17 Aug 2026 12:41:12 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wvweO-0004Fm-GE
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 12:41:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wvweN-005xTL-Eb
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 14:41:11 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830160-bab6-0a2a0a5309dd-0a2a450bd722-18
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:11 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830160-b7e8-0a2a450b0019-a0658308ce3e-3
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:05 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 10EF24434F0A;
 Mon, 17 Aug 2026 08:39:19 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v2 1/8] log: Avoid buffer overrun in DbgPrint interception
Date: Mon, 17 Aug 2026 13:40:49 +0100
Message-ID: <20260817124057.831-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260817124057.831-1-owen.smith@citrix.com>
References: <20260817124057.831-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1786970465-188C99EA-882949B7/0/0
X-purgate-type: clean
X-purgate-size: 1194

Truncate incomming strings to fit inside a Slot's Buffer

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xen/log.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xen/log.c b/src/xen/log.c
index 8673105..93039f6 100644
--- a/src/xen/log.c
+++ b/src/xen/log.c
@@ -545,6 +545,7 @@ LogDebugPrint(
 {
     PLOG_CONTEXT        Context = &LogContext;
     KIRQL               Irql;
+    ULONG               Length;
     PLOG_SLOT           Slot;
 
     UNREFERENCED_PARAMETER(ComponentId);
@@ -571,9 +572,14 @@ LogDebugPrint(
 
     Slot = &Context->Slot[Context->Pending++];
 
+    // truncate long log lines - avoid buffer overrun on Slot->Buffer
+    Length = Ansi->Length >= LOG_BUFFER_SIZE ?
+                            LOG_BUFFER_SIZE - 1:
+                            Ansi->Length;
+
     Slot->Level = 1 << Level;
-    RtlCopyMemory(Slot->Buffer, Ansi->Buffer, Ansi->Length);
-    Slot->Offset = Ansi->Length;
+    RtlCopyMemory(Slot->Buffer, Ansi->Buffer, Length);
+    Slot->Offset = Length;
 
     ReleaseHighLock(&Context->Lock, Irql);
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Aug 17 12:41:13 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Aug 2026 12:41:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392928.1631914 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweP-0004Iu-LF; Mon, 17 Aug 2026 12:41:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392928.1631914; Mon, 17 Aug 2026 12:41:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wvweP-0004Ig-FB; Mon, 17 Aug 2026 12:41:13 +0000
Received: by outflank-mailman (input) for mailman id 1392928;
 Mon, 17 Aug 2026 12:41:12 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wvweO-0004G8-Fv
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 12:41:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wvweN-008XhV-T0
 for win-pv-devel@lists.xenproject.org; Mon, 17 Aug 2026 14:41:11 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a83015f-8faa-0a2a0a5109dd-0a2a45099574-40
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:11 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a830166-be1a-0a2a45090019-a0658308bb76-3
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Aug 2026 14:41:11 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id A96F94434F24;
 Mon, 17 Aug 2026 08:39:26 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v2 8/8] Correct printf parameters
Date: Mon, 17 Aug 2026 13:40:56 +0100
Message-ID: <20260817124057.831-9-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260817124057.831-1-owen.smith@citrix.com>
References: <20260817124057.831-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1786970471-3A0C5034-6E945DCE/0/0
X-purgate-type: clean
X-purgate-size: 1614

Adds missing or remove incorrect parameters passed to printf style
logging calls

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xen/bug_check.c | 1 -
 src/xenbus/fdo.c    | 2 +-
 src/xenbus/gnttab.c | 1 +
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xen/bug_check.c b/src/xen/bug_check.c
index cc77ef0..2a118d3 100644
--- a/src/xen/bug_check.c
+++ b/src/xen/bug_check.c
@@ -760,7 +760,6 @@ BugCheckSystemThreadExceptionNotHandled(
                       "%s|BUGCHECK: %08X AT %p\n",
                       __MODULE__,
                       Code,
-                      Name,
                       Address);
 
         BugCheckDumpExceptionRecord(Exception);
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 2e8f2e6..c86d311 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -5783,7 +5783,7 @@ FdoSetWatchdog(
     ConfigFreeSzValue(Option);
 
     if (Value && Value < 10) {
-        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
+        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n", Value);
         Value = 10;
     }
 
diff --git a/src/xenbus/gnttab.c b/src/xenbus/gnttab.c
index 71f8ec1..3adcef4 100644
--- a/src/xenbus/gnttab.c
+++ b/src/xenbus/gnttab.c
@@ -821,6 +821,7 @@ GnttabDebugCallback(
         XENBUS_DEBUG(Printf,
                     &Context->DebugInterface,
                      "[%u] Address = %08x.%08x\n",
+                     Index,
                      Address.HighPart,
                      Address.LowPart);
     }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Aug 18 00:26:12 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 18 Aug 2026 00:26:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393333.1632132 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1ww7ed-00018P-5C; Tue, 18 Aug 2026 00:26:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393333.1632132; Tue, 18 Aug 2026 00:26:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1ww7ed-00018H-2V; Tue, 18 Aug 2026 00:26:11 +0000
Received: by outflank-mailman (input) for mailman id 1393333;
 Tue, 18 Aug 2026 00:26:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a01242cdfa000c4f3@swg.vates.tech>)
 id 1ww7ea-00018B-NX
 for win-pv-devel@lists.xenproject.org; Tue, 18 Aug 2026 00:26:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1ww7ea-000fGK-1R
 for win-pv-devel@lists.xenproject.org; Tue, 18 Aug 2026 02:26:08 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a01242cdfa000c4f3@swg.vates.tech>)
 id 6a83a69f-e002-0a2a0a5209dd-0a2a4507bf66-0
 for <win-pv-devel@lists.xenproject.org>; Tue, 18 Aug 2026 02:26:07 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a01242cdfa000c4f3@swg.vates.tech>)
 id 6a83a69f-b4ea-0a2a45070019-b9ff1c23aa01-3
 for <win-pv-devel@lists.xenproject.org>; Tue, 18 Aug 2026 02:26:07 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a01242cdfa000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 18 Aug 2026 00:26:03 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 670E381C2F;
 Tue, 18 Aug 2026 02:26:02 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=/PvqQhi+0zhzc67dOFkE4JSiyuA6jsBpVqz3rfU0sjY=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=MWXCRu2GL0Co1Bm0TXpzduM1NLzOxbRv2dvBU4sg1DkPOJS7ahPFdolKPp7F4Z801E8277xPA
 w9rPIR3FuD3GlukdycCHjwBJ0i6+xLpvn9yPVB28s3sy26fMepivDTc9C9Ze2E6gEKbmdgUUkMz
 IXjOLUjHLpA5Gm7wyvuNLycKcJ/P5mS9VTisN9JnBU19okuJSJMxyeSuERbDqFTV0LvdZSA3pDn
 gY4G8fYORATj/QrueDyUlVPes3eqIaYLQTRRryAIjIOpDcGKWZ5QmdAfzTKDmjeZ3K93x7nxjIq
 FQbaghEATl0/M4v01q3CGFW2ws5VAhExTLB92sIGu4fw==
X-Zone-Loop: e2962b2be06eb8c6fbc49b9da0159d980dc684995901
x-campaign-type: default
x-transaction-id: f52da6f0-2e06-45a1-bbc6-ab0b18009b2c
x-swg-uid: 01-a626d153-585f-4755-a255-808c6211ed67
X-Mailer: Sweego
Message-ID:
 <1787012763.8631fc262581453bbf619ec5b2062170.1a01242cdfa000c4f3@vates.tech>
x-swg-bid: 1787012763.8631fc262581453bbf619ec5b2062170.1a01242cdfa000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Tue, 18 Aug 2026 02:26:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/8] registry: Fix wrong truncation of Unicode.Length
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260817124057.831-1-owen.smith@citrix.com>
 <20260817124057.831-5-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260817124057.831-5-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.23ea.f19305633373f500.1a01242cb7a.d7b9279fa4b12ef6=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787012762490
X-purgate-ID: tlsNG-ef75cf/1787012767-A46CAAE4-47D8300B/0/0
X-purgate-type: clean
X-purgate-size: 2689

---=Part.23ea.f19305633373f500.1a01242cb7a.d7b9279fa4b12ef6=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 17/08/2026 14:41, Owen Smith wrote:
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>
> ---
>   src/common/registry=2Ec | 18 +++++++++++++++---
>   1 file changed, 15 insertions(+), 3 deletions(-)
>=20
> diff --git a/src/common/registry=2Ec b/src/common/registry=2Ec
> index 1f7a73c=2E=2Ef22a881 100644
> --- a/src/common/registry=2Ec
> +++ b/src/common/registry=2Ec
> @@ -1460,20 +1460,26 @@ RegistryAnsiToSz(
>       if (Partial =3D=3D NULL)
>           goto fail1;
>  =20
> +    status =3D STATUS_BUFFER_OVERFLOW;
> +    if (Length * sizeof(WCHAR) > 0xFFFF) // MAX_USHORT
> +        goto fail2;
> +

I think this check should be moved before calling __RegistryAllocate=2E=20
Also, this can use MAXUSHORT instead of 0xFFFF=2E

>       Partial->TitleIndex =3D 0;
>       Partial->Type =3D REG_SZ;
>       Partial->DataLength =3D Length * sizeof (WCHAR);
>  =20
> -    Unicode=2EMaximumLength =3D (UCHAR)Partial->DataLength;
> +    Unicode=2EMaximumLength =3D (USHORT)Partial->DataLength;
>       Unicode=2EBuffer =3D (PWCHAR)Partial->Data;
>       Unicode=2ELength =3D 0;
>  =20
>       status =3D RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
>       if (!NT_SUCCESS(status))
> -        goto fail2;
> +        goto fail3;
>  =20
>       return Partial;
>  =20
> +fail3:
> +
>   fail2:
>       __RegistryFree(Partial);
>  =20
> @@ -1503,6 +1509,10 @@ RegistryAnsiToMultiSz(
>       if (Partial =3D=3D NULL)
>           goto fail1;
>  =20
> +    status =3D STATUS_BUFFER_OVERFLOW;
> +    if (Length * sizeof(WCHAR) > 0xFFFF) // MAX_USHORT
> +        goto fail2;
> +
>       Partial->TitleIndex =3D 0;
>       Partial->Type =3D REG_MULTI_SZ;
>       Partial->DataLength =3D Length * sizeof (WCHAR);
> @@ -1514,7 +1524,7 @@ RegistryAnsiToMultiSz(
>       for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++) {
>           status =3D RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index]=
, FALSE);
>           if (!NT_SUCCESS(status))
> -            goto fail2;
> +            goto fail3;
>  =20
>           Length =3D Unicode=2ELength / sizeof (WCHAR);
>  =20
> @@ -1527,6 +1537,8 @@ RegistryAnsiToMultiSz(
>  =20
>       return Partial;
>  =20
> +fail3:
> +
>   fail2:
>       __RegistryFree(Partial);
>  =20



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.23ea.f19305633373f500.1a01242cb7a.d7b9279fa4b12ef6=---


From win-pv-devel-bounces@lists.xenproject.org Tue Aug 18 00:42:25 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 18 Aug 2026 00:42:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393335.1632136 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1ww7uK-0003LJ-9s; Tue, 18 Aug 2026 00:42:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393335.1632136; Tue, 18 Aug 2026 00:42:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1ww7uK-0003LC-7C; Tue, 18 Aug 2026 00:42:24 +0000
Received: by outflank-mailman (input) for mailman id 1393335;
 Tue, 18 Aug 2026 00:42:22 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a01251b39f000c4f3@swg.vates.tech>)
 id 1ww7uI-0003L5-Js
 for win-pv-devel@lists.xenproject.org; Tue, 18 Aug 2026 00:42:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1ww7uG-00BYtY-MU
 for win-pv-devel@lists.xenproject.org; Tue, 18 Aug 2026 02:42:20 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a01251b39f000c4f3@swg.vates.tech>)
 id 6a83aa10-bab6-0a2a0a5309dd-0a2a450885a4-20
 for <win-pv-devel@lists.xenproject.org>; Tue, 18 Aug 2026 02:42:20 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a01251b39f000c4f3@swg.vates.tech>)
 id 6a83aa6c-f659-0a2a45080019-b9ff1c229379-3
 for <win-pv-devel@lists.xenproject.org>; Tue, 18 Aug 2026 02:42:20 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a01251b39f000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 18 Aug 2026 00:42:19 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id A944C81C2F;
 Tue, 18 Aug 2026 02:42:18 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=96OB3J8KFLmJSySXNOt5OsetMXmJF8Uc8OtLzBudQI0=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=retn8XMawpm3ShGLwWO8KV2d84j6/hLd7HmWAC/f6WFDXBeJfbBpWxqCyvbB236VNMNI2abZO
 p5VGES1JfFo98Mv/+d4xpVHVgkdkTmfEznBVEu+hYpQiJwtk5jCd3m4JGVfr9/ssQ4BwfDC4XKr
 Pe3Mb8l/SO9KKjx4N9D6pqLKshG9rzhclcrQ8wuipHW7FIQiiDCHi83xhYhbUjd6gg+SDVxUKp5
 +ax7od4S4T3a8fpxzqZ5CSHpDL3GASKlBeeqmOB9iQwIk9HrsRPMAdnSmZJV1taPUpoCnvr3876
 xTkEZjtNxcILvGGRMUsmlsIHo4RmBNOmma+TC7hexB8Q==
X-Zone-Loop: faf2f8314cc9d7e31912fec419adeb170e9771b71865
x-campaign-type: default
x-transaction-id: 91b1520c-7b93-44cc-b280-e61f7b67691b
x-swg-uid: 01-b36b33de-edc5-430e-a9c6-e70759064721
X-Mailer: Sweego
Message-ID:
 <1787013739.8631fc262581453bbf619ec5b2062170.1a01251b39f000c4f3@vates.tech>
x-swg-bid: 1787013739.8631fc262581453bbf619ec5b2062170.1a01251b39f000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Tue, 18 Aug 2026 02:42:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 8/8] Correct printf parameters
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260817124057.831-1-owen.smith@citrix.com>
 <20260817124057.831-9-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260817124057.831-9-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.23eb.21dfdb7522c8e4d5.1a01251b0f8.82933730034818e1=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787013738744
X-purgate-ID: tlsNG-c1860d/1787013740-CE14687B-3387840C/0/0
X-purgate-type: clean
X-purgate-size: 2261

---=Part.23eb.21dfdb7522c8e4d5.1a01251b0f8.82933730034818e1=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 17/08/2026 14:41, Owen Smith wrote:
> Adds missing or remove incorrect parameters passed to printf style
> logging calls
>=20
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>
> ---
>   src/xen/bug_check=2Ec | 1 -
>   src/xenbus/fdo=2Ec    | 2 +-
>   src/xenbus/gnttab=2Ec | 1 +
>   3 files changed, 2 insertions(+), 2 deletions(-)
>=20
> diff --git a/src/xen/bug_check=2Ec b/src/xen/bug_check=2Ec
> index cc77ef0=2E=2E2a118d3 100644
> --- a/src/xen/bug_check=2Ec
> +++ b/src/xen/bug_check=2Ec
> @@ -760,7 +760,6 @@ BugCheckSystemThreadExceptionNotHandled(
>                         "%s|BUGCHECK: %08X AT %p\n",
>                         __MODULE__,
>                         Code,
> -                      Name,
>                         Address);

LLM noticed that the same change should be applied to=20
BugCheckKernelModeExceptionNotHandled=2E

>  =20
>           BugCheckDumpExceptionRecord(Exception);
> diff --git a/src/xenbus/fdo=2Ec b/src/xenbus/fdo=2Ec
> index 2e8f2e6=2E=2Ec86d311 100644
> --- a/src/xenbus/fdo=2Ec
> +++ b/src/xenbus/fdo=2Ec
> @@ -5783,7 +5783,7 @@ FdoSetWatchdog(
>       ConfigFreeSzValue(Option);
>  =20
>       if (Value && Value < 10) {
> -        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
> +        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n", Value);
>           Value =3D 10;
>       }
>  =20
> diff --git a/src/xenbus/gnttab=2Ec b/src/xenbus/gnttab=2Ec
> index 71f8ec1=2E=2E3adcef4 100644
> --- a/src/xenbus/gnttab=2Ec
> +++ b/src/xenbus/gnttab=2Ec
> @@ -821,6 +821,7 @@ GnttabDebugCallback(
>           XENBUS_DEBUG(Printf,
>                       &Context->DebugInterface,
>                        "[%u] Address =3D %08x=2E%08x\n",
> +                     Index,
>                        Address=2EHighPart,
>                        Address=2ELowPart);
>       }



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.23eb.21dfdb7522c8e4d5.1a01251b0f8.82933730034818e1=---


From win-pv-devel-bounces@lists.xenproject.org Tue Aug 18 00:43:29 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 18 Aug 2026 00:43:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393337.1632139 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1ww7vN-0003OX-Cz; Tue, 18 Aug 2026 00:43:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393337.1632139; Tue, 18 Aug 2026 00:43:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1ww7vN-0003OQ-AX; Tue, 18 Aug 2026 00:43:29 +0000
Received: by outflank-mailman (input) for mailman id 1393337;
 Tue, 18 Aug 2026 00:43:27 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a01252a860000c4f3@swg.vates.tech>)
 id 1ww7vL-0003OK-66
 for win-pv-devel@lists.xenproject.org; Tue, 18 Aug 2026 00:43:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1ww7vK-00BZ4P-JK
 for win-pv-devel@lists.xenproject.org; Tue, 18 Aug 2026 02:43:26 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a01252a860000c4f3@swg.vates.tech>)
 id 6a83aa10-bab6-0a2a0a5309dd-0a2a450885a4-46
 for <win-pv-devel@lists.xenproject.org>; Tue, 18 Aug 2026 02:43:26 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a01252a860000c4f3@swg.vates.tech>)
 id 6a83aaae-f659-0a2a45080019-b9ff1c22a31d-3
 for <win-pv-devel@lists.xenproject.org>; Tue, 18 Aug 2026 02:43:26 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a01252a860000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 18 Aug 2026 00:43:22 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 7375180F6E;
 Tue, 18 Aug 2026 02:43:21 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=7zjLjeN3ZEFzy2iX58cE+7rpREZvhRZCHjdHn0DaJCo=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=CTV5LwAPsLThrmusUP8YVuGGGsTYShoae59FAFzJ2aTyTD73oYC3ELMJiq7GAD+RYGLjAbC9o
 qdjGU1W/42F0bN0OmRTKnYeCJ/klJmrVf4QsOVjD4+muHLFW9k5oueV22ZOTiyC8spSby66wZtc
 Vt13lH/V/XnXpxY4i8XenCNN5IQJJNBA6zOqOASVFpLayJ8TsASyLqvtC1E+EpIlZCT4bbDT98O
 SY/YAW8jsmhktOwJ9EwBEaWOho50TjG8ShpRwYYq4EwGlCmqBgJEFLG7dByQkScnSnFtpet2X5y
 dEB0NhuTDvxW20AM4wVry7NuvlbroidByFIqIRm0p8mw==
X-Zone-Loop: f8a1d28512f6e1994a894e1842f7659b4f4d8ea84e21
x-campaign-type: default
x-transaction-id: d924d689-cadf-4276-937e-a0637d4a3d27
x-swg-uid: 01-470dee79-d44c-4cb8-bc80-097300520f31
X-Mailer: Sweego
Message-ID:
 <1787013802.8631fc262581453bbf619ec5b2062170.1a01252a860000c4f3@vates.tech>
x-swg-bid: 1787013802.8631fc262581453bbf619ec5b2062170.1a01252a860000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Tue, 18 Aug 2026 02:43:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/8] store: Detect bad response from xenstored
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260817124057.831-1-owen.smith@citrix.com>
 <20260817124057.831-3-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260817124057.831-3-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.23ec.59cddf04bd991322.1a01252a62d.b76b32609d90cf99=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787013801518
X-purgate-ID: tlsNG-c1860d/1787013806-D6B4187B-975DD62E/0/0
X-purgate-type: clean
X-purgate-size: 1420

---=Part.23ec.59cddf04bd991322.1a01252a62d.b76b32609d90cf99=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 17/08/2026 14:41, Owen Smith wrote:
> Detect when Header=2Elen is larger than allowed, and fail the request=2E
> A length of 0 is valid for some operations=2E
>=20
> Assisted-by: ClaudeCode:claude-opus-4=2E8
> Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>
> ---
>   src/xenbus/store=2Ec | 4 ++++
>   1 file changed, 4 insertions(+)
>=20
> diff --git a/src/xenbus/store=2Ec b/src/xenbus/store=2Ec
> index 503144a=2E=2Eb40ef3c 100644
> --- a/src/xenbus/store=2Ec
> +++ b/src/xenbus/store=2Ec
> @@ -522,6 +522,10 @@ StoreReceiveResponse(
>       if (Response->Header=2Elen =3D=3D 0)
>           goto done;
>  =20
> +    status =3D STATUS_INVALID_BUFFER_SIZE;
> +    if (Response->Header=2Elen > XENSTORE_PAYLOAD_MAX)
> +        goto done;
> +
>       Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT]=2ELength =
=3D Response->Header=2Elen;
>       Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT]=2EData =
=3D Response->Data;
>  =20

The comparison to XENSTORE_PAYLOAD_MAX in StoreVerifyHeader should be=20
adjusted as well=2E


-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.23ec.59cddf04bd991322.1a01252a62d.b76b32609d90cf99=---


From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 06:30:26 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 06:30:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394559.1633270 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZof-0003vf-DK; Wed, 19 Aug 2026 06:30:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394559.1633270; Wed, 19 Aug 2026 06:30:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZof-0003vW-9j; Wed, 19 Aug 2026 06:30:25 +0000
Received: by outflank-mailman (input) for mailman id 1394559;
 Wed, 19 Aug 2026 06:30:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wwZod-0003vK-V9
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 06:30:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wwZod-008vwd-Bz
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 08:30:23 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d7e-2eae-0a2a0a5409dd-0a2a4509840e-4
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:23 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d7e-be1a-0a2a45090019-a0658308cc6a-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:23 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 672DB44B2326;
 Wed, 19 Aug 2026 02:28:37 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v3 0/8] Use AI to detected issues
Date: Wed, 19 Aug 2026 07:30:06 +0100
Message-ID: <20260819063015.602-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1787121023-3A8D9034-149A4E24/0/0
X-purgate-type: clean
X-purgate-size: 1178

Issues detected with ClaudeCode:claude-opus-4.8 and patches
generated manually. AI was not used to generate any patches.
Adds the 'Assisted-by' tag to all commits to show which AI model
detected these issues.

* store: correct length test, and allow length of 0
* registry: detect the overrun and fail, rather than ASSERTing

Owen Smith (8):
  log: Avoid buffer overrun in DbgPrint interception
  store: Detect bad response from xenstored
  fdo: Use IoFreeMdl when IoAllocateMdl was uesd to allocate
  registry: Fix wrong truncation of Unicode.Length
  evtchn: Dont Release SHARED_INFO interface if Acquire failed
  monitor: Check allocated pointer, not Context
  high: Zero the HIGH_LOCK value, not the pointer
  Correct printf parameters

 src/common/high.h      |  2 +-
 src/common/registry.c  | 27 ++++++++++++++++++++-------
 src/monitor/monitor.c  |  6 +++---
 src/xen/bug_check.c    |  2 --
 src/xen/log.c          | 10 ++++++++--
 src/xenbus/evtchn_2l.c |  2 --
 src/xenbus/fdo.c       |  4 ++--
 src/xenbus/gnttab.c    |  1 +
 src/xenbus/store.c     |  6 +++++-
 9 files changed, 40 insertions(+), 20 deletions(-)

-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 06:30:26 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 06:30:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394560.1633273 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZof-0003w4-Ft; Wed, 19 Aug 2026 06:30:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394560.1633273; Wed, 19 Aug 2026 06:30:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZof-0003vh-Au; Wed, 19 Aug 2026 06:30:25 +0000
Received: by outflank-mailman (input) for mailman id 1394560;
 Wed, 19 Aug 2026 06:30:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wwZoe-0003vQ-Sj
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 06:30:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wwZoe-004VMw-6H
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 08:30:24 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d73-e002-0a2a0a5209dd-0a2a4501ab5e-30
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:24 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d7f-5984-0a2a45010019-a0658308b344-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:23 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 3196444B2C18;
 Wed, 19 Aug 2026 02:28:38 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v3 1/8] log: Avoid buffer overrun in DbgPrint interception
Date: Wed, 19 Aug 2026 07:30:07 +0100
Message-ID: <20260819063015.602-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260819063015.602-1-owen.smith@citrix.com>
References: <20260819063015.602-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1787121024-1F46D757-DD611323/0/0
X-purgate-type: clean
X-purgate-size: 1194

Truncate incomming strings to fit inside a Slot's Buffer

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xen/log.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xen/log.c b/src/xen/log.c
index 8673105..93039f6 100644
--- a/src/xen/log.c
+++ b/src/xen/log.c
@@ -545,6 +545,7 @@ LogDebugPrint(
 {
     PLOG_CONTEXT        Context = &LogContext;
     KIRQL               Irql;
+    ULONG               Length;
     PLOG_SLOT           Slot;
 
     UNREFERENCED_PARAMETER(ComponentId);
@@ -571,9 +572,14 @@ LogDebugPrint(
 
     Slot = &Context->Slot[Context->Pending++];
 
+    // truncate long log lines - avoid buffer overrun on Slot->Buffer
+    Length = Ansi->Length >= LOG_BUFFER_SIZE ?
+                            LOG_BUFFER_SIZE - 1:
+                            Ansi->Length;
+
     Slot->Level = 1 << Level;
-    RtlCopyMemory(Slot->Buffer, Ansi->Buffer, Ansi->Length);
-    Slot->Offset = Ansi->Length;
+    RtlCopyMemory(Slot->Buffer, Ansi->Buffer, Length);
+    Slot->Offset = Length;
 
     ReleaseHighLock(&Context->Lock, Irql);
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 06:30:27 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 06:30:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394561.1633280 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoh-0003yg-Gi; Wed, 19 Aug 2026 06:30:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394561.1633280; Wed, 19 Aug 2026 06:30:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoh-0003yZ-C9; Wed, 19 Aug 2026 06:30:27 +0000
Received: by outflank-mailman (input) for mailman id 1394561;
 Wed, 19 Aug 2026 06:30:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wwZog-0003xq-1r
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 06:30:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wwZof-008vwd-F0
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 08:30:25 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d7f-2eae-0a2a0a5409dd-0a2a450b9f2a-10
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:25 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d7f-b7e8-0a2a450b0019-a0658308a782-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:24 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id EFB7344B230E;
 Wed, 19 Aug 2026 02:28:38 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v3 2/8] store: Detect bad response from xenstored
Date: Wed, 19 Aug 2026 07:30:08 +0100
Message-ID: <20260819063015.602-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260819063015.602-1-owen.smith@citrix.com>
References: <20260819063015.602-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1787121024-198C19EA-BB424A56/0/0
X-purgate-type: clean
X-purgate-size: 1204

Detect when Header.len is larger than allowed, and fail the request.
A length of 0 is valid for some operations.
Also modify StoreVerifyHeader to fail on length > XENSTORE_PAYLOAD_MAX

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/store.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/xenbus/store.c b/src/xenbus/store.c
index 503144a..d1b396b 100644
--- a/src/xenbus/store.c
+++ b/src/xenbus/store.c
@@ -491,7 +491,7 @@ StoreVerifyHeader(
         Valid = FALSE;
     }
 
-    if (Header->len >= XENSTORE_PAYLOAD_MAX) {
+    if (Header->len > XENSTORE_PAYLOAD_MAX) {
         Error("ILLEGAL LENGTH 0x%08x\n", Header->len);
         Valid = FALSE;
     }
@@ -522,6 +522,10 @@ StoreReceiveResponse(
     if (Response->Header.len == 0)
         goto done;
 
+    status = STATUS_INVALID_BUFFER_SIZE;
+    if (Response->Header.len > XENSTORE_PAYLOAD_MAX)
+        goto done;
+
     Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT].Length = Response->Header.len;
     Response->Segment[XENBUS_STORE_RESPONSE_PAYLOAD_SEGMENT].Data = Response->Data;
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 06:30:27 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 06:30:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394562.1633281 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoh-0003yx-He; Wed, 19 Aug 2026 06:30:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394562.1633281; Wed, 19 Aug 2026 06:30:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoh-0003yk-DJ; Wed, 19 Aug 2026 06:30:27 +0000
Received: by outflank-mailman (input) for mailman id 1394562;
 Wed, 19 Aug 2026 06:30:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wwZog-0003xr-6r
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 06:30:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wwZof-008vwd-K6
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 08:30:25 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d7f-2eae-0a2a0a5409dd-0a2a450b9f2a-14
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:25 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d80-b7e8-0a2a450b0019-a0658308cc78-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:25 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id B9B8844B2326;
 Wed, 19 Aug 2026 02:28:39 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v3 3/8] fdo: Use IoFreeMdl when IoAllocateMdl was uesd to allocate
Date: Wed, 19 Aug 2026 07:30:09 +0100
Message-ID: <20260819063015.602-4-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260819063015.602-1-owen.smith@citrix.com>
References: <20260819063015.602-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1787121025-1BED69EA-CB581311/0/0
X-purgate-type: clean
X-purgate-size: 509

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/fdo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 6b46c8c..2e8f2e6 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -3387,7 +3387,7 @@ FdoPciHoleFree(
                               Count);
     ASSERT(NT_SUCCESS(status));
 
-    ExFreePool(Mdl);
+    IoFreeMdl(Mdl);
 }
 
 static PMDL
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 06:30:28 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 06:30:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394563.1633288 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoi-00041q-Js; Wed, 19 Aug 2026 06:30:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394563.1633288; Wed, 19 Aug 2026 06:30:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoi-00041j-EU; Wed, 19 Aug 2026 06:30:28 +0000
Received: by outflank-mailman (input) for mailman id 1394563;
 Wed, 19 Aug 2026 06:30:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wwZog-0003y9-VI
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 06:30:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wwZog-00HFhN-CB
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 08:30:26 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d7d-8faa-0a2a0a5109dd-0a2a4503b48e-36
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:26 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d81-fae8-0a2a45030019-a0658308b214-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:26 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 83CD444B2C19;
 Wed, 19 Aug 2026 02:28:40 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v3 4/8] registry: Fix wrong truncation of Unicode.Length
Date: Wed, 19 Aug 2026 07:30:10 +0100
Message-ID: <20260819063015.602-5-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260819063015.602-1-owen.smith@citrix.com>
References: <20260819063015.602-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1787121026-6ECCB4E9-AE7D1094/0/0
X-purgate-type: clean
X-purgate-size: 2543

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/common/registry.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/common/registry.c b/src/common/registry.c
index 1f7a73c..4f7c5ef 100644
--- a/src/common/registry.c
+++ b/src/common/registry.c
@@ -1453,30 +1453,37 @@ RegistryAnsiToSz(
     NTSTATUS                        status;
 
     Length = Ansi->Length + 1;
+
+    status = STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial = __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data) +
                                  Length * sizeof (WCHAR));
 
     status = STATUS_NO_MEMORY;
     if (Partial == NULL)
-        goto fail1;
+        goto fail2;
 
     Partial->TitleIndex = 0;
     Partial->Type = REG_SZ;
     Partial->DataLength = Length * sizeof (WCHAR);
 
-    Unicode.MaximumLength = (UCHAR)Partial->DataLength;
+    Unicode.MaximumLength = (USHORT)Partial->DataLength;
     Unicode.Buffer = (PWCHAR)Partial->Data;
     Unicode.Length = 0;
 
     status = RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
 
     return Partial;
 
-fail2:
+fail3:
     __RegistryFree(Partial);
 
+fail2:
+
 fail1:
     return NULL;
 }
@@ -1496,12 +1503,16 @@ RegistryAnsiToMultiSz(
     for (Index = 0; Ansi[Index].Buffer != NULL; Index++)
         Length += Ansi[Index].Length + 1;
 
+    status = STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial = __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data) +
                                Length * sizeof (WCHAR));
 
     status = STATUS_NO_MEMORY;
     if (Partial == NULL)
-        goto fail1;
+        goto fail2;
 
     Partial->TitleIndex = 0;
     Partial->Type = REG_MULTI_SZ;
@@ -1514,7 +1525,7 @@ RegistryAnsiToMultiSz(
     for (Index = 0; Ansi[Index].Buffer != NULL; Index++) {
         status = RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index], FALSE);
         if (!NT_SUCCESS(status))
-            goto fail2;
+            goto fail3;
 
         Length = Unicode.Length / sizeof (WCHAR);
 
@@ -1527,9 +1538,11 @@ RegistryAnsiToMultiSz(
 
     return Partial;
 
-fail2:
+fail3:
     __RegistryFree(Partial);
 
+fail2:
+
 fail1:
     return NULL;
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 06:30:28 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 06:30:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394564.1633292 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoi-000429-Lr; Wed, 19 Aug 2026 06:30:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394564.1633292; Wed, 19 Aug 2026 06:30:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoi-00041x-Fp; Wed, 19 Aug 2026 06:30:28 +0000
Received: by outflank-mailman (input) for mailman id 1394564;
 Wed, 19 Aug 2026 06:30:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wwZoh-000404-P4
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 06:30:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wwZoh-004VMw-5t
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 08:30:27 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d73-e002-0a2a0a5209dd-0a2a4501ab5e-46
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:27 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d82-5984-0a2a45010019-a06583088e0c-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:27 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 44D4B44B2C18;
 Wed, 19 Aug 2026 02:28:41 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v3 5/8] evtchn: Dont Release SHARED_INFO interface if Acquire failed
Date: Wed, 19 Aug 2026 07:30:11 +0100
Message-ID: <20260819063015.602-6-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260819063015.602-1-owen.smith@citrix.com>
References: <20260819063015.602-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1787121027-BE664757-6A5B2044/0/0
X-purgate-type: clean
X-purgate-size: 609

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/evtchn_2l.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/xenbus/evtchn_2l.c b/src/xenbus/evtchn_2l.c
index 21b48f0..0dfb60a 100644
--- a/src/xenbus/evtchn_2l.c
+++ b/src/xenbus/evtchn_2l.c
@@ -194,8 +194,6 @@ done:
 fail1:
     Error("fail1 (%08x)\n", status);
 
-    XENBUS_SHARED_INFO(Release, &Context->SharedInfoInterface);
-
     --Context->References;
     ASSERT3U(Context->References, ==, 0);
     KeReleaseSpinLock(&Context->Lock, Irql);
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 06:30:29 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 06:30:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394565.1633294 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoj-00045U-Jx; Wed, 19 Aug 2026 06:30:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394565.1633294; Wed, 19 Aug 2026 06:30:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZoj-00045O-H2; Wed, 19 Aug 2026 06:30:29 +0000
Received: by outflank-mailman (input) for mailman id 1394565;
 Wed, 19 Aug 2026 06:30:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wwZoi-00041i-HT
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 06:30:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wwZoh-008vwd-Uf
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 08:30:27 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d7e-2eae-0a2a0a5409dd-0a2a4509840e-20
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:27 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d82-be1a-0a2a45090019-a0658308cc82-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:27 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 0F17044B2326;
 Wed, 19 Aug 2026 02:28:41 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v3 6/8] monitor: Check allocated pointer, not Context
Date: Wed, 19 Aug 2026 07:30:12 +0100
Message-ID: <20260819063015.602-7-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260819063015.602-1-owen.smith@citrix.com>
References: <20260819063015.602-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1787121027-BE8D9034-25959EDE/0/0
X-purgate-type: clean
X-purgate-size: 1232

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/monitor/monitor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 904badd..b7ee7ba 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1215,7 +1215,7 @@ GetDialogParameters(
     TitleSize = (MaxValueLength + 1) * sizeof(TCHAR);
 
     Context->Title = calloc(1, TitleSize);
-    if (Context == NULL)
+    if (Context->Title == NULL)
         goto fail2;
 
     Error = RegQueryValueEx(Context->ParametersKey,
@@ -1237,7 +1237,7 @@ GetDialogParameters(
     TextSize = (MaxValueLength + 1) * sizeof (TCHAR);
 
     Context->Text = calloc(1, TextSize);
-    if (Context == NULL)
+    if (Context->Text == NULL)
         goto fail5;
 
     Error = RegQueryValueEx(Context->ParametersKey,
@@ -1259,7 +1259,7 @@ GetDialogParameters(
     QuestionSize = (MaxValueLength + 1) * sizeof (TCHAR);
 
     Context->Question = calloc(1, QuestionSize);
-    if (Context == NULL)
+    if (Context->Question == NULL)
         goto fail8;
 
     Error = RegQueryValueEx(Context->ParametersKey,
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 06:30:30 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 06:30:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394566.1633299 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZok-00047o-Ln; Wed, 19 Aug 2026 06:30:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394566.1633299; Wed, 19 Aug 2026 06:30:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZok-00047Y-I6; Wed, 19 Aug 2026 06:30:30 +0000
Received: by outflank-mailman (input) for mailman id 1394566;
 Wed, 19 Aug 2026 06:30:29 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wwZoj-000454-Fr
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 06:30:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wwZoi-00HFhN-Sr
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 08:30:28 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d83-8faa-0a2a0a5109dd-0a2a45088658-6
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:28 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d83-f659-0a2a45080019-a0658308c37a-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:28 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id CD9B844B230E;
 Wed, 19 Aug 2026 02:28:42 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v3 7/8] high: Zero the HIGH_LOCK value, not the pointer
Date: Wed, 19 Aug 2026 07:30:13 +0100
Message-ID: <20260819063015.602-8-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260819063015.602-1-owen.smith@citrix.com>
References: <20260819063015.602-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1787121028-D674387B-F0245D2D/0/0
X-purgate-type: clean
X-purgate-size: 540

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/common/high.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/high.h b/src/common/high.h
index bdebc7f..61ba2a6 100644
--- a/src/common/high.h
+++ b/src/common/high.h
@@ -83,7 +83,7 @@ InitializeHighLock(
     _In_ PHIGH_LOCK Lock
     )
 {
-    RtlZeroMemory(&Lock, sizeof (HIGH_LOCK));
+    RtlZeroMemory(Lock, sizeof (HIGH_LOCK));
 }
 
 #endif  // _COMMON_HIGH_H
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 06:30:31 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 06:30:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394567.1633302 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZol-00049w-MH; Wed, 19 Aug 2026 06:30:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394567.1633302; Wed, 19 Aug 2026 06:30:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wwZol-00049m-JD; Wed, 19 Aug 2026 06:30:31 +0000
Received: by outflank-mailman (input) for mailman id 1394567;
 Wed, 19 Aug 2026 06:30:30 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wwZok-00047K-HU
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 06:30:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wwZoj-008w0V-Ud
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 08:30:29 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d7f-2eae-0a2a0a5409dd-0a2a450b9f2a-34
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:29 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a854d84-b7e8-0a2a450b0019-a0658308c9bc-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 08:30:29 +0200
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id A94F744B2C18;
 Wed, 19 Aug 2026 02:28:43 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH v3 8/8] Correct printf parameters
Date: Wed, 19 Aug 2026 07:30:14 +0100
Message-ID: <20260819063015.602-9-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20260819063015.602-1-owen.smith@citrix.com>
References: <20260819063015.602-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1787121029-188C99EA-EB155AFD/0/0
X-purgate-type: clean
X-purgate-size: 1901

Adds missing or remove incorrect parameters passed to printf style
logging calls

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xen/bug_check.c | 2 --
 src/xenbus/fdo.c    | 2 +-
 src/xenbus/gnttab.c | 1 +
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/xen/bug_check.c b/src/xen/bug_check.c
index cc77ef0..d34761a 100644
--- a/src/xen/bug_check.c
+++ b/src/xen/bug_check.c
@@ -760,7 +760,6 @@ BugCheckSystemThreadExceptionNotHandled(
                       "%s|BUGCHECK: %08X AT %p\n",
                       __MODULE__,
                       Code,
-                      Name,
                       Address);
 
         BugCheckDumpExceptionRecord(Exception);
@@ -803,7 +802,6 @@ BugCheckKernelModeExceptionNotHandled(
                       "%s|BUGCHECK: %08X AT %p\n",
                       __MODULE__,
                       Code,
-                      Name,
                       Address);
 
         LogPrintf(LOG_LEVEL_CRITICAL,
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 2e8f2e6..c86d311 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -5783,7 +5783,7 @@ FdoSetWatchdog(
     ConfigFreeSzValue(Option);
 
     if (Value && Value < 10) {
-        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
+        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n", Value);
         Value = 10;
     }
 
diff --git a/src/xenbus/gnttab.c b/src/xenbus/gnttab.c
index 71f8ec1..3adcef4 100644
--- a/src/xenbus/gnttab.c
+++ b/src/xenbus/gnttab.c
@@ -821,6 +821,7 @@ GnttabDebugCallback(
         XENBUS_DEBUG(Printf,
                     &Context->DebugInterface,
                      "[%u] Address = %08x.%08x\n",
+                     Index,
                      Address.HighPart,
                      Address.LowPart);
     }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Wed Aug 19 11:34:22 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 19 Aug 2026 11:34:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1395210.1633688 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wweYn-0004jb-OX; Wed, 19 Aug 2026 11:34:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1395210.1633688; Wed, 19 Aug 2026 11:34:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wweYn-0004jU-Ld; Wed, 19 Aug 2026 11:34:21 +0000
Received: by outflank-mailman (input) for mailman id 1395210;
 Wed, 19 Aug 2026 11:34:19 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a019cce994000c4f3@swg.vates.tech>)
 id 1wweYl-0004jO-2x
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 11:34:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wweYk-002Q7f-BL
 for win-pv-devel@lists.xenproject.org; Wed, 19 Aug 2026 13:34:18 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a019cce994000c4f3@swg.vates.tech>)
 id 6a8594ba-8faa-0a2a0a5109dd-0a2a45078528-0
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 13:34:18 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a019cce994000c4f3@swg.vates.tech>)
 id 6a8594b9-b4ea-0a2a45070019-b9ff1c2393c3-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 19 Aug 2026 13:34:17 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a019cce994000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 19 Aug 2026 11:34:14 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id D311F81C24;
 Wed, 19 Aug 2026 13:34:13 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=cGoAv0Chz2+68r6KSXypu5s4Gg3TgNefk1zYhqD5lTk=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=VaPfK9yppKg/l3LIagdP3OTOS/5HM3Mvo2Cb5nQjP2CbtNjDkNo3sYfrYmDftppnbWBfvEWBI
 C7cn6KweGhOgJGD7MKbzpMhm1iU63l0EnhOdbG2BR8pyEwE4EqPmLs4bmYAeq3uiM9YeBZVdRfR
 5QX8YClTv+6NDbQBxI8Pq41NWtxvK6xB/cMdU7aNzr3nP/KF2D/Hv2IY3RVroQx7QUvo9L8kohM
 UKnl/P19Kq8a2kIrgwiZN+haaO+YFgF39sz7jxLegMVC38cQD/8UFTc1/7i/tJEX6tNzc3Rpy3J
 H7PkyREmuDNjNdBWGkE7zG6ATdZpx4xhNRWf+KVrBq5w==
X-Zone-Loop: 181b8c99fd2332994926b3d073f20c6528b32e8a1ebe
x-campaign-type: default
x-transaction-id: d88bcd6f-7b54-4de7-a261-b4c99659708d
x-swg-uid: 01-dd70284e-d844-44ac-8f40-fa580b3fadec
X-Mailer: Sweego
Message-ID:
 <1787139254.8631fc262581453bbf619ec5b2062170.1a019cce994000c4f3@vates.tech>
x-swg-bid: 1787139254.8631fc262581453bbf619ec5b2062170.1a019cce994000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 19 Aug 2026 13:34:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 0/8] Use AI to detected issues
To: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20260819063015.602-1-owen.smith@citrix.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <20260819063015.602-1-owen.smith@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2574.b1bc9636ea739005.1a019cce69c.beba109aa2a6c768=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787139253917
X-purgate-ID: tlsNG-ef75cf/1787139258-35AC0AE4-0E2F4404/0/0
X-purgate-type: clean
X-purgate-size: 1719

---=Part.2574.b1bc9636ea739005.1a019cce69c.beba109aa2a6c768=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 19/08/2026 08:30, Owen Smith wrote:
> Issues detected with ClaudeCode:claude-opus-4=2E8 and patches
> generated manually=2E AI was not used to generate any patches=2E
> Adds the 'Assisted-by' tag to all commits to show which AI model
> detected these issues=2E
>=20
> * store: correct length test, and allow length of 0
> * registry: detect the overrun and fail, rather than ASSERTing
>=20
> Owen Smith (8):
>    log: Avoid buffer overrun in DbgPrint interception
>    store: Detect bad response from xenstored
>    fdo: Use IoFreeMdl when IoAllocateMdl was uesd to allocate
>    registry: Fix wrong truncation of Unicode=2ELength
>    evtchn: Dont Release SHARED_INFO interface if Acquire failed
>    monitor: Check allocated pointer, not Context
>    high: Zero the HIGH_LOCK value, not the pointer
>    Correct printf parameters

All patches:

Reviewed-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>

>=20
>   src/common/high=2Eh      |  2 +-
>   src/common/registry=2Ec  | 27 ++++++++++++++++++++-------
>   src/monitor/monitor=2Ec  |  6 +++---
>   src/xen/bug_check=2Ec    |  2 --
>   src/xen/log=2Ec          | 10 ++++++++--
>   src/xenbus/evtchn_2l=2Ec |  2 --
>   src/xenbus/fdo=2Ec       |  4 ++--
>   src/xenbus/gnttab=2Ec    |  1 +
>   src/xenbus/store=2Ec     |  6 +++++-
>   9 files changed, 40 insertions(+), 20 deletions(-)
>=20



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2574.b1bc9636ea739005.1a019cce69c.beba109aa2a6c768=---


From win-pv-devel-bounces@lists.xenproject.org Tue Aug 25 21:01:16 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Aug 2026 21:01:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399448.1635533 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyGg-0006vf-Ve; Tue, 25 Aug 2026 21:01:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399448.1635533; Tue, 25 Aug 2026 21:01:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyGg-0006vX-T1; Tue, 25 Aug 2026 21:01:14 +0000
Received: by outflank-mailman (input) for mailman id 1399448;
 Tue, 25 Aug 2026 21:01:14 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@swg.vates.tech>)
 id 1wyyGf-0006vQ-Nm
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 21:01:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wyyGe-001e2E-3B
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 23:01:12 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@swg.vates.tech>)
 id 6a8e0271-2eae-0a2a0a5409dd-0a2a450caee4-38
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:01:11 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@swg.vates.tech>)
 id 6a8e0297-f479-0a2a450c0019-b9ff1c23a5f1-3
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:01:11 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03aba1759000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 25 Aug 2026 21:01:09 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id A19E181014;
 Tue, 25 Aug 2026 23:01:08 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=egrJ+nrpZdVSHoLbyMM0XrG5KiUgW2m63zwgHZeub8Y=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=bZeJTj5e5UXtOg7M3Wujx9DBaumfxzYHIrhDjDtQQ7Si+vYhSfWu5amd2TK5zW0vZNCrZxiuE
 mWqnjgeXM7hbazFPPVXZlIDyNKd+MNVFHv40Ct4Ve2EI4Xq79+1VS1EwXt4l8sLnS079lMffBwb
 O3VgItMrbR70bAu7NbwQE1ty2Pakl41HHOAMJD2HxuJgIGAf2gtRnUe7Lx5bZpTk0UDmgpadZ0c
 0LZVz6NNr25FcG4JoI/QJ2F7+0oNUvxCxymq+oMAjXhx6B6cD/KvtVhgvLEdt0IA18HkOfSVwrn
 HbTtBnclKT3g0/lAJ2dGwhydT+neYsF8fmwS0HLQZiXg==
X-Zone-Loop: 78cdd5bd0b4c6103cbb4be699c6a5683a79cb5e82b86
x-campaign-type: default
x-transaction-id: b1d988db-87fb-4910-b0c3-9fc3704bc3a9
x-swg-uid: 01-4e3ea21e-ab13-4fbb-8a1d-209c7d855425
X-Mailer: Sweego
Message-ID:
 <1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
x-swg-bid: 1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Owen Smith <owen.smith@citrix.com>
Subject: [PATCH] registry: Fix wrong truncation of Unicode.Length
Date: Tue, 25 Aug 2026 23:01:03 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2b83.2366b3e6c56d6d65.1a03aba1505.97701167da5c9776=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787691668741
X-purgate-ID: tlsNG-d25034/1787691671-77AD4A5B-8C594F22/0/0
X-purgate-type: clean
X-purgate-size: 3112

---=Part.2b83.2366b3e6c56d6d65.1a03aba1505.97701167da5c9776=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Assisted-by: ClaudeCode:claude-opus-4=2E8
Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Ported from XenBus=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 src/xencons/registry=2Ec | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/xencons/registry=2Ec b/src/xencons/registry=2Ec
index 1f7a73c=2E=2E4f7c5ef 100644
--- a/src/xencons/registry=2Ec
+++ b/src/xencons/registry=2Ec
@@ -1453,30 +1453,37 @@ RegistryAnsiToSz(
     NTSTATUS                        status;
=20
     Length =3D Ansi->Length + 1;
+
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                  Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_SZ;
     Partial->DataLength =3D Length * sizeof (WCHAR);
=20
-    Unicode=2EMaximumLength =3D (UCHAR)Partial->DataLength;
+    Unicode=2EMaximumLength =3D (USHORT)Partial->DataLength;
     Unicode=2EBuffer =3D (PWCHAR)Partial->Data;
     Unicode=2ELength =3D 0;
=20
     status =3D RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
@@ -1496,12 +1503,16 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++)
         Length +=3D Ansi[Index]=2ELength + 1;
=20
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_MULTI_SZ;
@@ -1514,7 +1525,7 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++) {
         status =3D RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index], F=
ALSE);
         if (!NT_SUCCESS(status))
-            goto fail2;
+            goto fail3;
=20
         Length =3D Unicode=2ELength / sizeof (WCHAR);
=20
@@ -1527,9 +1538,11 @@ RegistryAnsiToMultiSz(
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
--=20
2=2E55=2E0=2Ewindows=2E3



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2b83.2366b3e6c56d6d65.1a03aba1505.97701167da5c9776=---


From win-pv-devel-bounces@lists.xenproject.org Tue Aug 25 21:01:59 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Aug 2026 21:01:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399449.1635539 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyHP-0006yj-37; Tue, 25 Aug 2026 21:01:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399449.1635539; Tue, 25 Aug 2026 21:01:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyHO-0006yb-Vq; Tue, 25 Aug 2026 21:01:58 +0000
Received: by outflank-mailman (input) for mailman id 1399449;
 Tue, 25 Aug 2026 21:01:57 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abac6c8000c4f3@swg.vates.tech>)
 id 1wyyHN-0006yQ-Bq
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 21:01:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wyyHM-001eDH-Ou
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 23:01:56 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abac6c8000c4f3@swg.vates.tech>)
 id 6a8e02af-2eae-0a2a0a5409dd-0a2a4501945e-36
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:01:56 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abac6c8000c4f3@swg.vates.tech>)
 id 6a8e02c4-5984-0a2a45010019-b9ff1c129d77-3
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:01:56 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03abac6c8000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 25 Aug 2026 21:01:54 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id A4B7C81F05;
 Tue, 25 Aug 2026 23:01:53 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=yHiR8zdukMj3ysB5nQoo5Fh53egsYGW0Q4+KucQklJE=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=C/s+lWSYXizxhX3jBtTrzjT1aFeotqZ2QFjBvp8DTKxISrGTxV8KU4aqOfEgCnrQy/xRj0D5A
 VIytoxgXgfdO9w1ZgBWxunzKTu7xP9PBStv6uO/u+PgSgvMtBODxcSyUQwAaWS6m/QyNILLhCv1
 2uGtPPGUTRqD1U6qbHsHVl4fXdm82lbu3+PiEk1ehbf2qSRkYXG7tknri/1eqkNhF47EBM4R2yp
 +vjjSq4iQFUkqwJIEUqu9k5+NpCUKvk4K1+trsAZXA6GVIRRlmoj3fWfaNMvpbyRnqLzggmHEam
 cDodQm17cwWxr2MKD+aY7a+I6ikJPquZSpSxOFFX3Riw==
X-Zone-Loop: 0c8915dc261ed5239ee85b36407143331a599ccccbc0
x-campaign-type: default
x-transaction-id: 2412e972-23e6-4cf5-980f-30f9b202f73d
x-swg-uid: 01-37850e91-2c7d-428f-b9f9-c83848ff1975
X-Mailer: Sweego
Message-ID:
 <1787691714.8631fc262581453bbf619ec5b2062170.1a03abac6c8000c4f3@vates.tech>
x-swg-bid: 1787691714.8631fc262581453bbf619ec5b2062170.1a03abac6c8000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Owen Smith <owen.smith@citrix.com>
Subject: [PATCH] registry: Fix wrong truncation of Unicode.Length
Date: Tue, 25 Aug 2026 23:01:48 +0200
In-Reply-To: <<1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
References: <<1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2b84.c3d5d3a2cda3bfd9.1a03abac4c9.69cc9964d1cce4d7=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787691713737
X-purgate-ID: tlsNG-d62444/1787691716-BDC79757-7AC518F7/0/0
X-purgate-type: clean
X-purgate-size: 3117

---=Part.2b84.c3d5d3a2cda3bfd9.1a03abac4c9.69cc9964d1cce4d7=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Assisted-by: ClaudeCode:claude-opus-4=2E8
Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Ported from XenBus=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 src/xeniface/registry=2Ec | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/xeniface/registry=2Ec b/src/xeniface/registry=2Ec
index 423c4cc=2E=2Efef8c1b 100644
--- a/src/xeniface/registry=2Ec
+++ b/src/xeniface/registry=2Ec
@@ -1385,30 +1385,37 @@ RegistryAnsiToSz(
     NTSTATUS                        status;
=20
     Length =3D Ansi->Length + 1;
+
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                  Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_SZ;
     Partial->DataLength =3D Length * sizeof (WCHAR);
=20
-    Unicode=2EMaximumLength =3D (UCHAR)Partial->DataLength;
+    Unicode=2EMaximumLength =3D (USHORT)Partial->DataLength;
     Unicode=2EBuffer =3D (PWCHAR)Partial->Data;
     Unicode=2ELength =3D 0;
=20
     status =3D RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
@@ -1428,12 +1435,16 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++)
         Length +=3D Ansi[Index]=2ELength + 1;
=20
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_MULTI_SZ;
@@ -1446,7 +1457,7 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++) {
         status =3D RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index], F=
ALSE);
         if (!NT_SUCCESS(status))
-            goto fail2;
+            goto fail3;
=20
         Length =3D Unicode=2ELength / sizeof (WCHAR);
=20
@@ -1459,9 +1470,11 @@ RegistryAnsiToMultiSz(
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
--=20
2=2E55=2E0=2Ewindows=2E3



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2b84.c3d5d3a2cda3bfd9.1a03abac4c9.69cc9964d1cce4d7=---


From win-pv-devel-bounces@lists.xenproject.org Tue Aug 25 21:02:09 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Aug 2026 21:02:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399450.1635541 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyHZ-00071H-4T; Tue, 25 Aug 2026 21:02:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399450.1635541; Tue, 25 Aug 2026 21:02:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyHZ-000719-1H; Tue, 25 Aug 2026 21:02:09 +0000
Received: by outflank-mailman (input) for mailman id 1399450;
 Tue, 25 Aug 2026 21:02:07 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abae860000c4f3@swg.vates.tech>)
 id 1wyyHX-00070i-H3
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 21:02:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wyyHW-00COcx-Tr
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 23:02:06 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abae860000c4f3@swg.vates.tech>)
 id 6a8e02ca-bab6-0a2a0a5309dd-0a2a4503c694-8
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:02:06 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abae860000c4f3@swg.vates.tech>)
 id 6a8e02ce-fae8-0a2a45030019-b9ff1c2388fd-3
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:02:06 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03abae860000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 25 Aug 2026 21:02:02 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5800981F05;
 Tue, 25 Aug 2026 23:02:02 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=/z5iYJPJjQ8wQGMn8iNQ/JlKJB2jf+VKTFnZt3K/Meg=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=cOJ0MBHH3W+pybwdat3jql1/rIfG1oce1xaxCpSMS1cigzaLTGmMicx9Zb+1LcKVX/KaoQkHn
 iHosBDj8l3yIHpm7tGtJXAzsX2TKoCsJVxp7louGYNKHI6K6PKB8w1IMOGotyG1UDqwVBL+lDLz
 rL6ZchpJk6gmgHf6u4Nhd4GSUEsBW70JUHYpqmu0KtsWwmhvovYD0n6MxpOQiRjWDI2VcclZrNh
 9dnIgeaUs0mZH0seqL27BIVRtNW18hNgeQbnCl+5P/74yrBvcgXQ72+IYFUK5a5FVAPcNOigg7B
 K7SgObNzw4cPMQwVYK1KZiAMWoFJ29kM2ZMshgXzYriw==
X-Zone-Loop: 08ff77fdf5b7c82c51a63a4c21db50028cc1304a4269
x-campaign-type: default
x-transaction-id: fb2ea41a-c425-40de-9d8a-d9bc4b0fff20
x-swg-uid: 01-c75d7ff8-0366-464d-9c30-691ab828fc45
X-Mailer: Sweego
Message-ID:
 <1787691722.8631fc262581453bbf619ec5b2062170.1a03abae860000c4f3@vates.tech>
x-swg-bid: 1787691722.8631fc262581453bbf619ec5b2062170.1a03abae860000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Owen Smith <owen.smith@citrix.com>
Subject: [PATCH] registry: Fix wrong truncation of Unicode.Length
Date: Tue, 25 Aug 2026 23:01:59 +0200
In-Reply-To: <1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
References: <1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2b85.56a2e091e0d0cf39.1a03abae6ba.bd903b35a1a9e6b7=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787691722426
X-purgate-ID: tlsNG-33051d/1787691726-766FB4E9-106CD73D/0/0
X-purgate-type: clean
X-purgate-size: 3107

---=Part.2b85.56a2e091e0d0cf39.1a03abae6ba.bd903b35a1a9e6b7=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Assisted-by: ClaudeCode:claude-opus-4=2E8
Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Ported from XenBus=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 src/xenvbd/registry=2Ec | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/xenvbd/registry=2Ec b/src/xenvbd/registry=2Ec
index fa9c0d4=2E=2E2275463 100644
--- a/src/xenvbd/registry=2Ec
+++ b/src/xenvbd/registry=2Ec
@@ -1407,30 +1407,37 @@ RegistryAnsiToSz(
     NTSTATUS                        status;
=20
     Length =3D Ansi->Length + 1;
+
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                  Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_SZ;
     Partial->DataLength =3D Length * sizeof (WCHAR);
=20
-    Unicode=2EMaximumLength =3D (UCHAR)Partial->DataLength;
+    Unicode=2EMaximumLength =3D (USHORT)Partial->DataLength;
     Unicode=2EBuffer =3D (PWCHAR)Partial->Data;
     Unicode=2ELength =3D 0;
=20
     status =3D RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
@@ -1451,12 +1458,16 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++)
         Length +=3D Ansi[Index]=2ELength + 1;
=20
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_MULTI_SZ;
@@ -1469,7 +1480,7 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++) {
         status =3D RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index], F=
ALSE);
         if (!NT_SUCCESS(status))
-            goto fail2;
+            goto fail3;
=20
         Length =3D Unicode=2ELength / sizeof (WCHAR);
=20
@@ -1482,9 +1493,11 @@ RegistryAnsiToMultiSz(
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
--=20
2=2E55=2E0=2Ewindows=2E3



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2b85.56a2e091e0d0cf39.1a03abae6ba.bd903b35a1a9e6b7=---


From win-pv-devel-bounces@lists.xenproject.org Tue Aug 25 21:02:14 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Aug 2026 21:02:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399451.1635544 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyHe-00073E-57; Tue, 25 Aug 2026 21:02:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399451.1635544; Tue, 25 Aug 2026 21:02:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyHe-000737-2h; Tue, 25 Aug 2026 21:02:14 +0000
Received: by outflank-mailman (input) for mailman id 1399451;
 Tue, 25 Aug 2026 21:02:13 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abb04ea000c4f3@swg.vates.tech>)
 id 1wyyHd-00072v-61
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 21:02:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wyyHc-009tpu-2d
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 23:02:12 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abb04ea000c4f3@swg.vates.tech>)
 id 6a8e02b9-e002-0a2a0a5209dd-0a2a4509be30-34
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:02:12 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abb04ea000c4f3@swg.vates.tech>)
 id 6a8e02d3-be1a-0a2a45090019-b9ff1c22b491-3
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:02:11 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03abb04ea000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 25 Aug 2026 21:02:10 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 9010781F21;
 Tue, 25 Aug 2026 23:02:09 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=9bSdpZK8yVJNwQSpNoEgjQMqgxaP+9cQ//baPYWIAHA=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=g2c9gkiURcwJ4xyv34pHgKkCCSEoegOpA9hKVCMbtVeSxW4iGYrbYRBSsm7kKpT8XkoVMaKnr
 rNyFqAm0jQFMo/RsePGGOGqZUAEp+QHFtSK2VIWBFs79mSLOEH18QdmtQlZGq72SKH39LQJu+pv
 NOEPQEpuaqPPpm6a3y69wdaJTQ4QAwwPAzjsWj7m/H03Ta1X6KVF/RtlJ8DBn4vx2SHqA2Wubn+
 t3HI3CCvLBSsf+1jgz1g/g6rlvpctcuLASi4J4rEfERY5acd2gB8P31u3TU1B+4DvtAoekktig9
 jwGcb5Uf/CmtvNIErQpCdkH4QqQLIIrIL9+6CT1Y8/rQ==
X-Zone-Loop: 284d608c1ed9910badc094abb47a3f19ea2fb9e8abab
x-campaign-type: default
x-transaction-id: fd161565-c928-4fb5-8b8f-a132d4638b34
x-swg-uid: 01-6696950f-bdca-4a1f-8247-25f943a461cf
X-Mailer: Sweego
Message-ID:
 <1787691730.8631fc262581453bbf619ec5b2062170.1a03abb04ea000c4f3@vates.tech>
x-swg-bid: 1787691730.8631fc262581453bbf619ec5b2062170.1a03abb04ea000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Owen Smith <owen.smith@citrix.com>
Subject: [PATCH] registry: Fix wrong truncation of Unicode.Length
Date: Tue, 25 Aug 2026 23:02:06 +0200
In-Reply-To: <1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
References: <1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2b86.19806647fce58b8d.1a03abb02f6.85f82a0fdadd18f=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787691729654
X-purgate-ID: tlsNG-bad1c0/1787691732-BCECE034-C800FE1C/0/0
X-purgate-type: clean
X-purgate-size: 3105

---=Part.2b86.19806647fce58b8d.1a03abb02f6.85f82a0fdadd18f=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Assisted-by: ClaudeCode:claude-opus-4=2E8
Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Ported from XenBus=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 src/xenvif/registry=2Ec | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/xenvif/registry=2Ec b/src/xenvif/registry=2Ec
index 8f84818=2E=2Ee498497 100644
--- a/src/xenvif/registry=2Ec
+++ b/src/xenvif/registry=2Ec
@@ -1305,30 +1305,37 @@ RegistryAnsiToSz(
     NTSTATUS                        status;
=20
     Length =3D Ansi->Length + 1;
+
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                  Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_SZ;
     Partial->DataLength =3D Length * sizeof (WCHAR);
=20
-    Unicode=2EMaximumLength =3D (UCHAR)Partial->DataLength;
+    Unicode=2EMaximumLength =3D (USHORT)Partial->DataLength;
     Unicode=2EBuffer =3D (PWCHAR)Partial->Data;
     Unicode=2ELength =3D 0;
=20
     status =3D RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
@@ -1348,12 +1355,16 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++)
         Length +=3D Ansi[Index]=2ELength + 1;
=20
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_MULTI_SZ;
@@ -1366,7 +1377,7 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++) {
         status =3D RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index], F=
ALSE);
         if (!NT_SUCCESS(status))
-            goto fail2;
+            goto fail3;
=20
         Length =3D Unicode=2ELength / sizeof (WCHAR);
=20
@@ -1379,9 +1390,11 @@ RegistryAnsiToMultiSz(
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
--=20
2=2E55=2E0=2Ewindows=2E3



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2b86.19806647fce58b8d.1a03abb02f6.85f82a0fdadd18f=---


From win-pv-devel-bounces@lists.xenproject.org Tue Aug 25 21:02:25 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Aug 2026 21:02:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399452.1635549 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyHp-00076U-76; Tue, 25 Aug 2026 21:02:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399452.1635549; Tue, 25 Aug 2026 21:02:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyHp-00076M-4L; Tue, 25 Aug 2026 21:02:25 +0000
Received: by outflank-mailman (input) for mailman id 1399452;
 Tue, 25 Aug 2026 21:02:23 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abb2335000c4f3@swg.vates.tech>)
 id 1wyyHn-000763-CC
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 21:02:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wyyHm-001eDH-Oz
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 23:02:22 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abb2335000c4f3@swg.vates.tech>)
 id 6a8e02d4-2eae-0a2a0a5409dd-0a2a450cc8a0-14
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:02:22 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abb2335000c4f3@swg.vates.tech>)
 id 6a8e02de-f479-0a2a450c0019-b9ff1c23a6fd-3
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:02:22 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03abb2335000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 25 Aug 2026 21:02:17 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 6817281F05;
 Tue, 25 Aug 2026 23:02:17 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=xqmN9JaoiY3dbYPs1FsKVKR5qIDsOqkc2yPm2yit+uQ=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=bnnMQ0fZv5oRBUFrJxJ5MjsSuuE52SS+VMrd8xN2EJmE9N8AYuLoloa1T5K0Erbi9TCPzSypg
 CEn9ZrJESSzlClFphq/bwwm/n/KqCaJsvlzeQ0WAee3Qw0DC0qym4j+q3kXb1Elj7243Ojmln9r
 Nh23NSQvo6/IH/Uqd3V04E/weRoCEzF2hYxfkSQl1UE9HnNV0zTLjww3Q0yV5yRurzYNfdSwLqF
 Iyc4mrLEpoTJ8ruGNZe/g9cpNCUWXd6h7dp43Qv9wgijjjek/M7h1mZKPdDCOQGHbGa0c3yymLT
 n7viS9QFcPSu5mV/sIhzSg7YpYrJ2ZQf61Y1wwQ4uc6g==
X-Zone-Loop: 556b56b1d9a90933d5049b84018d4f571e42aca158d0
x-campaign-type: default
x-transaction-id: 150e19ec-3d79-4dc4-ba58-71aeed1c8e9d
x-swg-uid: 01-3b1e08cd-34ae-4a7d-b4aa-6962f10c2ad1
X-Mailer: Sweego
Message-ID:
 <1787691737.8631fc262581453bbf619ec5b2062170.1a03abb2335000c4f3@vates.tech>
x-swg-bid: 1787691737.8631fc262581453bbf619ec5b2062170.1a03abb2335000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Owen Smith <owen.smith@citrix.com>
Subject: [PATCH] registry: Fix wrong truncation of Unicode.Length
Date: Tue, 25 Aug 2026 23:02:13 +0200
In-Reply-To: <1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
References: <1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2b87.2b12eaba93e1c630.1a03abb2195.70be843539729a52=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787691737493
X-purgate-ID: tlsNG-d25034/1787691742-032D8A5B-DA87ABBD/0/0
X-purgate-type: clean
X-purgate-size: 3112

---=Part.2b87.2b12eaba93e1c630.1a03abb2195.70be843539729a52=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Assisted-by: ClaudeCode:claude-opus-4=2E8
Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Ported from XenBus=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 src/xenvkbd/registry=2Ec | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/xenvkbd/registry=2Ec b/src/xenvkbd/registry=2Ec
index 8f84818=2E=2Ee498497 100644
--- a/src/xenvkbd/registry=2Ec
+++ b/src/xenvkbd/registry=2Ec
@@ -1305,30 +1305,37 @@ RegistryAnsiToSz(
     NTSTATUS                        status;
=20
     Length =3D Ansi->Length + 1;
+
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                  Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_SZ;
     Partial->DataLength =3D Length * sizeof (WCHAR);
=20
-    Unicode=2EMaximumLength =3D (UCHAR)Partial->DataLength;
+    Unicode=2EMaximumLength =3D (USHORT)Partial->DataLength;
     Unicode=2EBuffer =3D (PWCHAR)Partial->Data;
     Unicode=2ELength =3D 0;
=20
     status =3D RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
@@ -1348,12 +1355,16 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++)
         Length +=3D Ansi[Index]=2ELength + 1;
=20
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_MULTI_SZ;
@@ -1366,7 +1377,7 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++) {
         status =3D RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index], F=
ALSE);
         if (!NT_SUCCESS(status))
-            goto fail2;
+            goto fail3;
=20
         Length =3D Unicode=2ELength / sizeof (WCHAR);
=20
@@ -1379,9 +1390,11 @@ RegistryAnsiToMultiSz(
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
--=20
2=2E55=2E0=2Ewindows=2E3



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2b87.2b12eaba93e1c630.1a03abb2195.70be843539729a52=---


From win-pv-devel-bounces@lists.xenproject.org Tue Aug 25 21:04:41 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Aug 2026 21:04:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399458.1635553 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyK1-0007DF-E9; Tue, 25 Aug 2026 21:04:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399458.1635553; Tue, 25 Aug 2026 21:04:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wyyK1-0007D7-BF; Tue, 25 Aug 2026 21:04:41 +0000
Received: by outflank-mailman (input) for mailman id 1399458;
 Tue, 25 Aug 2026 21:04:40 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abd34c2000c4f3@swg.vates.tech>)
 id 1wyyK0-0007Cl-18
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 21:04:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wyyJy-005y6w-Ub
 for win-pv-devel@lists.xenproject.org; Tue, 25 Aug 2026 23:04:38 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abd34c2000c4f3@swg.vates.tech>)
 id 6a8e0347-8faa-0a2a0a5109dd-0a2a45038cc4-12
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:04:38 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03abd34c2000c4f3@swg.vates.tech>)
 id 6a8e0366-fae8-0a2a45030019-b9ff1c12a2bd-3
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Aug 2026 23:04:38 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03abd34c2000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 25 Aug 2026 21:04:33 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id E38508105A;
 Tue, 25 Aug 2026 23:04:32 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=SaH4ifdrojNSSCEEz/iEmaQ9bgCdmpUlO2BE9ltNAiw=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=fHKz3O9Cgrdn0WSVSe7F++VgXEl01dmBoxiPztZOtCACjlDeyl5EXP/VNJTIQJmcAm4lPFmO5
 bhr1s+EksbxO8xlweTdF9VZwsdRsK7tRHykFmu2eegloM9z5NTon5BvssH7YSLLhg1LL02MddeB
 ZGk0tddhnw9ug1XgLBjlWlfDaB28xxnUItY/s9iDUM4XRFccI1B9FuyQcVIYkTaRdpaK447AXZ6
 icvrIXN6ikUexG4jaB3D0F8puSi0nAU6JenEFyw4Xe2QmlMmV4cQkgcgCjMqR3PMIyWyLKVszT8
 q1UuuN96ERkk3Q9ogfHkOb5JEzMRqbin9r3g1T68Pr0g==
X-Zone-Loop: e00259b3cb90860e897ba90f41475ca4a32566172bb4
x-campaign-type: default
x-transaction-id: e80c75fd-bd9d-49b0-884e-1f4e5b1fd5a5
x-swg-uid: 01-26c9e622-b9e6-496d-bdea-ce11384a8dda
X-Mailer: Sweego
Message-ID:
 <1787691873.8631fc262581453bbf619ec5b2062170.1a03abd34c2000c4f3@vates.tech>
x-swg-bid: 1787691873.8631fc262581453bbf619ec5b2062170.1a03abd34c2000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Owen Smith <owen.smith@citrix.com>
Subject: [PATCH RESEND] registry: Fix wrong truncation of Unicode.Length
Date: Tue, 25 Aug 2026 23:04:29 +0200
In-Reply-To: <1787691714.8631fc262581453bbf619ec5b2062170.1a03abac6c8000c4f3@vates.tech>
References: <1787691714.8631fc262581453bbf619ec5b2062170.1a03abac6c8000c4f3@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2b88.da9e0a296dc7e9e7.1a03abd32e6.4a835d592193e9e=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787691872998
X-purgate-ID: tlsNG-33051d/1787691878-6CADC4E9-94504B65/0/0
X-purgate-type: clean
X-purgate-size: 3152

---=Part.2b88.da9e0a296dc7e9e7.1a03abd32e6.4a835d592193e9e=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Assisted-by: ClaudeCode:claude-opus-4=2E8
Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Ported from XenBus=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
Resend in the proper thread=2E
---
 src/xeniface/registry=2Ec | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/xeniface/registry=2Ec b/src/xeniface/registry=2Ec
index 423c4cc=2E=2Efef8c1b 100644
--- a/src/xeniface/registry=2Ec
+++ b/src/xeniface/registry=2Ec
@@ -1385,30 +1385,37 @@ RegistryAnsiToSz(
     NTSTATUS                        status;
=20
     Length =3D Ansi->Length + 1;
+
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                  Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_SZ;
     Partial->DataLength =3D Length * sizeof (WCHAR);
=20
-    Unicode=2EMaximumLength =3D (UCHAR)Partial->DataLength;
+    Unicode=2EMaximumLength =3D (USHORT)Partial->DataLength;
     Unicode=2EBuffer =3D (PWCHAR)Partial->Data;
     Unicode=2ELength =3D 0;
=20
     status =3D RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
@@ -1428,12 +1435,16 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++)
         Length +=3D Ansi[Index]=2ELength + 1;
=20
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMA=
TION, Data) +
                                Length * sizeof (WCHAR));
=20
     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;
=20
     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_MULTI_SZ;
@@ -1446,7 +1457,7 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index]=2EBuffer !=3D NULL; Index++) {
         status =3D RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index], F=
ALSE);
         if (!NT_SUCCESS(status))
-            goto fail2;
+            goto fail3;
=20
         Length =3D Unicode=2ELength / sizeof (WCHAR);
=20
@@ -1459,9 +1470,11 @@ RegistryAnsiToMultiSz(
=20
     return Partial;
=20
-fail2:
+fail3:
     __RegistryFree(Partial);
=20
+fail2:
+
 fail1:
     return NULL;
 }
--=20
2=2E55=2E0=2Ewindows=2E3



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2b88.da9e0a296dc7e9e7.1a03abd32e6.4a835d592193e9e=---


From win-pv-devel-bounces@lists.xenproject.org Wed Aug 26 08:26:13 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 26 Aug 2026 08:26:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399696.1635679 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz8xY-0003Tb-Au; Wed, 26 Aug 2026 08:26:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399696.1635679; Wed, 26 Aug 2026 08:26:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz8xY-0003TU-7x; Wed, 26 Aug 2026 08:26:12 +0000
Received: by outflank-mailman (input) for mailman id 1399696;
 Wed, 26 Aug 2026 08:26:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wz8xW-0003TO-Ic
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 08:26:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wz8xV-00CPg0-9q
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 10:26:09 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a8ea320-2eae-0a2a0a5409dd-0a2a4509b0f6-2
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 10:26:09 +0200
Received: from [40.93.198.67]
 (helo=CY7PR03CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a8ea31f-be1a-0a2a45090019-285dc643c433-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 10:26:08 +0200
Received: from SA6PR03MB7760.namprd03.prod.outlook.com (2603:10b6:806:43c::5)
 by IA3PR03MB7620.namprd03.prod.outlook.com (2603:10b6:208:50d::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.6; Wed, 26 Aug
 2026 08:26:05 +0000
Received: from SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::4d5b:a91f:46a3:4b38]) by SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::4d5b:a91f:46a3:4b38%3]) with mapi id 15.21.0339.010; Wed, 26 Aug 2026
 08:26:05 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Ug/0EpJO5bHcKDHqkMoC85x2qeEvQwYz8CRtiPd0l6ckAIJC9Hwwi1/BnuYJJjyswl9I6jAq4O5w0T2ZQ/iM2kX3YeH+F9n/95oYIdW6lLkp8GbGxcrI2dX3RGCxjL4HdKJ/Er1m1+h/4jxFhcdKTWS6e9rbG0eAQ5CpSlrII4BiLkpijyZfxB+6TUbKheKfqYyCspBh05TpELRfD7p4K+lgJXpAzys6weDLm3MCBBJiCB8dGMYLAG5HDWkvd20zEZYRSXu3d9HeDlsRdbr10Aopf1s7P9zJY4/COu9LUPdMear58IIOfkB3IvyzLHUe9F4RiB6fiChE3Sshmqk3OQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QQSiWJLNSLf+kbOk+Zto2Nnsgw1hMSDoNupEWpoXcNk=;
 b=m4e+V8wh+sPetrN/ZUep/v0cEqHwdyhEsId3Cnljg9U235mpUUm+aFUnB0jNr+DaxJVH+IgxHSy+oPsymcoEUUDP/7LoZjLq9NHflxOhDFAhpxh8Pepz9khNVdvLTSPBZgCdT5XMX8K3M9Pe6DRTrZZFnT+cAQd5IqfQwSsvhNnCxkVYpVgB774q08PtqZlqRXg+Ltb194U4PCVyuiTFPf8ss0KHXYdLKixzBh+Bjv212ZT3CX8FTKtB7+mmmvCBjX38K1RPcddZ92Jd+Vte8vmr3fp9Vl4zJYkinK+gX7w8Vw2bo0Ysv09FMdXObJEhe5RMHUWTG4IcQbLxHPnIlw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QQSiWJLNSLf+kbOk+Zto2Nnsgw1hMSDoNupEWpoXcNk=;
 b=pYGDDMBtuI9Da7gcRO9kqyFGz8kvSYjGTWcRg7g3kHGxhuSUbZflMW8W+SlvwjS55CAr+DoP257ITxUULBsVE0+EOyKYFDWmZtsuDwEYNzxyeq3bFcwE7NLbxOgHJ3HuKfdO3dEphRkeL77lE2/LSbWnU54kMhYSwU6rZMyUA2k=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH] registry: Fix wrong truncation of Unicode.Length
Thread-Topic: [PATCH] registry: Fix wrong truncation of Unicode.Length
Thread-Index: AQHdNNTg/k3RmxEXQk2eLFKvXyKqCLavQFeAgAC+98c=
Date: Wed, 26 Aug 2026 08:26:05 +0000
Message-ID:
 <SA6PR03MB7760233BA5214BF9A0B9C7FEFEAE2@SA6PR03MB7760.namprd03.prod.outlook.com>
References:
 <1787691669.8631fc262581453bbf619ec5b2062170.1a03aba1759000c4f3@vates.tech>
 <1787691737.8631fc262581453bbf619ec5b2062170.1a03abb2335000c4f3@vates.tech>
In-Reply-To:
 <1787691737.8631fc262581453bbf619ec5b2062170.1a03abb2335000c4f3@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA6PR03MB7760:EE_|IA3PR03MB7620:EE_
x-ms-office365-filtering-correlation-id: bdbd7d00-648b-418b-dd96-08df034bac3a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|38070700021|10067099003|11063799006|4143699003|56012099006|22082099003|18002099003;
x-microsoft-antispam-message-info:
 D+Vct2UXS5mGE7/L9MigadcsOLsBbcuNjeYn1//dqu9ABhp6V6QXIAjNwmmvd4AFl5sKOje68SwfhDrMnAEjkwL6GYt+Pk1Nlt2ZkZmHtEomlTpO+DnRl7YqNxZZy+MwmAcoErL0xGoQ5VAvr+uP0ZMK99ek+JZ2FfeXjEm3OM25MvbYgjeckFT4dim4jz79jeEaqoY39Qmqfs+tY35pjNhs8UE2vGSx6aXRIPghALA4W2PcD11rJgOFE4W52R497lFqQhZTChdRUaIFsFKRDv7nilX5H6iBPOUONG63ttjHl+enphkO+VxKr5/C2vloQ3oVV5VzbB1El/0fjObAdWvlw8mhR26Fz1RgqqFc67ftoFDcyOKqiSE+8wJI6Mn1FqHEn+lsHr/9awGtWNyueD9R8Pc/h6jeLikEJ6/DVh5e2UJZiS9HMRxJSpBGKmEfQmsFsw0Yc/bPlhuDhisiv4BXilcx/D43Qocoi2diP3oOp62gWQzw8pglYM6CgDp7//xQtt07UOWC/HzLVtPIbp9cQ0UrJEYRA8CZypheP54y1bmw4frzo6Qp0xZ6fn2rLjIv13x/ZqVnkCS33MCVKKb2WRp5nl/VHzoKPdMYA5Ug8OPZBmue3iYjRNbfrNSKKXYX9Oyuo8rnqnd7zaNLXJlSfXsrTZH2y7YC0ZbI4x4=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA6PR03MB7760.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(38070700021)(10067099003)(11063799006)(4143699003)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?XvlOfZJwgd46I9KiCU/0SOGq/4Eb2D3pqNw+xI33QqqqnOGrmowEUksNY3eN?=
 =?us-ascii?Q?8Sem6G+IbUeOYulp+CsDoYSevGSopTj0ntTh6ljurQvJwVnJxgm6kdOOKswJ?=
 =?us-ascii?Q?f3QEGiF8ultLCGktF3l2ZU5sYEf8vK+WutSl8mEeVDJ76Md98yFcFWZeFzLy?=
 =?us-ascii?Q?QPB8aPouHVoZ/e8nI2dUGwXs0Pl6uDMIAU9jT+gxeYiRQBZtPrKhtDuC28oA?=
 =?us-ascii?Q?3lfp5FFR6fMNsdNDWM7Dk2sQ9qyyhUaw9Wkd5xfHjHIqrOSN7Z6wDaXGldUv?=
 =?us-ascii?Q?4g/XSpdLx+CLZFSYovFNCFRQ1f/uBrPCoA2ObOVaB1kBwn958ZTOUwUNY2pl?=
 =?us-ascii?Q?foMXaKvWcxSK0K8jU2BpGlLKUMXreZDfv0E3D78cu3DpUlM6S4I2jK3VtYyg?=
 =?us-ascii?Q?NrEVVgpjJ3QGcR+gX57CM9gZWAuuzds1EMLBZnPPBBRmceBQV6MyxX/nr+v7?=
 =?us-ascii?Q?4jK/EFHqeOtdHFe5pR9uFo3RZw9RUErCyMgUzg6iCidh/EN+X6/QlxP0bGYO?=
 =?us-ascii?Q?kn1jEz4zEv+xcKFzWMTa2KActiPjvZXxrfuW+e+f6PuUCGjBOX2uqmA6XMuw?=
 =?us-ascii?Q?NbUVwnbTYazVma+NkMCXzl5fzYD4vTZyZj8Cw9yBuFXv42qighAH4B9Fcw3+?=
 =?us-ascii?Q?IcDdb6V21LdEiNWtYTAlV6HMf3uBnRTIoWJG9hhJXeDmroPqn4KlWZBP1ybR?=
 =?us-ascii?Q?V0PkBNp+n95ZlOZVv+/+QBw10sBoY2OkPoBLp/Ldh8/Gpo/R1aJFE3QkuCCE?=
 =?us-ascii?Q?Uc6rXafBVaDx7KmO2tAEpGJ1kMskYxPWKuPd9JRO2J/Siu4LxapNZXDpVQao?=
 =?us-ascii?Q?9RLXKZQ9sgiBYsNVX1UhWWy7QMhDvEJqMQZt/QCjJEV07FxFIfIq6uhX8G9D?=
 =?us-ascii?Q?WNh/d9g4uNdLL0kGmW4YcGJyptN40VlvB15daE73H6RtnwXWv4mc7/HEBrGI?=
 =?us-ascii?Q?iRoUwsuoU1b/tcSTB1PqwufVR4fC6POc0mkCEc0hNa0G8kkoC+pvpC4kjWY8?=
 =?us-ascii?Q?NMCTxk3//wh/1j3fJxnso//sVHdFn6oS0NmIi2MTOz7nd0I7pQZ96wiIprGt?=
 =?us-ascii?Q?SglUAg935P+QEhpYKJWijqYY3ItkuwYiaWfma2V50ugO6CE6PiZlJT/rjhIY?=
 =?us-ascii?Q?Yf1fwpki6lMEzoicy7Ku1kWDWFTX/1RwDbOdakys8JzC62qhfUCbaNw1BOvz?=
 =?us-ascii?Q?isICVeG5m9tSgm+HrV/uhNWDKY/7ll7VY783m2CijoawE9wGJfT46kpnat7V?=
 =?us-ascii?Q?qIDIFS6Gp9EcWQ/Jt4zRzueJR8emLvgKfbZF9Ks4JUZbQkwk6LxF9GTK1LvU?=
 =?us-ascii?Q?ehffT4mmnR5W5wMcFouShnNMwHpa3s6/UR63rLGmj/kiUNpuV9nmhv4ZDXK3?=
 =?us-ascii?Q?T8L6SdByK0zWhik9J/i+EHKaXyrvE18HnjqILXdz0hDbyQO5fmbKO+IgL2Me?=
 =?us-ascii?Q?hLf3rL99NYaDvamjZjXwpLRQBY4ONVPu0UYVTCXHTS3/TsEyTJXw1v4y64TU?=
 =?us-ascii?Q?e0z3+2dp+qPjvG09MOTujbfv4c5vEb/CH82ZI3EF+L9T72sG6UR2XCDCxKf1?=
 =?us-ascii?Q?jbhRrotskRczdNtVIOV5vAUWIl6+tBqj+j++BOfw7yGEjNun5z3v/7cLAB/+?=
 =?us-ascii?Q?PYO5J2gmAh2KiXvmuo2K74vI5Fy7nvsBAIQr+PYvdhO8sItrTiYzzK94O0SX?=
 =?us-ascii?Q?VRCJS5Tdw7YSd+YM2hbn2WPkAYIWV+h41EMUtkLpg2mxecix?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA6PR03MB7760.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bdbd7d00-648b-418b-dd96-08df034bac3a
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2026 08:26:05.5716
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: syiFkXo8DDcBQMQQs3ypIG3GG4lqJVMgu1TWkuFiIA3z3asoGFaCy09E+Ypno3MK/FV297pb2hwY1EuraDbOYA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA3PR03MB7620
X-purgate-ID: tlsNG-bad1c0/1787732769-BF0DD034-BC0744FB/0/0
X-purgate-type: clean
X-purgate-size: 3112

This set of patches all
Reviewed-by: Owen Smith <owen.smith@citrix.com>

________________________________________
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 25 August 2026 10:02 PM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh; Owen Smith
Subject: [PATCH] registry: Fix wrong truncation of Unicode.Length

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>

Ported from XenBus.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenvkbd/registry.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/xenvkbd/registry.c b/src/xenvkbd/registry.c
index 8f84818..e498497 100644
--- a/src/xenvkbd/registry.c
+++ b/src/xenvkbd/registry.c
@@ -1305,30 +1305,37 @@ RegistryAnsiToSz(
     NTSTATUS                        status;

     Length =3D Ansi->Length + 1;
+
+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMAT=
ION, Data) +
                                  Length * sizeof (WCHAR));

     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;

     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_SZ;
     Partial->DataLength =3D Length * sizeof (WCHAR);

-    Unicode.MaximumLength =3D (UCHAR)Partial->DataLength;
+    Unicode.MaximumLength =3D (USHORT)Partial->DataLength;
     Unicode.Buffer =3D (PWCHAR)Partial->Data;
     Unicode.Length =3D 0;

     status =3D RtlAnsiStringToUnicodeString(&Unicode, Ansi, FALSE);
     if (!NT_SUCCESS(status))
-        goto fail2;
+        goto fail3;

     return Partial;

-fail2:
+fail3:
     __RegistryFree(Partial);

+fail2:
+
 fail1:
     return NULL;
 }
@@ -1348,12 +1355,16 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index].Buffer !=3D NULL; Index++)
         Length +=3D Ansi[Index].Length + 1;

+    status =3D STATUS_BUFFER_OVERFLOW;
+    if (Length * sizeof(WCHAR) > MAXUSHORT)
+        goto fail1;
+
     Partial =3D __RegistryAllocate(FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMAT=
ION, Data) +
                                Length * sizeof (WCHAR));

     status =3D STATUS_NO_MEMORY;
     if (Partial =3D=3D NULL)
-        goto fail1;
+        goto fail2;

     Partial->TitleIndex =3D 0;
     Partial->Type =3D REG_MULTI_SZ;
@@ -1366,7 +1377,7 @@ RegistryAnsiToMultiSz(
     for (Index =3D 0; Ansi[Index].Buffer !=3D NULL; Index++) {
         status =3D RtlAnsiStringToUnicodeString(&Unicode, &Ansi[Index], FA=
LSE);
         if (!NT_SUCCESS(status))
-            goto fail2;
+            goto fail3;

         Length =3D Unicode.Length / sizeof (WCHAR);

@@ -1379,9 +1390,11 @@ RegistryAnsiToMultiSz(

     return Partial;

-fail2:
+fail3:
     __RegistryFree(Partial);

+fail2:
+
 fail1:
     return NULL;
 }
--
2.55.0.windows.3



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From win-pv-devel-bounces@lists.xenproject.org Wed Aug 26 09:22:56 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 26 Aug 2026 09:22:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399736.1635719 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz9qS-0004fq-1g; Wed, 26 Aug 2026 09:22:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399736.1635719; Wed, 26 Aug 2026 09:22:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz9qR-0004fj-Ut; Wed, 26 Aug 2026 09:22:55 +0000
Received: by outflank-mailman (input) for mailman id 1399736;
 Wed, 26 Aug 2026 09:22:54 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d612005000c4f3@swg.vates.tech>)
 id 1wz9qP-0004fd-WD
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 09:22:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wz9qP-005EOl-9I
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 11:22:53 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d612005000c4f3@swg.vates.tech>)
 id 6a8eb06a-2eae-0a2a0a5409dd-0a2a4505d8a8-6
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 11:22:53 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d612005000c4f3@swg.vates.tech>)
 id 6a8eb06c-4cb1-0a2a45050019-b9ff1c238021-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 11:22:53 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03d612005000c4f3.001 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 26 Aug 2026 09:22:50 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id D90DF82DD4
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 11:22:49 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=V6BLbC2z+uZNxtE4EsjSpW+gIk+80lrYXCpf8Xko9hU=;
 h=from:subject:date:message-id:to:mime-version:content-type:feedback-id;
 b=YbYdd65inefpRlNJd8S7Dk90SIYWVDHDLpUs1Fk2KQOHxBWUJ+b2+b1lNilyhuKMFW3cISq//
 ShK/PBcoEyOczKtHBO5rp6S+vTGMz4TXVdBOJZG0s1AB9+hI41ls50u3yaEJ4IP5GaUPDVNkV1z
 7w5laeo/diinr9i4ytj1rwnqP0yphs0Xf+SrGKqCOhvaEKOd40hP8MNogK0wAe+k0zA8+6INJNn
 NCgq4CyYDeIsyEHCFSyt46hcccyBBwsupb0k4smcCOI0PjU9TT5qulSXMux3qIb1M/8Rtc3Phk4
 kO1UXga881B4Dc4tVVLiDXBlynQkIu90F/EEHkGIkgpQ==
X-Zone-Loop: 7f9ffdfe64cc2b69c4dfaf5e687a608e345797dd03de
x-campaign-type: default
x-transaction-id: 919ed6f8-30c3-4456-898a-aa5181c36b48
x-swg-uid: 01-4f6b2e81-b360-4adc-9c27-0387d9b152f3
X-Mailer: Sweego
Message-ID:
 <1787736170.8631fc262581453bbf619ec5b2062170.1a03d612005000c4f3@vates.tech>
x-swg-bid: 1787736170.8631fc262581453bbf619ec5b2062170.1a03d612005000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 26 Aug 2026 11:22:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: win-pv-devel <win-pv-devel@lists.xenproject.org>
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
Subject: Faked requests during frontend resets causing broken ring state
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2be2.8847b0515b8a28b7.1a03d611dc5.fd347f2baba86b0c=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787736169925
X-purgate-ID: tlsNG-c201ff/1787736173-F44A42A1-937BE6C8/0/0
X-purgate-type: clean
X-purgate-size: 1942

---=Part.2be2.8847b0515b8a28b7.1a03d611dc5.fd347f2baba86b0c=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Currently, when transitioning from Enabled to Connected, XenVbd and=20
XenVif will fake pending requests without resetting the ring=2E If the=20
backend comes back later (e=2Eg=2E after a long pause, such as one caused =
by=20
an in-memory snapshot), it will continue talking to a corrupted ring=20
state=2E This leads to reading/writing of corrupt data=2E

Here's how to reproduce:
- Create and attach a VBD, add a large zip file (several GBs) to it,
   then use Sync [1] to flush the zip file to disk=2E
- Before testing, empty the standby list with RAMMap [2]=2E
- Start to test the zip file using 7-Zip or equivalent=2E
- While the test is running, immediately run
   `tap-ctl pause -p <pid> -m <minor>` to pause the backend while keeping
   the ring alive=2E
- Wait for TargetReset to be issued=2E
- Run `tap-ctl unpause =2E=2E=2E` to unpause tapdisk while reusing the sam=
e
   ring=2E
- Observe the data corruption as a ZIP data error=2E

Patches in reply=2E I've gone with a more complicated fix which involves=
=20
keeping track of each ring's poisoned state, but we can also consider=20
reverting acd08c9dc962 ("Dont close ring during FrontendReset")=2E I don't=
=20
know if this is the only case where we can transition from Enabled -=20
Connected - Enabled, however=2E We can also remove the Enabled->Connected=
=20
transition and always consider the ring tainted after a ring disable,=20
which may be cleaner=2E

[1] https://learn=2Emicrosoft=2Ecom/en-us/sysinternals/downloads/sync
[2] https://learn=2Emicrosoft=2Ecom/en-us/sysinternals/downloads/rammap


-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2be2.8847b0515b8a28b7.1a03d611dc5.fd347f2baba86b0c=---


From win-pv-devel-bounces@lists.xenproject.org Wed Aug 26 09:23:11 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 26 Aug 2026 09:23:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399737.1635722 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz9qh-0004iQ-35; Wed, 26 Aug 2026 09:23:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399737.1635722; Wed, 26 Aug 2026 09:23:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz9qh-0004iJ-0X; Wed, 26 Aug 2026 09:23:11 +0000
Received: by outflank-mailman (input) for mailman id 1399737;
 Wed, 26 Aug 2026 09:23:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d615dde000c4f3@swg.vates.tech>)
 id 1wz9qf-0004i7-93
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 09:23:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wz9qe-00Cb3L-KQ
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 11:23:08 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d615dde000c4f3@swg.vates.tech>)
 id 6a8eb06f-8faa-0a2a0a5109dd-0a2a4501dfec-48
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 11:23:08 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d615dde000c4f3@swg.vates.tech>)
 id 6a8eb07c-5984-0a2a45010019-b9ff1c239993-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 11:23:08 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03d615dde000c4f3.002 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 26 Aug 2026 09:23:06 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id AFB7C81566;
 Wed, 26 Aug 2026 11:23:05 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=R/rqy06SfdiQyVYerlQ+LkwFATGMBasiFfFAl6MsujY=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=CTd0pv2gBjcZdC5COAPClnhSi25Vq9frc4PvZFWDockK/w1WOW+NNdhDcFuJUDM2sucYmMk95
 Nhqw4NzZ074+EbFqlpBl+tvcqln9VLYp8WuSHm7h/UHFznuN2o+c0TumGKXT2n76MWxwf2Ljkd8
 ebLQTdlt6PtkdzEcqx9jXdPWyIYvgByiGzfo6bUuxhTJ2AW5wixBu04/bK9FAzkCw7WTdk4KG0w
 1N6+57+OE6Hh0cm3GdFPzjjBS1ZiAx0NLKDk+92TyPvBcSEdYeBJTL9iji+mwoUiArHaLqt2rUX
 8m+7XnqHpED4+Zlw7Rza2JNZPjOSEUbKolRRRAw9ph+Q==
X-Zone-Loop: 86eaf374e5380512645fb4173761a85e9648dffdfe61
x-campaign-type: default
x-transaction-id: 3e800cb7-a539-4ca4-bdaa-e817dd5d3bb8
x-swg-uid: 01-4244068a-dccc-43c6-abf3-7192fad5d719
X-Mailer: Sweego
Message-ID:
 <1787736186.8631fc262581453bbf619ec5b2062170.1a03d615dde000c4f3@vates.tech>
x-swg-bid: 1787736186.8631fc262581453bbf619ec5b2062170.1a03d615dde000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Owen Smith <owen.smith@citrix.com>
Subject: [PATCH] store: Detect bad response from xenstored
Date: Wed, 26 Aug 2026 11:23:02 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2be3.da394c94f294f13b.1a03d615bb9.72d0bdb5a565032=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787736185785
X-purgate-ID: tlsNG-d62444/1787736188-1E867757-0B089480/0/0
X-purgate-type: clean
X-purgate-size: 1807

---=Part.2be3.da394c94f294f13b.1a03d615bb9.72d0bdb5a565032=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Detect when Header=2Elen is larger than allowed, and fail the request=2E
A length of 0 is valid for some operations=2E
Also modify StoreVerifyHeader to fail on length > XENSTORE_PAYLOAD_MAX

Assisted-by: ClaudeCode:claude-opus-4=2E8
Signed-off-by: Owen Smith <owen=2Esmith@citrix=2Ecom>

Ported from XenBus=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 src/xencrsh/store=2Ec | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/xencrsh/store=2Ec b/src/xencrsh/store=2Ec
index 7c5e078=2E=2Ecc7cf8b 100644
--- a/src/xencrsh/store=2Ec
+++ b/src/xencrsh/store=2Ec
@@ -376,7 +376,7 @@ __StoreVerifyHeader(
         Valid =3D FALSE;
     }
=20
-    if (Header->len >=3D XENSTORE_PAYLOAD_MAX) {
+    if (Header->len > XENSTORE_PAYLOAD_MAX) {
         LogError("ILLEGAL LENGTH 0x%08x\n", Header->len);
         Valid =3D FALSE;
     }
@@ -404,6 +404,10 @@ StoreReceiveResponse(
     if (Response->Header=2Elen =3D=3D 0)
         goto done;
=20
+    status =3D STATUS_INVALID_BUFFER_SIZE;
+    if (Response->Header=2Elen > XENSTORE_PAYLOAD_MAX)
+        goto done;
+
     Response->Segment[RESPONSE_PAYLOAD_SEGMENT]=2ELength =3D Response->He=
ader=2Elen;
     Response->Segment[RESPONSE_PAYLOAD_SEGMENT]=2EData =3D AustereAllocat=
e(Response->Segment[RESPONSE_PAYLOAD_SEGMENT]=2ELength);
     ASSERT(Response->Segment[RESPONSE_PAYLOAD_SEGMENT]=2EData !=3D NULL);
--=20
2=2E55=2E0=2Ewindows=2E3



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2be3.da394c94f294f13b.1a03d615bb9.72d0bdb5a565032=---


From win-pv-devel-bounces@lists.xenproject.org Wed Aug 26 09:23:36 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 26 Aug 2026 09:23:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399740.1635727 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz9r6-0004lq-6F; Wed, 26 Aug 2026 09:23:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399740.1635727; Wed, 26 Aug 2026 09:23:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz9r6-0004lj-3P; Wed, 26 Aug 2026 09:23:36 +0000
Received: by outflank-mailman (input) for mailman id 1399740;
 Wed, 26 Aug 2026 09:23:34 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d61c14b000c4f3@swg.vates.tech>)
 id 1wz9r4-0004lV-BU
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 09:23:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wz9r3-00Cb9t-OB
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 11:23:33 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d61c14b000c4f3@swg.vates.tech>)
 id 6a8eb095-8faa-0a2a0a5109dd-0a2a4507e7b8-4
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 11:23:33 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d61c14b000c4f3@swg.vates.tech>)
 id 6a8eb095-b4ea-0a2a45070019-b9ff1c2392ef-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 11:23:33 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03d61c14b000c4f3.001 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 26 Aug 2026 09:23:31 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 2990F80D7B;
 Wed, 26 Aug 2026 11:23:31 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=nT4LuwXTsQHp+whZrkgDB4K7SwROdSMBNb2XJWgfFa8=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Mf1aqPm+77KEYXciBsJ0D2VUvUYRFtWAHQY+ISZkMd46gGwfm4SOFEL2lMwG91pd+Fwh73i2U
 e8EaioKeZ52E0N89Wp1F1JDTsiX2MQi53Nxk8pGzr6P22zQWf/fbTv4L6W3/le0L9x0N3CFcXkA
 gjg4YsItrJ8Q+hx8sR4wf0cPfV9aD0aHfC9qovPvyuwscCKb8SEinGJC/b7f2/fpiQIqvdKdhXb
 adRNmfiEZKkfy/wpRszpXrnH9dEaYYcUPfvjKYK1pUs9CTwEZfr7d8ZY4sBeQHcu80fA4bnfrAz
 U9+ok0YAK6PxNRujQGvPGZSrmED0f6MiRBowoRBhz/RQ==
X-Zone-Loop: fd6b82fd4957127e451dd63614a8527316ca22f86842
x-campaign-type: default
x-transaction-id: 8f5a1663-9bb8-439a-a355-deac5d277a57
x-swg-uid: 01-699c0ab6-73f3-44d7-9e7c-61af653c250a
X-Mailer: Sweego
Message-ID:
 <1787736211.8631fc262581453bbf619ec5b2062170.1a03d61c14b000c4f3@vates.tech>
x-swg-bid: 1787736211.8631fc262581453bbf619ec5b2062170.1a03d61c14b000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>
Subject: [PATCH] Force close the frontend if responses have been faked
Date: Wed, 26 Aug 2026 11:23:27 +0200
In-Reply-To: <1787736170.8631fc262581453bbf619ec5b2062170.1a03d612005000c4f3@vates.tech>
References: <1787736170.8631fc262581453bbf619ec5b2062170.1a03d612005000c4f3@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2be4.7c6922d60356adea.1a03d61bf1c.1f7ea35ebeb0800d=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787736211228
X-purgate-ID: tlsNG-ef75cf/1787736213-3C411AE4-A96D580D/0/0
X-purgate-type: clean
X-purgate-size: 6355

---=Part.2be4.7c6922d60356adea.1a03d61bf1c.1f7ea35ebeb0800d=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

If the ring disable process ended up faking responses, the shared ring
is no longer reusable and must be disconnected first=2E Otherwise, if the
ring is reenabled, the backend and frontend will desync=2E

Add a Poisoned flag to rings to indicate that they have been made
unusable=2E Introduce a transient Poisoned state to the frontend state
machine=2E If any ring has been poisoned, close the frontend before
reenabling it=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 src/xenvbd/frontend=2Ec | 30 +++++++++++++++++++++++++++++-
 src/xenvbd/frontend=2Eh |  3 ++-
 src/xenvbd/ring=2Ec     | 25 +++++++++++++++++++++++++
 src/xenvbd/ring=2Eh     |  5 +++++
 4 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/src/xenvbd/frontend=2Ec b/src/xenvbd/frontend=2Ec
index d8e3287=2E=2E3b078da 100644
--- a/src/xenvbd/frontend=2Ec
+++ b/src/xenvbd/frontend=2Ec
@@ -108,6 +108,7 @@ __XenvbdStateName(
     case XENVBD_CLOSED:             return "CLOSED";
     case XENVBD_PREPARED:           return "PREPARED";
     case XENVBD_CONNECTED:          return "CONNECTED";
+    case XENVBD_POISONED:           return "POISONED";
     case XENVBD_ENABLED:            return "ENABLED";
     default:                        return "UNKNOWN";
     }
@@ -1349,6 +1350,14 @@ FrontendDisable(
     RingDisable(Frontend->Ring);
     GranterDisable(Frontend->Granter);
 }
+__drv_requiresIRQL(DISPATCH_LEVEL)
+static FORCEINLINE BOOLEAN
+FrontendIsPoisoned(
+    __in  PXENVBD_FRONTEND          Frontend
+    )
+{
+    return RingIsPoisoned(Frontend->Ring);
+}
=20
 //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
 // Init/Term
@@ -1488,6 +1497,21 @@ __FrontendSetState(
             }
             break;
=20
+        case XENVBD_POISONED:
+            switch (State) {
+            case XENVBD_CLOSING:
+            case XENVBD_CLOSED:
+            case XENVBD_PREPARED:
+            case XENVBD_CONNECTED:
+                Status =3D FrontendClose(Frontend);
+                Frontend->State =3D XENVBD_CLOSING;
+                break;
+            default:
+                Failed =3D TRUE;
+                break;
+            }
+            break;
+
         case XENVBD_ENABLED:
             switch (State) {
             case XENVBD_CLOSING:
@@ -1495,7 +1519,11 @@ __FrontendSetState(
             case XENVBD_PREPARED:
             case XENVBD_CONNECTED:
                 FrontendDisable(Frontend);
-                Frontend->State =3D XENVBD_CONNECTED;
+                if (FrontendIsPoisoned(Frontend)) {
+                    Frontend->State =3D XENVBD_POISONED;
+                } else {
+                    Frontend->State =3D XENVBD_CONNECTED;
+                }
                 break;
             default:
                 Failed =3D TRUE;
diff --git a/src/xenvbd/frontend=2Eh b/src/xenvbd/frontend=2Eh
index 6c7665d=2E=2E18cc4fb 100644
--- a/src/xenvbd/frontend=2Eh
+++ b/src/xenvbd/frontend=2Eh
@@ -47,7 +47,8 @@ typedef enum _XENVBD_STATE {
     XENVBD_CLOSED,      // -> { PREPARED }
     XENVBD_PREPARED,    // -> { CLOSING, CONNECTED }
     XENVBD_CONNECTED,   // -> { ENABLED, CLOSING }
-    XENVBD_ENABLED      // -> { CLOSING }
+    XENVBD_POISONED,    // -> { CLOSING }
+    XENVBD_ENABLED      // -> { CONNECTED, POISONED }
 } XENVBD_STATE, *PXENVBD_STATE;
=20
 typedef struct _XENVBD_CAPS {
diff --git a/src/xenvbd/ring=2Ec b/src/xenvbd/ring=2Ec
index d7daaab=2E=2E0b56831 100644
--- a/src/xenvbd/ring=2Ec
+++ b/src/xenvbd/ring=2Ec
@@ -75,6 +75,7 @@ typedef struct _XENVBD_BLKIF_RING {
     BOOLEAN                         Connected;
     BOOLEAN                         Enabled;
     BOOLEAN                         Stopped;
+    BOOLEAN                         Poisoned;
     PVOID                           Lock;
 #if DBG
     PKTHREAD                        LockThread;
@@ -2172,6 +2173,7 @@ BlkifRingEnable(
     Trace("=3D=3D=3D=3D> %u\n", BlkifRing->Index);
=20
     __BlkifRingAcquireLock(BlkifRing);
+    BUG_ON(BlkifRing->Poisoned);
     ASSERT(!BlkifRing->Enabled);
     BlkifRing->Enabled =3D TRUE;
     __BlkifRingReleaseLock(BlkifRing);
@@ -2249,6 +2251,8 @@ BlkifRingDisable(
         Request =3D CONTAINING_RECORD(ListEntry, XENVBD_REQUEST, ListEntr=
y);
         BlkifRing->ResponsesProcessed++;
         __BlkifRingCompleteResponse(BlkifRing, Request, BLKIF_RSP_ERROR);
+
+        BlkifRing->Poisoned =3D TRUE;
     }
=20
     while (!IsListEmpty(&BlkifRing->PreparedQueue)) {
@@ -2315,6 +2319,7 @@ BlkifRingDisconnect(
     BlkifRing->ResponsesProcessed =3D 0;
=20
     BlkifRing->Connected =3D FALSE;
+    BlkifRing->Poisoned =3D FALSE;
=20
     Trace("<=3D=3D=3D=3D %u\n", BlkifRing->Index);
 }
@@ -2770,6 +2775,26 @@ RingDisconnect(
     XENBUS_DEBUG(Release, &Ring->DebugInterface);
 }
=20
+BOOLEAN
+RingIsPoisoned(
+    IN  PXENVBD_RING    Ring
+    )
+{
+    ULONG               NumQueues;
+    ULONG               Index;
+
+    NumQueues =3D FrontendGetNumQueues(Ring->Frontend);
+    for (Index =3D 0; Index < NumQueues; Index++) {
+        PXENVBD_BLKIF_RING  BlkifRing =3D Ring->Ring[Index];
+
+        if (BlkifRing->Poisoned) {
+            return TRUE;
+        }
+    }
+
+    return FALSE;
+}
+
 static FORCEINLINE PXENVBD_BLKIF_RING
 __RingGetBlkifRing(
     IN  PXENVBD_RING    Ring,
diff --git a/src/xenvbd/ring=2Eh b/src/xenvbd/ring=2Eh
index c459838=2E=2E5644c7c 100644
--- a/src/xenvbd/ring=2Eh
+++ b/src/xenvbd/ring=2Eh
@@ -75,6 +75,11 @@ RingDisconnect(
     IN  PXENVBD_RING    Ring
     );
=20
+extern BOOLEAN
+RingIsPoisoned(
+    IN  PXENVBD_RING    Ring
+    );
+
 extern BOOLEAN
 RingQueueRequest(
     IN  PXENVBD_RING    Ring,
--=20
2=2E55=2E0=2Ewindows=2E3



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2be4.7c6922d60356adea.1a03d61bf1c.1f7ea35ebeb0800d=---


From win-pv-devel-bounces@lists.xenproject.org Wed Aug 26 09:23:47 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 26 Aug 2026 09:23:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399741.1635730 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz9rH-0004oH-7o; Wed, 26 Aug 2026 09:23:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399741.1635730; Wed, 26 Aug 2026 09:23:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wz9rH-0004oA-5M; Wed, 26 Aug 2026 09:23:47 +0000
Received: by outflank-mailman (input) for mailman id 1399741;
 Wed, 26 Aug 2026 09:23:45 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d61e299000c4f3@swg.vates.tech>)
 id 1wz9rF-0004o3-J7
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 09:23:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wz9rE-00GeJD-Bl
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 11:23:44 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d61e299000c4f3@swg.vates.tech>)
 id 6a8eb069-8faa-0a2a0a5109dd-0a2a450c9e7a-30
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 11:23:44 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.1a03d61e299000c4f3@swg.vates.tech>)
 id 6a8eb09f-f479-0a2a450c0019-b9ff1c22841d-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 11:23:44 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 1a03d61e299000c4f3.001 for <win-pv-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 26 Aug 2026 09:23:40 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 9F18183ACD;
 Wed, 26 Aug 2026 11:23:39 +0200 (CEST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
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"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=yQdx8tzhG904WVONVSffmyAL5TwUsO7XGcypwAV9sDU=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=EuQq0E/+CwTX4vaul3xCuDrDIi7xt5F6YgenDTq5VvQ1dSMNU7ayzFfcSyg6MKlOnR3JiflK0
 nTUzWFo3mQmx85S1tauS+pVNVKI9WLjb9c0kq/jvC1q/+MI1SO/SYvock8EmX0hHejlVMbb3o85
 zeUFDDsafltQIO2ENnVsXV/y4fdkkI3xmU+txB11WWPuS+ndHaPBk54U1Cg3FH3BucOd92nkEs7
 nHFTewzWCBEQaK8QmJUglnuwDsblpqBao5giF7LPNDr4j5ErOlO59yXXO8ie7nsnoVfJv7EGbUz
 344NcNQQN6F78EuAGJRTInjTrX9w2rAvQX2RMRNmqDyw==
X-Zone-Loop: c13f608e70199387fbfb81d768314ce59449423c2b9c
x-campaign-type: default
x-transaction-id: 7efcb02f-738b-4ccf-abab-6ecbda9bd33c
x-swg-uid: 01-be2b715b-1da0-492f-b8ad-37f69602b862
X-Mailer: Sweego
Message-ID:
 <1787736220.8631fc262581453bbf619ec5b2062170.1a03d61e299000c4f3@vates.tech>
x-swg-bid: 1787736220.8631fc262581453bbf619ec5b2062170.1a03d61e299000c4f3
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>
Subject: [PATCH] Force close the frontend if responses have been faked
Date: Wed, 26 Aug 2026 11:23:36 +0200
In-Reply-To: <1787736170.8631fc262581453bbf619ec5b2062170.1a03d612005000c4f3@vates.tech>
References: <1787736170.8631fc262581453bbf619ec5b2062170.1a03d612005000c4f3@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2be5.f5c5d28395676501.1a03d61e03a.aae0774cdc5f6f0e=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1787736219707
X-purgate-ID: tlsNG-d25034/1787736224-5290EA5B-F5B7FCBB/0/0
X-purgate-type: clean
X-purgate-size: 5789

---=Part.2be5.f5c5d28395676501.1a03d61e03a.aae0774cdc5f6f0e=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

If the ring disable process ended up faking responses, the shared ring
is no longer reusable and must be disconnected first=2E Otherwise, if the
ring is reenabled, the backend and frontend will desync=2E

Add a Poisoned flag to rings to indicate that they have been made
unusable=2E Introduce a transient Poisoned state to the frontend state
machine=2E If any ring has been poisoned, close the frontend before
reenabling it=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 src/xenvif/frontend=2Ec    | 34 +++++++++++++++++++++++++++++++++-
 src/xenvif/frontend=2Eh    |  1 +
 src/xenvif/transmitter=2Ec | 24 ++++++++++++++++++++++++
 src/xenvif/transmitter=2Eh |  5 +++++
 4 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/src/xenvif/frontend=2Ec b/src/xenvif/frontend=2Ec
index 086d0df=2E=2Eb772349 100644
--- a/src/xenvif/frontend=2Ec
+++ b/src/xenvif/frontend=2Ec
@@ -129,6 +129,7 @@ FrontendStateName(
     _STATE_NAME(CLOSED);
     _STATE_NAME(PREPARED);
     _STATE_NAME(CONNECTED);
+    _STATE_NAME(POISONED);
     _STATE_NAME(ENABLED);
     default:
         break;
@@ -2687,6 +2688,15 @@ FrontendDisable(
     Trace("<=3D=3D=3D=3D\n");
 }
=20
+_IRQL_requires_(DISPATCH_LEVEL)
+static FORCEINLINE BOOLEAN
+FrontendIsPoisoned(
+    IN  PXENVIF_FRONTEND    Frontend
+    )
+{
+    return TransmitterIsPoisoned(__FrontendGetTransmitter(Frontend));
+}
+
 _IRQL_requires_max_(DISPATCH_LEVEL)
 NTSTATUS
 FrontendSetState(
@@ -2809,6 +2819,24 @@ FrontendSetState(
             }
             break;
=20
+        case FRONTEND_POISONED:
+            switch (State) {
+            case FRONTEND_CONNECTED:
+            case FRONTEND_PREPARED:
+            case FRONTEND_CLOSED:
+            case FRONTEND_UNKNOWN:
+                FrontendClose(Frontend);
+                Frontend->State =3D FRONTEND_CLOSED;
+
+                FrontendDisconnect(Frontend);
+                break;
+
+            default:
+                ASSERT(FALSE);
+                break;
+            }
+            break;
+
         case FRONTEND_ENABLED:
             switch (State) {
             case FRONTEND_CONNECTED:
@@ -2816,7 +2844,11 @@ FrontendSetState(
             case FRONTEND_CLOSED:
             case FRONTEND_UNKNOWN:
                 FrontendDisable(Frontend);
-                Frontend->State =3D FRONTEND_CONNECTED;
+                if (FrontendIsPoisoned(Frontend)) {
+                    Frontend->State =3D FRONTEND_POISONED;
+                } else {
+                    Frontend->State =3D FRONTEND_CONNECTED;
+                }
                 break;
=20
             default:
diff --git a/src/xenvif/frontend=2Eh b/src/xenvif/frontend=2Eh
index e062ed0=2E=2Ec1b7334 100644
--- a/src/xenvif/frontend=2Eh
+++ b/src/xenvif/frontend=2Eh
@@ -53,6 +53,7 @@ typedef enum _XENVIF_FRONTEND_STATE {
     FRONTEND_CLOSED,
     FRONTEND_PREPARED,
     FRONTEND_CONNECTED,
+    FRONTEND_POISONED,
     FRONTEND_ENABLED
 } XENVIF_FRONTEND_STATE, *PXENVIF_FRONTEND_STATE;
=20
diff --git a/src/xenvif/transmitter=2Ec b/src/xenvif/transmitter=2Ec
index b78a090=2E=2E8c4ee41 100644
--- a/src/xenvif/transmitter=2Ec
+++ b/src/xenvif/transmitter=2Ec
@@ -187,6 +187,7 @@ typedef struct _XENVIF_TRANSMITTER_RING {
     BOOLEAN                         Connected;
     BOOLEAN                         Enabled;
     BOOLEAN                         Stopped;
+    BOOLEAN                         Poisoned;
     PVOID                           Lock;
 #if DBG
     PKTHREAD                        LockThread;
@@ -2440,6 +2441,8 @@ __TransmitterRingFakeResponses(
         PXENVIF_TRANSMITTER Transmitter;
         PXENVIF_FRONTEND    Frontend;
=20
+        Ring->Poisoned =3D TRUE;
+
         Transmitter =3D Ring->Transmitter;
         Frontend =3D Transmitter->Frontend;
=20
@@ -3920,6 +3923,7 @@ __TransmitterRingEnable(
=20
     __TransmitterRingAcquireLock(Ring);
=20
+    BUG_ON(Ring->Poisoned);
     ASSERT(!Ring->Enabled);
     Ring->Enabled =3D TRUE;
=20
@@ -4076,6 +4080,7 @@ __TransmitterRingDisconnect(
     Ring->ResponsesProcessed =3D 0;
     Ring->RequestsPushed =3D 0;
     Ring->RequestsPosted =3D 0;
+    Ring->Poisoned =3D FALSE;
=20
     XENBUS_DEBUG(Deregister,
                  &Transmitter->DebugInterface,
@@ -4980,6 +4985,25 @@ TransmitterDisconnect(
     Trace("<=3D=3D=3D=3D\n");
 }
=20
+BOOLEAN
+TransmitterIsPoisoned(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    )
+{
+    ULONG                   NumQueues;
+    ULONG                   Index;
+
+    NumQueues =3D FrontendGetNumQueues(Transmitter->Frontend);
+    for (Index =3D 0; Index < NumQueues; Index++) {
+        PXENVIF_TRANSMITTER_RING    Ring =3D Transmitter->Ring[Index];
+
+        if (Ring->Poisoned)
+            return TRUE;
+    }
+
+    return FALSE;
+}
+
 _IRQL_requires_(PASSIVE_LEVEL)
 VOID
 TransmitterTeardown(
diff --git a/src/xenvif/transmitter=2Eh b/src/xenvif/transmitter=2Eh
index 5e789f1=2E=2E5e8defc 100644
--- a/src/xenvif/transmitter=2Eh
+++ b/src/xenvif/transmitter=2Eh
@@ -81,6 +81,11 @@ TransmitterDisconnect(
     IN  PXENVIF_TRANSMITTER Transmitter
     );
=20
+extern BOOLEAN
+TransmitterIsPoisoned(
+    IN  PXENVIF_TRANSMITTER Transmitter
+    );
+
 _IRQL_requires_(PASSIVE_LEVEL)
 extern VOID
 TransmitterTeardown(
--=20
2=2E55=2E0=2Ewindows=2E3



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.2be5.f5c5d28395676501.1a03d61e03a.aae0774cdc5f6f0e=---


From win-pv-devel-bounces@lists.xenproject.org Wed Aug 26 12:53:31 2026
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 26 Aug 2026 12:53:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399927.1635902 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wzD8E-0006er-60; Wed, 26 Aug 2026 12:53:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399927.1635902; Wed, 26 Aug 2026 12:53:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1wzD8E-0006ek-2V; Wed, 26 Aug 2026 12:53:30 +0000
Received: by outflank-mailman (input) for mailman id 1399927;
 Wed, 26 Aug 2026 12:53:29 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <owen.smith@citrix.com>) id 1wzD8D-0006ee-5T
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 12:53:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wzD8B-003raF-Q3
 for win-pv-devel@lists.xenproject.org; Wed, 26 Aug 2026 14:53:27 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a8ee1c0-8faa-0a2a0a5109dd-0a2a4507a99c-16
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 14:53:27 +0200
Received: from [40.93.195.70]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <owen.smith@citrix.com>)
 id 6a8ee1c6-b4ea-0a2a45070019-285dc346a9cc-3
 for <win-pv-devel@lists.xenproject.org>; Wed, 26 Aug 2026 14:53:27 +0200
Received: from SA6PR03MB7760.namprd03.prod.outlook.com (2603:10b6:806:43c::5)
 by CH2PR03MB5287.namprd03.prod.outlook.com (2603:10b6:610:9e::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.7; Wed, 26 Aug
 2026 12:53:22 +0000
Received: from SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::4d5b:a91f:46a3:4b38]) by SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::4d5b:a91f:46a3:4b38%3]) with mapi id 15.21.0339.010; Wed, 26 Aug 2026
 12:53:21 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=HqECsrlCojpC2au+TJ28PzclatuZNEwMycZb6n2ZHmgQsUj6yvFdHyyaTnBCRl6E9sK2CgI7OQuJj41R+4o0vfmwAOfKcL30WvyEcCopFpel87IpiIu7/GYwUMz/8AULrQagdPa2azdmsZ74ZclUfdr+xUwJ11NK+GZlfjJihntrnK4Zm60JDwW8GS9mp9W0Smvf2I9FGRXSQvQ+T736s1C4D/vBK+uh6KTTovmjGIjLxYvEQyobzmhxXqdddAkDAmeHBRRu6Ksc3GG37nZZh8+LAgtUXnH2x5Sk8Q6MdtuvfRB8R5AIP8l8nWg6g1V/SRJZG7Kp6/u0YM7/ra7HBw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yqYVco6DBDcBLZpBt3U1VWWtvd4RK2xzCyiv1HS35PQ=;
 b=ggH1GBIMVVO6tOr96UHGreAXS9IHgvc2QoU7hQ9GEW7HhMPz/lYScc+XFomhPJwZ/1VV528RCPGagbIwxU1ftVDolWhXGcWjltkp6rGgPTFnCUd+pWIRQSzanUW6fcJi/Fe77oNY+Wiq7vLeXGRB0FLDd8w5ESNTXQXm/6G01aJnMGlqjxeBg52b9h3d/zfcLH7ClWaA08RbQNDMkra3PpClH/Kraq2e+X6TUR8CnP3tcHumSQop6peh8RgXVpW/Xf6njCZmk0Bohds5BsPNu2fK/lbmPfbvS4ME6QH1eetNgR6EgPD4KGK7xzrrkp9oiUtk/QvqIpKdaQcylKSsVQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yqYVco6DBDcBLZpBt3U1VWWtvd4RK2xzCyiv1HS35PQ=;
 b=rvk4J47EarVdXm2yIFcrklCz/oX7kaiTGfqWDmVVOoKQr0fRcE16vy8JtZ5s2NHMT7FBxRU5SMeGi0+zvFIaHu8CBrAosSsmHnuvcs9vr3pJWB6WHNuTPmLOouaQd7NSpnIuqVD6bDmFhgKa/RzbpeWVgvfLn6BVg96UCSPwFZ0=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH] store: Detect bad response from xenstored
Thread-Topic: [PATCH] store: Detect bad response from xenstored
Thread-Index: AQHdNTyEQ/OVMoE0nUWuDElG2PfeRrawSS+S
Date: Wed, 26 Aug 2026 12:53:21 +0000
Message-ID:
 <SA6PR03MB77604A2C0D43AFC624786229FEAE2@SA6PR03MB7760.namprd03.prod.outlook.com>
References:
 <1787736186.8631fc262581453bbf619ec5b2062170.1a03d615dde000c4f3@vates.tech>
In-Reply-To:
 <1787736186.8631fc262581453bbf619ec5b2062170.1a03d615dde000c4f3@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA6PR03MB7760:EE_|CH2PR03MB5287:EE_
x-ms-office365-filtering-correlation-id: 2b19fcd0-39a2-4397-8c78-08df03710250
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|366016|23010399003|10067099003|56012099006|11063799006|22082099003|18002099003|38070700021;
x-microsoft-antispam-message-info:
 xfUwsY4MHX4fVF26+gFJAm6k+E60ehbZP6gCfrznFQ+N+aa9QO8JtgmVqVfMYgyTb9QlOgIkPcgADPUyaKD56P/Z1bFgMGt91CKaVtpPHPFsMNi2K8II8IFXb1EHbYaJLfwugR62B7W0RJ9F1V3Ol+wXSuF/6E5xnyfDVhTfqLhEFmDO/vSygRDHJdTx+Q79VeZ/Vlkg6QYK/VUa5zD1M3JRdcawBqtZpFRs8olm6BVPIpfzwrLO+m+RbpvOkrCZvcWNnIle3hQO9QaUUTBIAXeS/whqzvSoKaq6BRcTM33yRZ7T7TsKa+4WxcyxI6WB/jnLeIdQfFaYrgKmW7jQjRH96Jycl2kAVpb6Iz8mCcoppiFBjNtKVcUdziQd5ypZpkwLoEyRo49/DHbB/NtjuHJ3MSAYmuJG9teLNv8IxLkr98h4P11Zy/Nn8x4HpQhBQ40XnhchNDJuk2hnIYs1pN/xJT3MRciDX9gLt5T7VhbUTAKn8h2ICOVouuQcJdmeV5kaCzaQkGHlD9VWeWifNMJiyhIZALOHnfytKWgM6A3Bj2/jRSszqkx8Nx2l9yV29ZykYnwjrJhC64ar1QoI3cuzwNqiiNq1qDcnb3z5pZ3gaGtsg0wMh736aAzPNukmnly+BD0bYHUXQfIUeY8qr+fEuO7bvosyusL8OvJIdmU=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA6PR03MB7760.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(23010399003)(10067099003)(56012099006)(11063799006)(22082099003)(18002099003)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?ZwL4w8lUMWQn6MBdQLRrgdcbBQ/4fIvP+D3+rWJn0YNJaheDfHmvvbz2BpoA?=
 =?us-ascii?Q?MIOeMppaMyq3b9ViHDVmOC93SsGoYJoFlIDJYOTnXPrb/OAO3603S26T8GnX?=
 =?us-ascii?Q?6m/TflWGwQ9gVVbcxev0dhKqqdyJYLzsS71Zkw3EZI0x129+dfaa8PSQv8Fq?=
 =?us-ascii?Q?aF78FKfYwspHK8uaxHsis25e2INLOQ4UTAYjuhKL7dVQGItU5M1jMI8qWiHV?=
 =?us-ascii?Q?+3pGC+5wORqVexOLdicJUhV5tFbObW2YeBy6ocDELKRkNAwxZ9zyt9Z5GOg/?=
 =?us-ascii?Q?tt2uO5wbjNPbo/atQOh6Vs/EIrMeQjk7IALFAspg9UI6Y5gzGG9K7NrHlZnZ?=
 =?us-ascii?Q?1OJuZWuVGBXwiSu4xV4AfUemMuWktJdtVAJfPBa+8iMNGhYnZYk2RmwV9vy7?=
 =?us-ascii?Q?9CYYmrLabsEs6/b8oa+SHm9Z2E0/vOf5ziuAIFDb6OROiiTIgkQyn4F82t0Z?=
 =?us-ascii?Q?9ndfhVWOOJ6In+voo6CSV5QPNCSzlNiofaHdxhVVUm47HqrHoIBkfbQxPaAe?=
 =?us-ascii?Q?daG0dIGcNuBrTa8kKDudqNisOtlxpA+jYXBka8JUbbYdPxt/Dulevwqqyl0Z?=
 =?us-ascii?Q?u0VibeTbRXbodV/SZgea8Z+nAkpTeZctx6NX1GrRsrO6OYXwfdoujysaIxQV?=
 =?us-ascii?Q?Wp5E5vnx7irjAluhpouv1G1mzenzwsLwMTXT2w/d1UIpUQuclxzbPwLzfqFK?=
 =?us-ascii?Q?87S/HcTEr9SRUf0LcWqTqz0fnyyvSUq1Fawj6Cl0PZbHdEAI0CRNVDrNDvMv?=
 =?us-ascii?Q?oWFMQaOtc7/zup1/yHptdMvnduuOLJUpzBHll0oe7JnYSygfDfNo1IJPuQbp?=
 =?us-ascii?Q?s81xOA3tVx8i8LjxaO8GaXNIDCO4eqDz+pbImdPkxj/OuvGYZOt3hfg9T61K?=
 =?us-ascii?Q?zlFM8kuKn0qsXkUfTZy5Nsa+sO7o8ysqAHzgiX/54ECsirKH9AWkHeQcpSNr?=
 =?us-ascii?Q?nrrGHvSM9in0toVEW/b3iyDj9MzYsjVPvpLEQXRAmx7Bzke7lXFO0YOtIrt6?=
 =?us-ascii?Q?KFOpv7cvQWwGexj2KHO1rtgprZNMcqKwGDEM4nZXNHXb4FlpO1pYtYBHMMFC?=
 =?us-ascii?Q?fuj82j4iRgRT0RjHKlg5Ay98kL0kBLlq+zNdzud73l6EpGhzGvq5G+2278Im?=
 =?us-ascii?Q?cL0foGwLPJHc3JdHD03zSJz8bVpsM5xmgjAZYllZ5hyA13ztOxSt+rFBjIiW?=
 =?us-ascii?Q?kfDf0L7xhaWRtw0yBv7QUxCXbmFf3rMDGJssfY6O6NBPWMgFRc1Wal1Wpkxa?=
 =?us-ascii?Q?1hvTc+LS4ahijTsF521k4lIpYrdWKTWqLiZRnZ6PAQBoBlyo1hS4qso8FqMZ?=
 =?us-ascii?Q?VJVCWuqxwic7LC6cUArruHiyRlxeaoQSR3gvEqaYSrBEFLcSJcTm/L2SEbxz?=
 =?us-ascii?Q?2curKp3EvvwhAhJz1aMqxV+NKpUaBjuV2Mbp+zZ38iDFCdGJdetQyL6lBOj6?=
 =?us-ascii?Q?7r2ddJf0L34G8N2ATztC2fy9dHGbGi0q+smOvLp+SnKPwPc151Q9vAlf4T2m?=
 =?us-ascii?Q?DBbNxlfmqB3Y6wc4MtfZF+Izc5w0rGiCqWHg67BNy7qaNc/9dGKEnBn70sLQ?=
 =?us-ascii?Q?/KtJD18Q+2KUnC60NMOWfeYNN8JAjMcI0diou465UEZ5YHbJeHvuZxy/ZpyM?=
 =?us-ascii?Q?4KhrYaH36Wcwuf/JfqGvOzJ6fPD60uF4hD6UMUKqRgTJDdIqSsPm3Q0mA6V9?=
 =?us-ascii?Q?OJ7gT2GmPBzPCfHd7yGFjwMj+NosNh306j9H+7wuNtu4gDjjyGifZAr4aF1i?=
 =?us-ascii?Q?LQxLo1Mb2g=3D=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA6PR03MB7760.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2b19fcd0-39a2-4397-8c78-08df03710250
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2026 12:53:21.4675
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: bV2tZmLCj9uIShLDXEjkdb0pJzR2jA1TtT4oxDYy0hC5dCyq0COSeemC+kbj4iUeN4pMO1RwfpaXbVxJAGSc1g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR03MB5287
X-purgate-ID: tlsNG-ef75cf/1787748807-A68D9AE4-4DFC11E0/0/0
X-purgate-type: clean
X-purgate-size: 1815

Reviewed-by: Owen Smith <owen.smith@citrix.com>

________________________________________
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 26 August 2026 10:23 AM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh; Owen Smith
Subject: [PATCH] store: Detect bad response from xenstored

Detect when Header.len is larger than allowed, and fail the request.
A length of 0 is valid for some operations.
Also modify StoreVerifyHeader to fail on length > XENSTORE_PAYLOAD_MAX

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Owen Smith <owen.smith@citrix.com>

Ported from XenBus.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xencrsh/store.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/xencrsh/store.c b/src/xencrsh/store.c
index 7c5e078..cc7cf8b 100644
--- a/src/xencrsh/store.c
+++ b/src/xencrsh/store.c
@@ -376,7 +376,7 @@ __StoreVerifyHeader(
         Valid =3D FALSE;
     }

-    if (Header->len >=3D XENSTORE_PAYLOAD_MAX) {
+    if (Header->len > XENSTORE_PAYLOAD_MAX) {
         LogError("ILLEGAL LENGTH 0x%08x\n", Header->len);
         Valid =3D FALSE;
     }
@@ -404,6 +404,10 @@ StoreReceiveResponse(
     if (Response->Header.len =3D=3D 0)
         goto done;

+    status =3D STATUS_INVALID_BUFFER_SIZE;
+    if (Response->Header.len > XENSTORE_PAYLOAD_MAX)
+        goto done;
+
     Response->Segment[RESPONSE_PAYLOAD_SEGMENT].Length =3D Response->Heade=
r.len;
     Response->Segment[RESPONSE_PAYLOAD_SEGMENT].Data =3D AustereAllocate(R=
esponse->Segment[RESPONSE_PAYLOAD_SEGMENT].Length);
     ASSERT(Response->Segment[RESPONSE_PAYLOAD_SEGMENT].Data !=3D NULL);
--
2.55.0.windows.3



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


