public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: richard -rw- weinberger <richard.weinberger@gmail.com>
Cc: Pavel Emelyanov <xemul@parallels.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"lwn@lwn.net" <lwn@lwn.net>, "criu@openvz.org" <criu@openvz.org>,
	"users@openvz.org" <users@openvz.org>,
	Containers <containers@lists.linux-foundation.org>,
	cgroups mailinglist <cgroups@vger.kernel.org>
Subject: Re: [Announce] Checkpoint-restore tool v0.1
Date: Tue, 31 Jul 2012 14:30:07 +0400	[thread overview]
Message-ID: <20120731103007.GE2007@moon> (raw)
In-Reply-To: <CAFLxGvxgq9HJJvRgz=z48D7V_j=dTv4jSCLqEZcE=oCBAXnSug@mail.gmail.com>

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 <gorcunov@openvz.org> 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 <xemul@parallels.com> 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

  reply	other threads:[~2012-07-31 10:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23  8:22 [Announce] Checkpoint-restore tool v0.1 Pavel Emelyanov
2012-07-23  8:53 ` Pavel Emelyanov
2012-07-23 13:14   ` Serge Hallyn
2012-07-30 10:42   ` richard -rw- weinberger
2012-07-31  8:53     ` Pavel Emelyanov
2012-07-31  8:57       ` richard -rw- weinberger
2012-07-31  9:00         ` Cyrill Gorcunov
2012-07-31  9:07         ` Pavel Emelyanov
2012-07-31  9:29           ` richard -rw- weinberger
2012-07-31  9:54             ` Pavel Emelyanov
2012-07-31 10:08               ` richard -rw- weinberger
2012-07-31 10:16                 ` Cyrill Gorcunov
2012-07-31 10:21                   ` richard -rw- weinberger
2012-07-31 10:30                     ` Cyrill Gorcunov [this message]
2012-09-20 10:16 ` [Announce] Checkpoint-restore tool v0.2 Pavel Emelyanov
2012-09-20 13:05   ` Serge Hallyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120731103007.GE2007@moon \
    --to=gorcunov@openvz.org \
    --cc=cgroups@vger.kernel.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=criu@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lwn@lwn.net \
    --cc=richard.weinberger@gmail.com \
    --cc=users@openvz.org \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox