[CRIU] [PATCH] lazy-pages: fix off-by-one in remap_lazy_iovs

Andrei Vagin avagin at virtuozzo.com
Fri Jul 7 19:31:25 MSK 2017


Applied, thanks
On Thu, Jul 06, 2017 at 10:19:23AM +0300, Mike Rapoport wrote:
> When the remap 'from' parameter matches an IOV end we try to split that IOV
> exactly at its end and effectively create an IOV with zero length.
> With the off-by-one fix we will skip the IOV in such case as expected.
> 
> Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
> ---
>  criu/uffd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/uffd.c b/criu/uffd.c
> index d631f4b..703dc43 100644
> --- a/criu/uffd.c
> +++ b/criu/uffd.c
> @@ -481,7 +481,7 @@ static int remap_lazy_iovs(struct lazy_pages_info *lpi, unsigned long from,
>  	list_for_each_entry_safe(iov, n, &lpi->iovs, l) {
>  		unsigned long iov_end = iov->base + iov->len;
>  
> -		if (from > iov_end)
> +		if (from >= iov_end)
>  			continue;
>  
>  		if (len <= 0 || from + len < iov->base)
> -- 
> 2.7.4
> 


More information about the CRIU mailing list