Commit:     efc63c4fb0f95865907472d1c6bc0cfea9ee156b
Parent:     019ad4a0a60b09022945273848b5a686e39a78aa
Author:     Alexey Dobriyan <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 18 22:46:27 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Sep 19 11:24:17 2007 -0700

    Fix UTS corruption during clone(CLONE_NEWUTS)
    struct utsname is copied from master one without any exclusion.
    Here is sample output from one proggie doing
    and another
        clone(,, CLONE_NEWUTS, ...)
        hostname = 'aaaaaaaaaaaaaaaaaaaaaaaaabbbbb'
        hostname = 'bbbaaaaaaaaaaaaaaaaaaaaaaaaaaa'
        hostname = 'aaaaaaaabbbbbbbbbbbbbbbbbbbbbb'
        hostname = 'aaaaaaaaaaaaaaaaaaaaaaaaaabbbb'
        hostname = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaabb'
        hostname = 'aaabbbbbbbbbbbbbbbbbbbbbbbbbbb'
        hostname = 'bbbbbbbbbbbbbbbbaaaaaaaaaaaaaa'
    Hostname is sometimes corrupted.
    Yes, even _the_ simplest namespace activity had bug in it. :-(
    Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>
    Acked-by: Serge Hallyn <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/utsname.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/utsname.c b/kernel/utsname.c
index 9d8180a..816d7b2 100644
--- a/kernel/utsname.c
+++ b/kernel/utsname.c
@@ -28,7 +28,9 @@ static struct uts_namespace *clone_uts_ns(struct 
uts_namespace *old_ns)
        if (!ns)
                return ERR_PTR(-ENOMEM);
+       down_read(&uts_sem);
        memcpy(&ns->name, &old_ns->name, sizeof(ns->name));
+       up_read(&uts_sem);
        return ns;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to