[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20070326175055.GA11465@sergelap.austin.ibm.com>
Date: Mon, 26 Mar 2007 12:50:55 -0500
From: "Serge E. Hallyn" <serue@...ibm.com>
To: lkml <linux-kernel@...r.kernel.org>
Cc: dev@...nvz.org, "Eric W. Biederman" <ebiederm@...ssion.com>,
Badari Pulavarty <badari@...ibm.com>,
Andrew Morton <akpm@...l.org>
Subject: [PATCH] ipcns: fix !CONFIG_IPC_NS behavior
fyi, dummy copy_ipcs() needed to move bc we need CLONE_NEWIPC
definition, but #including sched.h breaks...
Andrew, I'll send a separate version for mm since return type
changed as with utsname.
thanks,
-serge
From: "Serge E. Hallyn" <serue@...ibm.com>
Subject: [PATCH] ipcns: fix !CONFIG_IPC_NS behavior
When CONFIG_IPC_NS=n, clone(CLONE_NEWIPC) claims success, but did not actually
clone a new IPC namespace.
Fix this to return -EINVAL so the caller knows his request was denied.
Signed-off-by: Serge E. Hallyn <serue@...ibm.com>
---
include/linux/ipc.h | 7 +------
ipc/util.c | 7 +++++++
2 files changed, 8 insertions(+), 6 deletions(-)
9c4d6f67b6bf1a0e509ae2e52ffb721dc9bb2fe1
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 636094c..5c05c88 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -96,15 +96,10 @@ extern struct ipc_namespace init_ipc_ns;
#define INIT_IPC_NS(ns)
#endif
+extern int copy_ipcs(unsigned long flags, struct task_struct *tsk);
#ifdef CONFIG_IPC_NS
extern void free_ipc_ns(struct kref *kref);
-extern int copy_ipcs(unsigned long flags, struct task_struct *tsk);
extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns);
-#else
-static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk)
-{
- return 0;
-}
#endif
static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
diff --git a/ipc/util.c b/ipc/util.c
index 08a6479..0b65238 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -144,6 +144,13 @@ void free_ipc_ns(struct kref *kref)
shm_exit_ns(ns);
kfree(ns);
}
+#else
+int copy_ipcs(unsigned long flags, struct task_struct *tsk)
+{
+ if (flags & CLONE_NEWIPC)
+ return -EINVAL;
+ return 0;
+}
#endif
/**
--
1.1.6
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists