lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210528201107.459362-1-jarmo.tiitto@gmail.com>
Date:   Fri, 28 May 2021 23:11:07 +0300
From:   Jarmo Tiitto <jarmo.tiitto@...il.com>
To:     samitolvanen@...gle.com
Cc:     wcw@...gle.com, nathan@...nel.org, ndesaulniers@...gle.com,
        linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com,
        Jarmo Tiitto <jarmo.tiitto@...il.com>
Subject: [PATCH 5/6] pgo: modules Fixup memory leak.

Signed-off-by: Jarmo Tiitto <jarmo.tiitto@...il.com>
---
 kernel/pgo/fs_mod.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/pgo/fs_mod.c b/kernel/pgo/fs_mod.c
index 0808d44227f1..2d1ff99e7982 100644
--- a/kernel/pgo/fs_mod.c
+++ b/kernel/pgo/fs_mod.c
@@ -261,6 +261,8 @@ static int prf_module_open(struct inode *inode, struct file *file)
 
 				if (!pinfo->buffer) {
 					err = -ENOMEM;
+					kfree(pinfo);
+					module_put(mod);
 					goto out;
 				}
 			}
@@ -373,7 +375,7 @@ static int pgo_module_notifier(struct notifier_block *nb, unsigned long event,
 			if (strcmp(data->mod->name, mod->name) == 0) {
 
 				mutex_lock(&prf_mod_lock);
-				/* remofe from profiled modules */
+				/* remove from profiled modules */
 				list_del_rcu(&data->link);
 				/* mark it stale */
 				WRITE_ONCE(data->mod, NULL);
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ