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]
Date:   Wed, 20 Jun 2018 08:19:12 -0500
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     David Howells <dhowells@...hat.com>
Cc:     linux-afs@...ts.infradead.org, linux-kernel@...r.kernel.org,
        "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Subject: [PATCH] afs/super.c: Fix memory leak in afs_init_fs_context

Release resources allocated for *ctx* before return.

Addresses-Coverity-ID: 1470101 ("Resource leak")
Fixes: 1ec2b51af007 ("afs: Add fs_context support")
Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
---
 fs/afs/super.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/afs/super.c b/fs/afs/super.c
index 656f810..037f20f 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -596,8 +596,10 @@ static int afs_init_fs_context(struct fs_context *fc, struct dentry *reference)
 		break;
 
 	case FS_CONTEXT_FOR_SUBMOUNT:
-		if (!reference)
+		if (!reference) {
+			kfree(ctx);
 			return -EINVAL;
+		}
 
 		src_as = AFS_FS_S(reference->d_sb);
 		ASSERT(src_as);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ