]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] Fix module refcount leak in __set_personality()
authorSergey Vlasov <vsu@altlinux.ru>
Sat, 25 Mar 2006 17:36:37 +0000 (18:36 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 7 Apr 2006 16:44:29 +0000 (09:44 -0700)
If the change of personality does not lead to change of exec domain,
__set_personality() returned without releasing the module reference
acquired by lookup_exec_domain().

This patch was already included in Linus' tree.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/exec_domain.c

index 867d6dbeb5743d1e49e1906b990031b4bdd7ee56..c01cead2cfd61978cb342853651fe9b158365976 100644 (file)
@@ -140,6 +140,7 @@ __set_personality(u_long personality)
        ep = lookup_exec_domain(personality);
        if (ep == current_thread_info()->exec_domain) {
                current->personality = personality;
+               module_put(ep->module);
                return 0;
        }