[Devel] [PATCH RHEL7 COMMIT] module: fix memory leak in load_module
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Jul 26 11:23:19 MSK 2017
The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.33.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.26.1.vz7.33.17
------>
commit d9d4ef0cbdfc1ea0344d19159159e8baae7888b0
Author: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
Date: Wed Jul 26 12:23:18 2017 +0400
module: fix memory leak in load_module
Reported by kmemleak:
comm "systemd-udevd", pid 436, jiffies 4294689313 (age 1166.192s)
hex dump (first 32 bytes):
00 01 00 00 00 00 ad de 00 02 00 00 00 00 ad de ................
80 c1 55 a0 ff ff ff ff 00 00 00 00 00 00 00 00 ..U.............
backtrace:
[<ffffffff8167886e>] kmemleak_alloc+0x4e/0xb0
[<ffffffff811f29f9>] kmem_cache_alloc_trace+0xe9/0x260
[<ffffffff8110e10e>] load_module+0x35e/0x1be0
[<ffffffff8110fb36>] SyS_finit_module+0xa6/0xd0
[<ffffffff81694a89>] system_call_fastpath+0x16/0x1b
[<ffffffffffffffff>] 0xffffffffffffffff
In the scope of https://jira.sw.ru/browse/PSBM-65033
Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
kernel/module.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/module.c b/kernel/module.c
index 298a6d7..27664bd1 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3520,6 +3520,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
mutex_lock(&module_ext_mutex);
list_del(&mod_ext->next);
mutex_unlock(&module_ext_mutex);
+ kfree(mod_ext);
free_unload:
module_unload_free(mod);
unlink_mod:
More information about the Devel
mailing list