From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: [PATCH 5/5] Deny external checkpoint unless task is frozen Date: Thu, 12 Mar 2009 12:37:07 -0500 Message-ID: <20090312173707.GC17253@us.ibm.com> References: <20090312042416.GC7733@us.ibm.com> <20090312042614.GE8703@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20090312042614.GE8703-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> 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: Sukadev Bhattiprolu Cc: Containers , "David C. Hansen" List-Id: containers.vger.kernel.org Quoting Sukadev Bhattiprolu (sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org): > > From: Sukadev Bhattiprolu > Subject: [PATCH 5/5] Deny external checkpoint unless task is frozen > > Remove a 'FIXME' and ensure that the tasks we are checkpointing are > frozen unless its a self-checkpoint. > > Signed-off-by: Sukadev Bhattiprolu I remain not-a-fan of self-checkpoint, and think it needlessly complicates locking, but it isn't for this patch to change that :) Acked-by: Serge Hallyn > --- > checkpoint/checkpoint.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/checkpoint/checkpoint.c b/checkpoint/checkpoint.c > index 9189abb..cfa6b4f 100644 > --- a/checkpoint/checkpoint.c > +++ b/checkpoint/checkpoint.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -280,7 +281,9 @@ static int cr_may_checkpoint_task(struct task_struct *t, struct cr_ctx *ctx) > if (!ptrace_may_access(t, PTRACE_MODE_READ)) > return -EPERM; > > - /* FIXME: verify that the task is frozen (unless self) */ > + /* verify that the task is frozen (unless self) */ > + if (t != current && !frozen(t)) > + return -EBUSY; > > /* FIXME: change this for nested containers */ > if (task_nsproxy(t) != ctx->root_nsproxy) > -- > 1.5.2.5 > > _______________________________________________ > Containers mailing list > Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > https://lists.linux-foundation.org/mailman/listinfo/containers