Re: [PATCH for-4.19] avoid UB in guest handle arithmetic

2024-06-19 Thread Oleksii K.
On Tue, 2024-06-18 at 14:24 +0100, Andrew Cooper wrote: > On 19/03/2024 1:26 pm, Jan Beulich wrote: > > At least XENMEM_memory_exchange can have huge values passed in the > > nr_extents and nr_exchanged fields. Adding such values to pointers > > can > > overflow, resulting in UB. Cast respective po

Re: [PATCH for-4.19] avoid UB in guest handle arithmetic

2024-06-18 Thread Andrew Cooper
On 19/03/2024 1:26 pm, Jan Beulich wrote: > At least XENMEM_memory_exchange can have huge values passed in the > nr_extents and nr_exchanged fields. Adding such values to pointers can > overflow, resulting in UB. Cast respective pointers to "unsigned long" > while at the same time making the necess