* [PATCH 3/3] user namespaces: let user_ns be cloned with fairsched
@ 2008-11-25 1:06 Serge E. Hallyn
2008-11-25 1:20 ` Serge E. Hallyn
0 siblings, 1 reply; 2+ messages in thread
From: Serge E. Hallyn @ 2008-11-25 1:06 UTC (permalink / raw)
To: lkml; +Cc: Linux Containers, Eric W. Biederman, Michael Kerrisk,
Dhaval Giani
fairsched creates a per-uid directory under /sys/kernel/uids/.
So when you clone(CLONE_NEWUSER), it tries to create
/sys/kernel/uids/0, which already exists, and you get back
-ENOMEM.
This was supposed to be fixed by sysfs tagging, but that
was postponed (ok, rejected until sysfs locking is fixed).
So, just as with network namespaces, we just don't create
those directories for user namespaces other than the init.
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
---
kernel/user.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
2d00643e7a4eda47526be7bca9600fda0d96c1c0
diff --git a/kernel/user.c b/kernel/user.c
index 97202cb..6c924bc 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -246,6 +246,8 @@ static int uids_user_create(struct user_
int error;
memset(kobj, 0, sizeof(struct kobject));
+ if (up->user_ns != &init_user_ns)
+ return 0;
kobj->kset = uids_kset;
error = kobject_init_and_add(kobj, &uids_ktype, NULL, "%d", up->uid);
if (error) {
@@ -281,6 +283,8 @@ static void remove_user_sysfs_dir(struct
unsigned long flags;
int remove_user = 0;
+ if (up->user_ns != &init_user_ns)
+ return;
/* Make uid_hash_remove() + sysfs_remove_file() + kobject_del()
* atomic.
*/
--
1.1.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-25 1:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-25 1:06 [PATCH 3/3] user namespaces: let user_ns be cloned with fairsched Serge E. Hallyn
2008-11-25 1:20 ` Serge E. Hallyn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox