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

Pavel Emelyanov xemul at parallels.com
Tue Oct 16 11:36:24 EDT 2012


On 10/15/2012 10:07 PM, Andrey Vagin wrote:
> 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

For me it will be OK if you just use some #define or static inline helper
titled e.g. vma_premmaped_start(vma) that will look like "return vma->shimd".

>>
>>> +			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