OpenVZ Forum


Home » Mailing lists » Devel » [patch -mm] utsname namespace : fix unshare when CONFIG_UTS_NS is not set
[patch -mm] utsname namespace : fix unshare when CONFIG_UTS_NS is not set [message #16706] Thu, 14 September 2006 15:36
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
If the kernel is not configured with the CONFIG_UTS_NS, unshare of
ipc namespace will fail and return -EINVAL.

The patch changes the dummy unshare_utsname() to check the clone flags
before returning.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>
Cc: Serge E. Hallyn <serue@us.ibm.com>
Cc: Linux Containers <containers@lists.osdl.org>

---
 include/linux/utsname.h |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: 2.6.18-rc6-mm2/include/linux/utsname.h
===================================================================
--- 2.6.18-rc6-mm2.orig/include/linux/utsname.h
+++ 2.6.18-rc6-mm2/include/linux/utsname.h
@@ -60,8 +60,12 @@ static inline void put_uts_ns(struct uts
 static inline int unshare_utsname(unsigned long unshare_flags,
 			struct uts_namespace **new_uts)
 {
-	return -EINVAL;
+	if (unshare_flags & CLONE_NEWUTS)
+		return -EINVAL;
+
+	return 0;
 }
+
 static inline int copy_utsname(int flags, struct task_struct *tsk)
 {
 	return 0;
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Previous Topic: [PATCH] IA64,sparc: local DoS with corrupted ELFs
Next Topic: Re: [patch -mm] utsname namespace : fix unshare when CONFIG_UTS_NS is not set
Goto Forum:
  


Current Time: Thu Sep 12 23:22:19 GMT 2024

Total time taken to generate the page: 0.04969 seconds