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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1245699332-1872-1-git-send-email-vapier@gentoo.org>
Date:	Mon, 22 Jun 2009 15:35:32 -0400
From:	Mike Frysinger <vapier@...too.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org,
	uclinux-dist-devel@...ckfin.uclinux.org, stable@...nel.org,
	David Howells <dhowells@...hat.com>,
	Bernd Schmidt <bernds_cb1@...nline.de>
Subject: [PATCH] FLAT: fix uninitialized ptr with shared libs

From: Bernd Schmidt <bernds_cb1@...nline.de>

The new credentials code broke load_flat_shared_library() as it now uses
an uninitialized cred pointer.

Signed-off-by: Bernd Schmidt <bernds_cb1@...nline.de>
Signed-off-by: Mike Frysinger <vapier@...too.org>
Acked-by: David Howells <dhowells@...hat.com>
---
should be cleaned up to apply to the master branch

 fs/binfmt_flat.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 697f6b5..33283cd 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -824,14 +824,23 @@ static int load_flat_shared_library(int id, struct lib_info *libs)
 	/* Open the file up */
 	bprm.filename = buf;
 	bprm.file = open_exec(bprm.filename);
+	bprm.cred = NULL;
 	res = PTR_ERR(bprm.file);
 	if (IS_ERR(bprm.file))
 		return res;
 
+	bprm.cred = prepare_exec_creds();
+	if (!bprm.cred)
+		goto out;
+
 	res = prepare_binprm(&bprm);
 
 	if (res <= (unsigned long)-4096)
 		res = load_flat_file(&bprm, libs, id, NULL);
+ out:
+	if (bprm.cred)
+		abort_creds(bprm.cred);
+
 	if (bprm.file) {
 		allow_write_access(bprm.file);
 		fput(bprm.file);
-- 
1.6.3.1

--
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