[CRIU] Re: [PATCH cr 06/11] restore: mark all vma-s, which should not be unmapped in restorer

Pavel Emelyanov xemul at parallels.com
Mon Oct 15 12:29:27 EDT 2012


> +		pr_debug("Mark VMA 0x%016lx-0x%016lx inside 0x%016lx-0x%016lx\n",
> +				c->vma.shmid, c->vma.shmid + vma_area_len(c),
> +				vma->vma.start, vma->vma.end);
> +
> +		/* A first part isn't a target VMA */
> +		if (c->vma.shmid > vma->vma.start) {

Thus you use shmid as a target start address. This obfuscation is not good.

> +			BUG_ON(c->vma.flags & MAP_GROWSDOWN);
> +			new = alloc_vma_area();
> +			if (new == NULL)
> +				return -1;
> +			memcpy(new, vma, sizeof(*vma));
> +
> +			vma->vma.start = c->vma.shmid;


More information about the CRIU mailing list