Hi Andrew,

> On 17 Oct 2022, at 20:07, Andrew Cooper <[email protected]> wrote:
> 
> On 17/10/2022 17:51, Henry Wang wrote:
>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>> index f17500ddf3..0b4e24218e 100644
>> --- a/xen/arch/arm/p2m.c
>> +++ b/xen/arch/arm/p2m.c
>> @@ -1784,6 +1800,8 @@ int p2m_init(struct domain *d)
>>         !iommu_has_feature(d, IOMMU_FEAT_COHERENT_WALK);
>> 
>>     rc = p2m_alloc_table(d);
>> +    if ( rc != 0 )
>> +        return rc;
> 
> This error path now leaks the VMID.
> 
> And to preempt the obvious change, if you simply move this lower, you'll
> introduce a path where p2m_teardown() falls over a NULL pointer.

Could you explain me the in which case we would end up with a NULL pointer ?
If the list is empty we bail out so I do not see how this could happen.

Cheers
Bertrand

> 
> ~Andrew


Reply via email to