Re: [PATCH v3 4/7] iommu: Switch gather->end to unsigned long long

2020-12-16 Thread Yong Wu
Hi David, On Wed, 2020-12-16 at 11:03 +, David Laight wrote: > From: Yong Wu > > Sent: 16 December 2020 10:36 > > > > Currently gather->end is "unsigned long" which may be overflow in > > arch32 in the corner case: 0xfff0 + 0x10(iova + size). > > Although it doesn't affect the size(en

Re: [PATCH v3 4/7] iommu: Switch gather->end to unsigned long long

2020-12-16 Thread Yong Wu
On Wed, 2020-12-16 at 12:10 +, Robin Murphy wrote: > On 2020-12-16 10:36, Yong Wu wrote: > > Currently gather->end is "unsigned long" which may be overflow in > > arch32 in the corner case: 0xfff0 + 0x10(iova + size). > > Although it doesn't affect the size(end - start), it affects the

Re: [PATCH v3 4/7] iommu: Switch gather->end to unsigned long long

2020-12-16 Thread Robin Murphy
On 2020-12-16 10:36, Yong Wu wrote: Currently gather->end is "unsigned long" which may be overflow in arch32 in the corner case: 0xfff0 + 0x10(iova + size). Although it doesn't affect the size(end - start), it affects the checking "gather->end < end" This won't help the same situation a

RE: [PATCH v3 4/7] iommu: Switch gather->end to unsigned long long

2020-12-16 Thread David Laight
From: Yong Wu > Sent: 16 December 2020 10:36 > > Currently gather->end is "unsigned long" which may be overflow in > arch32 in the corner case: 0xfff0 + 0x10(iova + size). > Although it doesn't affect the size(end - start), it affects the checking > "gather->end < end" > > Fixes: a7d20dc1

[PATCH v3 4/7] iommu: Switch gather->end to unsigned long long

2020-12-16 Thread Yong Wu
Currently gather->end is "unsigned long" which may be overflow in arch32 in the corner case: 0xfff0 + 0x10(iova + size). Although it doesn't affect the size(end - start), it affects the checking "gather->end < end" Fixes: a7d20dc19d9e ("iommu: Introduce struct iommu_iotlb_gather for batchi