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, 22 Apr 2012 03:19:43 +0530
From:	Sasikanth V <sasikanth.v19@...il.com>
To:	Alexander Viro <viro@...iv.linux.org.uk>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Sasikanth V <sasikanth.v19@...il.com>
Subject: [PATCH] fs: uselib - Set error on do_filp_open failure only

At present "error" is set irrespective of do_filp_open failed or not.
Setting error to PTR_ERR(file) on do_filp_open failure only.

Signed-off-by: Sasikanth V <sasikanth.v19@...il.com>
---
 fs/exec.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index b1fd202..cb43367 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -129,9 +129,10 @@ SYSCALL_DEFINE1(uselib, const char __user *, library)
 
 	file = do_filp_open(AT_FDCWD, tmp, &uselib_flags, LOOKUP_FOLLOW);
 	putname(tmp);
-	error = PTR_ERR(file);
-	if (IS_ERR(file))
+	if (IS_ERR(file)) {
+		error = PTR_ERR(file);
 		goto out;
+	}
 
 	error = -EINVAL;
 	if (!S_ISREG(file->f_path.dentry->d_inode->i_mode))
-- 
1.7.3.4

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