[CRIU] [PATCH] vdso: When put vdso mark don't forget to make area writable

Pavel Emelyanov xemul at parallels.com
Mon May 27 04:49:56 EDT 2013


On 05/27/2013 12:41 PM, Cyrill Gorcunov wrote:
> Otherwise kernel is not happy with attempt to write rx only
> memory, causing dumpee to fail on restore.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  arch/x86/vdso-pie.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/vdso-pie.c b/arch/x86/vdso-pie.c
> index 6ec2247..778e84a 100644
> --- a/arch/x86/vdso-pie.c
> +++ b/arch/x86/vdso-pie.c
> @@ -300,6 +300,8 @@ int vdso_proxify(char *who, struct vdso_symtable *sym_rt, VmaEntry *vma, unsigne
>  	 * routine we could detect this vdso and do not dump it, since
>  	 * it's auto-generated every new session if proxy required.
>  	 */
> +	sys_mprotect((void *)vdso_rt_parked_at,  vdso_vma_size(sym_rt), PROT_WRITE);
>  	vdso_put_mark((void *)vdso_rt_parked_at, vma->start);
> +	sys_mprotect((void *)vdso_rt_parked_at,  vdso_vma_size(sym_rt), VDSO_PROT);
>  	return 0;
>  }
> 


BTW, shouldn't we put marking VDSO under "if (!we_just_remapped_existing_vdso)"?


More information about the CRIU mailing list