[CRIU] [PATCH 6/5] vdso: x86 -- Make sure the mark version matches

Pavel Emelyanov xemul at parallels.com
Tue Jun 17 05:16:50 PDT 2014


On 06/17/2014 11:06 AM, Cyrill Gorcunov wrote:
> On Tue, Jun 17, 2014 at 10:48:10AM +0400, Pavel Emelyanov wrote:
>>>> If the signature is v2 one, then version _must_ be 2 here, otherwise
>>>> we should abort the dump. Objections?
>>>
>>> I think so. Mind if I prepare patch on top of the series? The check
>>> better should be done on a caller side thus patch will not be oneliner.
>>> .
>>>
>>
>> OK
> 
> Attached.
> 

> @@ -331,6 +331,14 @@ static int parasite_check_vdso_mark(struct parasite_vdso_vma_entry *args)
>  	struct vdso_mark *m = (void *)args->start;
>  
>  	if (is_vdso_mark(m)) {
> +		/*
> +		 * Make sure we don't meet some corrupted entry
> +		 * where signature matches but verions is not!
> +		 */
> +		if (m->version != VDSO_MARK_CUR_VERSION) {

What if m->signature == <the-old-one>? Will we check the garbage
for being VDSO_MARK_CUR_VERSION?

> +			pr_err("vdso: Mark version mismatch!\n");
> +			return -EINVAL;
> +		}
>  		args->is_marked = 1;
>  		args->proxy_vdso_addr = m->proxy_vdso_addr;
>  		args->proxy_vvar_addr = m->proxy_vvar_addr;




More information about the CRIU mailing list