[CRIU] [PATCH 08/10] proc_parse: Don't try to open special mappings like heap, vsyscall and such

Pavel Emelyanov xemul at parallels.com
Mon Sep 28 12:15:45 PDT 2015


On 09/28/2015 10:01 PM, Cyrill Gorcunov wrote:
> For special mappings such as heap, vsyscall, vdso and such
> the kernel provides names rounded by brackets so exit
> from vma_get_mapfile if we meet one and allow the caller
> to handle it.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  proc_parse.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/proc_parse.c b/proc_parse.c
> index 302aa2fcb04c..430df79a9318 100644
> --- a/proc_parse.c
> +++ b/proc_parse.c
> @@ -273,6 +273,14 @@ static int vma_get_mapfile(char *fname, struct vma_area *vma, DIR *mfd,
>  				}
>  
>  				return 0;
> +			} else if (fname[0] == '[') {

I'd say it should be if (fname[0] != '/')

> +				/*
> +				 * This should be some kind of
> +				 * special mapping like [heap], [vdso]
> +				 * and such, the caller should take care
> +				 * of the @fname and vma status.
> +				 */
> +				return 0;
>  			}
>  
>  			vfi_dev = makedev(vfi->dev_maj, vfi->dev_min);
> 



More information about the CRIU mailing list