From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [Announce] Checkpoint-restore tool v0.1 Date: Tue, 31 Jul 2012 14:30:07 +0400 Message-ID: <20120731103007.GE2007@moon> References: <500D1116.7070301@parallels.com> <50179CF0.7050200@parallels.com> <5017A053.9000206@parallels.com> <5017AB41.60700@parallels.com> <20120731101603.GD2007@moon> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=p9TIwUefT4jzcQ61wk5YzOIgVQ04NkdoSGSm+Y9tYXI=; b=xf8Ba3PTVNkezsEMBBOwmJyyCzhiub9SrnOZSXbL9vwGPVv6zNxRp2lQJaDYyFNmuA lQKcc6u03aRV7TeJoKAk9vo6QRvGCXwGU3R6N0X45T7Q/zB/hPO8wxDE4xw+GqCWEism xtPRjCj0udO9mbRGVgkqVKT6KzCQ3jv7plF/GQCqeAxtpJI5iqwVOLAt61UY2YH6RwsI miC8Xn6cFznZDxcLq9mQeYzERmG5pwCBW9gQRJjjzbY9c/7Ma8+lYEF1BzPm22SEB77p Cq4ue06DhI05LqQpOg48ABGcdR3OZ2BRdq6EOo7oxCqkhtEhHeL+WaSXCrUoG5yJf8yY nWPg== Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: richard -rw- weinberger Cc: "users-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org" , Pavel Emelyanov , Containers , Linux Kernel Mailing List , "criu-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org" , "lwn-T1hC0tSOHrs@public.gmane.org" , cgroups mailinglist On Tue, Jul 31, 2012 at 12:21:58PM +0200, richard -rw- weinberger wrote: > On Tue, Jul 31, 2012 at 12:16 PM, Cyrill Gorcunov wrote: > > On Tue, Jul 31, 2012 at 12:08:22PM +0200, richard -rw- weinberger wrote: > >> On Tue, Jul 31, 2012 at 11:54 AM, Pavel Emelyanov wrote: > >> >> Yeah, but I fear it's not that easy. > >> >> We'd have to change crtools to work without ptrace(). > >> > > >> > Well, this is hard. Using ptrace saved us from having many special-purpose > >> > APIs for dumping various stuff (there will be an article about it). Thus I > >> > don't know which way is simpler -- stop using ptrace or teach ptrece to allow > >> > several tracers to attach to one task %) > >> > >> Allowing multiple tracers in a safe way is IMHO even more harder. > >> > >> BTW: While reading prctl_set_mm() I noticed two things. > >> 1. Why isn't the return value of find_vma() verified? > > > > prctl_set_mm > > vma = find_vma(mm, addr); > > ... > > if (!vma) { > > error = -EFAULT; > > goto out; > > } > > > > these values are used in procfs statistics only. So I don't get > > which verify you mean here. > > If I do PR_SET_MM_START_BRK the if(!vma) will never be executed because > there a break in case PR_SET_MM_START_BRK. Yes, and this is done by purpose, since we need to setup _completely_ new memory map on restore procedure. There is a minimal check for value being sane if (addr >= TASK_SIZE || addr < mmap_min_addr) return -EINVAL; and the address belongs to mm::start_data|end_data area. But sure, better to add checks that at least code/data areas do exist, otherwise the proc output will not reflect the real state of memory maps. Cyrill