From: Sergey Vlasov Date: Fri, 24 Mar 2006 11:18:38 +0000 (-0800) Subject: [PATCH] Fix module refcount leak in __set_personality() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6a4d11c2abc57ed7ca42041e5f68ae4f7f640a81;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.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(). Signed-off-by: Sergey Vlasov Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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; }