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

Re: [PATCH 5/5] xeniface: Bound NumberPermissions before checking the input length


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Mounah Honore Cesaire <cesaire.mounah@xxxxxxxxxx>
  • Date: Thu, 22 Oct 2026 14:00:08 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Delivery-date: Thu, 22 Oct 2026 12:00:15 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 10/20/26 2:23 PM, Tu Dinh wrote:
> On 20/10/2026 13:55, Césaire Mounah wrote:
>> IoctlStoreSetPermissions() compares InLen with
>> FIELD_OFFSET(XENIFACE_STORE_SET_PERMISSIONS_IN, Permissions[N]), whose
>> 64-bit result is truncated to ULONG. The count was only capped to 255
>> later, in __ConvertPermissions(), so the length check alone could be
>> satisfied by a huge count.
>>
>> Check the cap first, with the same STATUS_INVALID_PARAMETER as before.
>> The check in __ConvertPermissions() is kept.
>>
>> Assisted-by: Claude:Opus-5.5
>> Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
>> ---
>>    src/xeniface/ioctl_store.c | 5 +++++
>>    1 file changed, 5 insertions(+)
>>
>> diff --git a/src/xeniface/ioctl_store.c b/src/xeniface/ioctl_store.c
>> index 97bef75..cb9f2ff 100644
>> --- a/src/xeniface/ioctl_store.c
>> +++ b/src/xeniface/ioctl_store.c
>> @@ -417,6 +417,11 @@ IoctlStoreSetPermissions(
>>            goto fail1;
>>        }
>>    
>> +    status = STATUS_INVALID_PARAMETER;
>> +    if (In->NumberPermissions > 255)
>> +        goto fail2;
>> +
> I think the check in __ConvertPermissions can then be removed.
Oh! I didn't get this comment right. Thought it was the check after 
__ConvertPermissions. Sorry.
>
>> +    status = STATUS_INVALID_BUFFER_SIZE;
>>        if (InLen != (ULONG)FIELD_OFFSET(XENIFACE_STORE_SET_PERMISSIONS_IN, 
>> Permissions[In->NumberPermissions]))
>>            goto fail2;
>>    
>
>


--
Césaire Mounah | Vates Windows Guest Tools Engineer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.