[CRIU] [PATCH] kerndat: set uffd features to 0 before querying kernel

Pavel Emelyanov xemul at virtuozzo.com
Mon Aug 21 15:00:43 MSK 2017


On 08/21/2017 06:53 AM, Mike Rapoport wrote:
> When there is a stale kdat cache file it's contents is read into the memory

This cannot (shouldn't) happen. If the cache file is from different criu version
it's detected and file is ignored.

> and we end up requesting random userfaultfd features. Explicitly set the
> kdat.uffd_features to zero before querying the kernel resolves the issue.
> 
> Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
> ---
>  criu/kerndat.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/criu/kerndat.c b/criu/kerndat.c
> index 31eaddb..0c8588a 100644
> --- a/criu/kerndat.c
> +++ b/criu/kerndat.c
> @@ -874,6 +874,7 @@ int kerndat_uffd(void)
>  {
>  	int uffd;
>  
> +	kdat.uffd_features = 0;
>  	uffd = uffd_open(0, &kdat.uffd_features);
>  
>  	/*
> 



More information about the CRIU mailing list