From: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: [PATCH 1/3] Make cr_may_checkpoint_task() check each namespace individually
Date: Mon, 6 Apr 2009 09:05:54 -0700 [thread overview]
Message-ID: <1239033956-25898-2-git-send-email-danms@us.ibm.com> (raw)
In-Reply-To: <1239033956-25898-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org
Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
checkpoint/checkpoint.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/checkpoint/checkpoint.c b/checkpoint/checkpoint.c
index ef35754..c2f0e16 100644
--- a/checkpoint/checkpoint.c
+++ b/checkpoint/checkpoint.c
@@ -302,8 +302,19 @@ static int cr_may_checkpoint_task(struct task_struct *t, struct cr_ctx *ctx)
if (t != current && !frozen(t))
return -EBUSY;
- /* FIXME: change this for nested containers */
- if (task_nsproxy(t) != ctx->root_nsproxy)
+ if (task_nsproxy(t)->uts_ns != ctx->root_nsproxy->uts_ns)
+ return -EPERM;
+
+ if (task_nsproxy(t)->ipc_ns != ctx->root_nsproxy->ipc_ns)
+ return -EPERM;
+
+ if (task_nsproxy(t)->mnt_ns != ctx->root_nsproxy->mnt_ns)
+ return -EPERM;
+
+ if (task_nsproxy(t)->pid_ns != ctx->root_nsproxy->pid_ns)
+ return -EPERM;
+
+ if (task_nsproxy(t)->net_ns != ctx->root_nsproxy->net_ns)
return -EPERM;
return 0;
--
1.5.6.3
next prev parent reply other threads:[~2009-04-06 16:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-06 16:05 c/r: Add UTS support Dan Smith
[not found] ` <1239033956-25898-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-04-06 16:05 ` Dan Smith [this message]
2009-04-06 16:05 ` [PATCH 2/3] c/r: Add UTS support (v7) Dan Smith
2009-04-06 16:05 ` [PATCH 3/3] Stub implementation of IPC namespace c/r (v3) Dan Smith
2009-04-06 17:59 ` c/r: Add UTS support Oren Laadan
[not found] ` <49DA42F9.10604-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-06 18:01 ` Dan Smith
-- strict thread matches above, loose matches on Subject: below --
2009-03-31 20:58 Dan Smith
[not found] ` <1238533107-11796-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-03-31 20:58 ` [PATCH 1/3] Make cr_may_checkpoint_task() check each namespace individually Dan Smith
[not found] ` <1238533107-11796-2-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-04-02 17:50 ` Serge E. 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=1239033956-25898-2-git-send-email-danms@us.ibm.com \
--to=danms-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
/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