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:	Sun, 12 Dec 2010 23:18:15 +0100 (CET)
From:	Jesper Juhl <jj@...osbits.net>
To:	linux-kernel@...r.kernel.org
cc:	Jan Kara <jack@...e.cz>,
	Ben Fennema <bfennema@...con.csc.calpoly.edu>
Subject: [PATCH] UDF: Close small mem leak in udf_find_entry()

Hi,

There's a small memory leak in fs/udf/namei.c::udf_find_entry().

We dynamically allocate memory for 'fname' with kmalloc() and in most 
situations we free it before we leave the function, but there is one 
situation where we do not (but should). This patch closes the leak by 
jumping to the 'out_ok' label which does the correct cleanup rather than 
doing half the cleanup and returning directly.


Signed-off-by: Jesper Juhl <jj@...osbits.net>
---
 namei.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

 compile tested only

diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 6d8dc02..899ef91 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -228,10 +228,8 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir,
 		}
 
 		if ((cfi->fileCharacteristics & FID_FILE_CHAR_PARENT) &&
-		    isdotdot) {
-			brelse(epos.bh);
-			return fi;
-		}
+		    isdotdot)
+			goto out_ok;
 
 		if (!lfi)
 			continue;



-- 
Jesper Juhl <jj@...osbits.net>            http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ