[CRIU] [PATCH 4/4] arch: x86 -- Add proxification of vDSO calls

Pavel Emelyanov xemul at parallels.com
Wed Apr 17 09:41:26 EDT 2013


On 04/17/2013 05:37 PM, Cyrill Gorcunov wrote:
> On Wed, Apr 17, 2013 at 05:32:30PM +0400, Pavel Emelyanov wrote:
>>> +	if (vdso_proxy.proxify) {
>>> +		if (vdso_proxy.sym_from) {
>>> +			struct vma_area *last;
>>> +			struct vma_area *vma;
>>> +
>>> +			ret = -1;
>>> +			vma = alloc_vma_area();
>>> +			if (!vma)
>>> +				goto out;
>>> +
>>> +			last = list_entry(rst_vmas.h.prev, struct vma_area, list);
>>> +			rst_vmas.nr++;
>>> +			list_add_tail(&vma->list, &rst_vmas.h);
>>
>>> +                       vma->vma.start  = last->vma.end;
>>> +                       vma->vma.end    = vma->vma.start + symtable_vma_size(&vdso_proxy.sym_rt);
>>> +                       vma->vma.prot   = PROT_READ | PROT_EXEC;
>>> +                       vma->vma.flags  = MAP_PRIVATE | MAP_ANONYMOUS;
>>> +                       vma->vma.status = VMA_AREA_REGULAR | VMA_AREA_VDSO | VMA_ANON_PRIVATE;
>>
>> Who will then make sure that real VDSO would be at that place?
> 
> Wait, I'm confused now. At moment the new VDSO with kernel supplied content
> is placed after the last VMA found in image

By whom?

> (which is a bit incorrect as
> said in comment and need to be fixed, but work for now).
> 
> So we do
> 
>  - read all vmas in image
>  - append new vdso
>  - patch old vdso to redirect calls to new vdso
> 
> so I somehow don't understand what you mean by "who will make sure".
> .
> 




More information about the CRIU mailing list