All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] debug: add a few ckpt_debugs
@ 2009-10-09 20:55 Serge E. Hallyn
       [not found] ` <20091009205552.GA5778-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Serge E. Hallyn @ 2009-10-09 20:55 UTC (permalink / raw)
  To: Oren Laadan
  Cc: Linux Containers, linux-security-module-u79uwXL29TY76Z2rM5mHXA

[
this set is available at
http://git.kernel.org/gitweb.cgi?p=linux/kernel/git/sergeh/linux-cr.git;a=shortlog;h=refs/heads/oct9.lsm5
]

These were pulled out of the lsm-related patches into which they
had been embedded.

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 checkpoint/files.c   |    3 +++
 checkpoint/process.c |   20 ++++++++++++++++----
 kernel/cred.c        |    2 ++
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/checkpoint/files.c b/checkpoint/files.c
index 27e29a0..f6de07e 100644
--- a/checkpoint/files.c
+++ b/checkpoint/files.c
@@ -159,6 +159,9 @@ int checkpoint_file_common(struct ckpt_ctx *ctx, struct file *file,
 	if (h->f_credref < 0)
 		return h->f_credref;
 
+	ckpt_debug("file %s credref %d", file->f_dentry->d_name.name,
+		h->f_credref);
+
 	/* FIX: need also file->f_owner, etc */
 
 	return 0;
diff --git a/checkpoint/process.c b/checkpoint/process.c
index c51e036..7463158 100644
--- a/checkpoint/process.c
+++ b/checkpoint/process.c
@@ -581,11 +581,15 @@ static int restore_task_creds(struct ckpt_ctx *ctx)
 
 	realcred = ckpt_obj_fetch(ctx, h->cred_ref, CKPT_OBJ_CRED);
 	if (IS_ERR(realcred)) {
+		ckpt_debug("Error %ld fetching realcred (ref %d)\n",
+			PTR_ERR(realcred), h->cred_ref);
 		ret = PTR_ERR(realcred);
 		goto out;
 	}
 	ecred = ckpt_obj_fetch(ctx, h->ecred_ref, CKPT_OBJ_CRED);
 	if (IS_ERR(ecred)) {
+		ckpt_debug("Error %ld fetching ecred (ref %d)\n",
+			PTR_ERR(ecred), h->ecred_ref);
 		ret = PTR_ERR(ecred);
 		goto out;
 	}
@@ -593,6 +597,7 @@ static int restore_task_creds(struct ckpt_ctx *ctx)
 	ctx->ecred = ecred;
 
 out:
+	ckpt_debug("Returning %d\n", ret);
 	ckpt_hdr_put(ctx, h);
 	return ret;
 }
@@ -608,14 +613,21 @@ static int restore_task_objs(struct ckpt_ctx *ctx)
 	 * referenced. See comment in checkpoint_task_objs.
 	 */
 	ret = restore_task_creds(ctx);
-	if (!ret)
-		ret = restore_task_ns(ctx);
-	if (ret < 0)
+	if (ret < 0) {
+		ckpt_debug("restore_task_creds returned %d\n", ret);
+		return ret;
+	}
+	ret = restore_task_ns(ctx);
+	if (ret < 0) {
+		ckpt_debug("restore_task_ns returned %d\n", ret);
 		return ret;
+	}
 
 	h = ckpt_read_obj_type(ctx, sizeof(*h), CKPT_HDR_TASK_OBJS);
-	if (IS_ERR(h))
+	if (IS_ERR(h)) {
+		ckpt_debug("Error fetching task obj\n");
 		return PTR_ERR(h);
+	}
 
 	ret = restore_obj_file_table(ctx, h->files_objref);
 	ckpt_debug("file_table: ret %d (%p)\n", ret, current->files);
diff --git a/kernel/cred.c b/kernel/cred.c
index 9710cae..62d28a4 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -724,6 +724,8 @@ static int do_checkpoint_cred(struct ckpt_ctx *ctx, struct cred *cred)
 	if (!h)
 		return -ENOMEM;
 
+	ckpt_debug("cred uid %d fsuid %d gid %d\n", cred->uid, cred->fsuid,
+			cred->gid);
 	h->uid = cred->uid;
 	h->suid = cred->suid;
 	h->euid = cred->euid;
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [PATCH 1/4] debug: add a few ckpt_debugs
@ 2009-10-05 21:51 Serge E. Hallyn
  0 siblings, 0 replies; 15+ messages in thread
From: Serge E. Hallyn @ 2009-10-05 21:51 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Linux Containers

These were pulled out of the lsm-related patches into which they
had been embedded.

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 checkpoint/files.c   |    3 +++
 checkpoint/process.c |   20 ++++++++++++++++----
 kernel/cred.c        |    2 ++
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/checkpoint/files.c b/checkpoint/files.c
index 27e29a0..f6de07e 100644
--- a/checkpoint/files.c
+++ b/checkpoint/files.c
@@ -159,6 +159,9 @@ int checkpoint_file_common(struct ckpt_ctx *ctx, struct file *file,
 	if (h->f_credref < 0)
 		return h->f_credref;
 
+	ckpt_debug("file %s credref %d", file->f_dentry->d_name.name,
+		h->f_credref);
+
 	/* FIX: need also file->f_owner, etc */
 
 	return 0;
diff --git a/checkpoint/process.c b/checkpoint/process.c
index 424f688..8a7459d 100644
--- a/checkpoint/process.c
+++ b/checkpoint/process.c
@@ -581,11 +581,15 @@ static int restore_task_creds(struct ckpt_ctx *ctx)
 
 	realcred = ckpt_obj_fetch(ctx, h->cred_ref, CKPT_OBJ_CRED);
 	if (IS_ERR(realcred)) {
+		ckpt_debug("Error %ld fetching realcred (ref %d)\n",
+			PTR_ERR(realcred), h->cred_ref);
 		ret = PTR_ERR(realcred);
 		goto out;
 	}
 	ecred = ckpt_obj_fetch(ctx, h->ecred_ref, CKPT_OBJ_CRED);
 	if (IS_ERR(ecred)) {
+		ckpt_debug("Error %ld fetching ecred (ref %d)\n",
+			PTR_ERR(ecred), h->ecred_ref);
 		ret = PTR_ERR(ecred);
 		goto out;
 	}
@@ -593,6 +597,7 @@ static int restore_task_creds(struct ckpt_ctx *ctx)
 	ctx->ecred = ecred;
 
 out:
+	ckpt_debug("Returning %d\n", ret);
 	ckpt_hdr_put(ctx, h);
 	return ret;
 }
@@ -608,14 +613,21 @@ static int restore_task_objs(struct ckpt_ctx *ctx)
 	 * referenced. See comment in checkpoint_task_objs.
 	 */
 	ret = restore_task_creds(ctx);
-	if (!ret)
-		ret = restore_task_ns(ctx);
-	if (ret < 0)
+	if (ret < 0) {
+		ckpt_debug("restore_task_creds returned %d\n", ret);
+		return ret;
+	}
+	ret = restore_task_ns(ctx);
+	if (ret < 0) {
+		ckpt_debug("restore_task_ns returned %d\n", ret);
 		return ret;
+	}
 
 	h = ckpt_read_obj_type(ctx, sizeof(*h), CKPT_HDR_TASK_OBJS);
-	if (IS_ERR(h))
+	if (IS_ERR(h)) {
+		ckpt_debug("Error fetching task obj\n");
 		return PTR_ERR(h);
+	}
 
 	ret = restore_obj_file_table(ctx, h->files_objref);
 	ckpt_debug("file_table: ret %d (%p)\n", ret, current->files);
diff --git a/kernel/cred.c b/kernel/cred.c
index 9710cae..62d28a4 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -724,6 +724,8 @@ static int do_checkpoint_cred(struct ckpt_ctx *ctx, struct cred *cred)
 	if (!h)
 		return -ENOMEM;
 
+	ckpt_debug("cred uid %d fsuid %d gid %d\n", cred->uid, cred->fsuid,
+			cred->gid);
 	h->uid = cred->uid;
 	h->suid = cred->suid;
 	h->euid = cred->euid;
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-10-16 17:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-09 20:55 [PATCH 1/4] debug: add a few ckpt_debugs Serge E. Hallyn
     [not found] ` <20091009205552.GA5778-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-10-09 20:56   ` [PATCH 2/4] cr: add generic LSM c/r support (v5) Serge E. Hallyn
     [not found]     ` <20091009205626.GA5823-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-10-15 14:57       ` Oren Laadan
2009-10-15 17:06         ` Serge E. Hallyn
2009-10-16 17:03           ` Oren Laadan
2009-10-16 17:41             ` Serge E. Hallyn
2009-10-09 20:56   ` [PATCH 3/4] cr: add smack support to lsm c/r (v4) Serge E. Hallyn
2009-10-09 20:57   ` [PATCH 4/4] cr: add selinux support (v6) Serge E. Hallyn
2009-10-09 20:57     ` Serge E. Hallyn
     [not found]     ` <20091009205731.GC5823-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-10-09 21:15       ` Daniel J Walsh
2009-10-09 21:15         ` Daniel J Walsh
     [not found]         ` <4ACFA7F1.6060209-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-10-09 22:31           ` Serge E. Hallyn
2009-10-09 22:31             ` Serge E. Hallyn
2009-10-14 22:41   ` [PATCH 1/4] debug: add a few ckpt_debugs Oren Laadan
  -- strict thread matches above, loose matches on Subject: below --
2009-10-05 21:51 Serge E. Hallyn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.