[CRIU] Re: [PATCH cr 3/3] mount: add suport of empty binfmt_misc

Pavel Emelyanov xemul at parallels.com
Tue Aug 7 11:36:16 EDT 2012


On 08/07/2012 06:51 PM, Andrey Vagin wrote:
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  mount.c                             |   41 +++++++++++++++++++++++++++++++++++
>  test/zdtm/live/static/mountpoints.c |    5 ++++
>  2 files changed, 46 insertions(+), 0 deletions(-)
> 

> +static int binfmt_misc_dump(struct mount_info *pm)
> +{
> +	int ret = -1;
> +	struct dirent *de;
> +	DIR *fdir = NULL;
> +	int fd;
> +	char path[PATH_MAX + 1];
> +
> +	snprintf(path, sizeof(path), ".%s", pm->mountpoint);
> +	fd = openat(mntns_root, path, O_RDONLY);
> +	if (fd < 0) {
> +		pr_perror("Can't open %s", pm->mountpoint);
> +		return -1;
> +	}

You should check that you've opened the filesystem you supposed
to, because the pm->mountpoint can be overmounted.


More information about the CRIU mailing list