Re: [PATCH] Xen/gnttab: adjust two uses of sizeof()

Jan Beulich <[email protected]> Thu, 30 Jul 2026 17:31:43 +0200
Newsgroups gmane.comp.emulators.xen.devel
Message-ID <[email protected]>
On 30.07.2026 17:25, Andrew Cooper wrote:
> On 30/07/2026 3:57 pm, Jan Beulich wrote:
>> The use in gnttab_map() is latently buggy, as "frames" there is
>> xen_pfn_t *, not unsigned long *.
> 
> ARM32 has 64bit xen_pfn_t's.  At least it's wrong in the safe direction.

No, that alone would make it unsafe - we'd have allocated only half the
size. What keeps the problem being latent is that the problem is on the
PV-only path.

>>  Adjust the correct use in
>> gnttab_map_frames_v2() as well, just to avoid the problematic pattern of
>> sizeof(<type>).
>>
>> Signed-off-by: Jan Beulich <[email protected]>
> 
> Reviewed-by: Andrew Cooper <[email protected]>

Thanks.

Jan