From: Sergey Vlasov Date: Sat, 25 Mar 2006 17:36:37 +0000 (+0100) Subject: [PATCH] Fix module refcount leak in __set_personality() X-Git-Tag: v2.6.16.2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=097189fd249125617092ae9b57e36b7d87a5c1bf;p=people%2Fms%2Flinux.git [PATCH] Fix module refcount leak in __set_personality() 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 Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Adrian Bunk Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c index 867d6dbeb574..c01cead2cfd6 100644 --- a/kernel/exec_domain.c +++ b/kernel/exec_domain.c @@ -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; }