]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
namespace: ensure clone_flags are always stored in an unsigned long
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 16 Jul 2007 06:41:15 +0000 (23:41 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 16 Jul 2007 16:05:48 +0000 (09:05 -0700)
While working on unshare support for the network namespace I noticed we
were putting clone flags in an int.  Which is weird because the syscall
uses unsigned long and we at least need an unsigned to properly hold all of
the unshare flags.

So to make the code consistent, this patch updates the code to use
unsigned long instead of int for the clone flags in those places
where we get it wrong today.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namespace.c
include/linux/mnt_namespace.h
include/linux/nsproxy.h
include/linux/pid_namespace.h
include/linux/utsname.h
kernel/nsproxy.c
kernel/pid.c
kernel/utsname.c

index 5585623f62522f33daffbae685958339c30e16ac..9211da4fef5304f9957f6b77185a53af68024a5b 100644 (file)
@@ -1509,7 +1509,7 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns,
        return new_ns;
 }
 
-struct mnt_namespace *copy_mnt_ns(int flags, struct mnt_namespace *ns,
+struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
                struct fs_struct *new_fs)
 {
        struct mnt_namespace *new_ns;
index 1fa4d9813b318043d8f291b231ad15431818b5db..8eed44f8ca732877dc1bbf5d4c15c7fcc1f1a568 100644 (file)
@@ -14,7 +14,7 @@ struct mnt_namespace {
        int event;
 };
 
-extern struct mnt_namespace *copy_mnt_ns(int, struct mnt_namespace *,
+extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
                struct fs_struct *);
 extern void __put_mnt_ns(struct mnt_namespace *ns);
 
index 6d179a397bfb8246c24f098ae90df05a864cee0a..ce06188b7a56796cb63736a7d03f62f7c623b10c 100644 (file)
@@ -32,7 +32,7 @@ struct nsproxy {
 };
 extern struct nsproxy init_nsproxy;
 
-int copy_namespaces(int flags, struct task_struct *tsk);
+int copy_namespaces(unsigned long flags, struct task_struct *tsk);
 void get_task_namespaces(struct task_struct *tsk);
 void free_nsproxy(struct nsproxy *ns);
 int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
index 169c6c24209b471e63a61c48ef4d16cd9ad95717..b9a17e08ff0fa6cd24202defde59f46f31da351e 100644 (file)
@@ -29,7 +29,7 @@ static inline void get_pid_ns(struct pid_namespace *ns)
        kref_get(&ns->kref);
 }
 
-extern struct pid_namespace *copy_pid_ns(int flags, struct pid_namespace *ns);
+extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns);
 extern void free_pid_ns(struct kref *kref);
 
 static inline void put_pid_ns(struct pid_namespace *ns)
index 51ad167611e4464b40df1f704ed735fa29a8dd52..923db99175f2144a8df2ad0c8e3e2e5aaff6ebcc 100644 (file)
@@ -48,7 +48,8 @@ static inline void get_uts_ns(struct uts_namespace *ns)
        kref_get(&ns->kref);
 }
 
-extern struct uts_namespace *copy_utsname(int flags, struct uts_namespace *ns);
+extern struct uts_namespace *copy_utsname(unsigned long flags,
+                                       struct uts_namespace *ns);
 extern void free_uts_ns(struct kref *kref);
 
 static inline void put_uts_ns(struct uts_namespace *ns)
index 4b7fcc8f9a48f9f329c9a1de80c53c5b17ff87cc..10f0bbba382bed8c37d498cd55cf5871eb9b8bd4 100644 (file)
@@ -58,8 +58,8 @@ static inline struct nsproxy *clone_nsproxy(struct nsproxy *orig)
  * Return the newly created nsproxy.  Do not attach this to the task,
  * leave it to the caller to do proper locking and attach it to task.
  */
-static struct nsproxy *create_new_namespaces(int flags, struct task_struct *tsk,
-                       struct fs_struct *new_fs)
+static struct nsproxy *create_new_namespaces(unsigned long flags,
+                       struct task_struct *tsk, struct fs_struct *new_fs)
 {
        struct nsproxy *new_nsp;
        int err;
@@ -121,7 +121,7 @@ out_ns:
  * called from clone.  This now handles copy for nsproxy and all
  * namespaces therein.
  */
-int copy_namespaces(int flags, struct task_struct *tsk)
+int copy_namespaces(unsigned long flags, struct task_struct *tsk)
 {
        struct nsproxy *old_ns = tsk->nsproxy;
        struct nsproxy *new_ns;
index eb66bd2953ab95f614781b12da75b4613ec0f757..c6e3f9ffff87e62afa5aa93233833b8642144dd9 100644 (file)
@@ -365,7 +365,7 @@ struct pid *find_ge_pid(int nr)
 }
 EXPORT_SYMBOL_GPL(find_get_pid);
 
-struct pid_namespace *copy_pid_ns(int flags, struct pid_namespace *old_ns)
+struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *old_ns)
 {
        BUG_ON(!old_ns);
        get_pid_ns(old_ns);
index 3ae43936bd88fbd250e4a2951e5ded19c34c74b3..9d8180a0f0d815dbe051dbb6a710385d22f0b342 100644 (file)
@@ -39,7 +39,7 @@ static struct uts_namespace *clone_uts_ns(struct uts_namespace *old_ns)
  * utsname of this process won't be seen by parent, and vice
  * versa.
  */
-struct uts_namespace *copy_utsname(int flags, struct uts_namespace *old_ns)
+struct uts_namespace *copy_utsname(unsigned long flags, struct uts_namespace *old_ns)
 {
        struct uts_namespace *new_ns;