[PATCH 5.17 195/298] iov_iter: Fix iter_xarray_get_pages{,_alloc}()

2022-06-13 Thread Greg Kroah-Hartman
From: David Howells [ Upstream commit 6c77676645ad42993e0a8bdb8dafa517851a352a ] The maths at the end of iter_xarray_get_pages() to calculate the actual size doesn't work under some circumstances, such as when it's been asked to extract a partial single page. Various terms of the equation

[PATCH 5.18 222/339] iov_iter: Fix iter_xarray_get_pages{,_alloc}()

2022-06-13 Thread Greg Kroah-Hartman
From: David Howells [ Upstream commit 6c77676645ad42993e0a8bdb8dafa517851a352a ] The maths at the end of iter_xarray_get_pages() to calculate the actual size doesn't work under some circumstances, such as when it's been asked to extract a partial single page. Various terms of the equation

[PATCH 5.15 164/247] iov_iter: Fix iter_xarray_get_pages{,_alloc}()

2022-06-13 Thread Greg Kroah-Hartman
From: David Howells [ Upstream commit 6c77676645ad42993e0a8bdb8dafa517851a352a ] The maths at the end of iter_xarray_get_pages() to calculate the actual size doesn't work under some circumstances, such as when it's been asked to extract a partial single page. Various terms of the equation

Re: mainline build failure due to 6c77676645ad ("iov_iter: Fix iter_xarray_get_pages{,_alloc}()")

2022-06-13 Thread David Howells
Al Viro wrote: > The reason we can't overflow on multiplication there, BTW, is that we have > nr <= count, and count has come from weirdly open-coded > DIV_ROUND_UP(size + offset, PAGE_SIZE) > IMO we'd better make it explicit, so how about the following: > > Signed-off-by: Al Viro It