Re: [PATCH] iommu/dma: Handle SG length overflow better

2019-08-09 Thread Joerg Roedel
On Tue, Aug 06, 2019 at 06:11:51PM -0700, Nicolin Chen wrote: > Well..it was triggered in our downstream test that's supposed to > cover large size (> 4G) corner case, so I don't feel it's "easy" > but our test case was running with 4.14 kernel so I also feel it > might be a good idea to Cc stable

Re: [PATCH] iommu/dma: Handle SG length overflow better

2019-08-06 Thread Nicolin Chen
Hi Robin, On Tue, Aug 06, 2019 at 04:49:01PM +0100, Robin Murphy wrote: > Hi Joerg, > > On 06/08/2019 16:25, Joerg Roedel wrote: > > Hi Robin, > > > > On Mon, Jul 29, 2019 at 05:46:00PM +0100, Robin Murphy wrote: > > > Since scatterlist dimensions are all unsigned ints, in the relatively > > > r

Re: [PATCH] iommu/dma: Handle SG length overflow better

2019-08-06 Thread Robin Murphy
Hi Joerg, On 06/08/2019 16:25, Joerg Roedel wrote: Hi Robin, On Mon, Jul 29, 2019 at 05:46:00PM +0100, Robin Murphy wrote: Since scatterlist dimensions are all unsigned ints, in the relatively rare cases where a device's max_segment_size is set to UINT_MAX, then the "cur_len + s_length <= max_

Re: [PATCH] iommu/dma: Handle SG length overflow better

2019-08-06 Thread Joerg Roedel
Hi Robin, On Mon, Jul 29, 2019 at 05:46:00PM +0100, Robin Murphy wrote: > Since scatterlist dimensions are all unsigned ints, in the relatively > rare cases where a device's max_segment_size is set to UINT_MAX, then > the "cur_len + s_length <= max_len" check in __finalise_sg() will always > retur

[PATCH] iommu/dma: Handle SG length overflow better

2019-07-29 Thread Robin Murphy
Since scatterlist dimensions are all unsigned ints, in the relatively rare cases where a device's max_segment_size is set to UINT_MAX, then the "cur_len + s_length <= max_len" check in __finalise_sg() will always return true. As a result, the corner case of such a device mapping an excessively larg