]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] fs/namespace.c:dup_namespace(): fix a use after free
authorAdrian Bunk <bunk@stusta.de>
Wed, 15 Mar 2006 16:37:32 +0000 (17:37 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 15 Mar 2006 17:37:34 +0000 (09:37 -0800)
commit8227fd06d8c854c5d14bb46987c766489bcf9baf
tree1252d76d1e36602024c6dcf0c9afc5688e7bde85
parent3d1aa50c24b64a5f34c897d0af3fca0289a00e57
[PATCH] fs/namespace.c:dup_namespace(): fix a use after free

The Coverity checker spotted the following bug in dup_namespace():

<--  snip  -->

        if (!new_ns->root) {
                up_write(&namespace_sem);
                kfree(new_ns);
                goto out;
        }
...
out:
        return new_ns;

<--  snip  -->

Callers expect a non-NULL result to not be freed.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/namespace.c