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

Andrew Vagin avagin at parallels.com
Mon Oct 15 14:07:35 EDT 2012


On Mon, Oct 15, 2012 at 08:29:27PM +0400, Pavel Emelyanov wrote:
> > +		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.
vma is an image entry and shmid is used already for file id.

Probably we can export vma_area-s instead of VmaEntry in restorer
> 
> > +			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