Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756061AbZFVTgB (ORCPT ); Mon, 22 Jun 2009 15:36:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752152AbZFVTfw (ORCPT ); Mon, 22 Jun 2009 15:35:52 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:49235 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750776AbZFVTfv (ORCPT ); Mon, 22 Jun 2009 15:35:51 -0400 From: Mike Frysinger To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, uclinux-dist-devel@blackfin.uclinux.org, stable@kernel.org, David Howells , Bernd Schmidt Subject: [PATCH] FLAT: fix uninitialized ptr with shared libs Date: Mon, 22 Jun 2009 15:35:32 -0400 Message-Id: <1245699332-1872-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.6.3.1 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1404 Lines: 50 From: Bernd Schmidt The new credentials code broke load_flat_shared_library() as it now uses an uninitialized cred pointer. Signed-off-by: Bernd Schmidt Signed-off-by: Mike Frysinger Acked-by: David Howells --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/