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: <5649cb94-620c-7b60-f150-a6838cafbfc6@users.sourceforge.net>
Date:   Wed, 18 Jan 2017 12:46:52 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-alpha@...r.kernel.org, Al Viro <viro@...iv.linux.org.uk>,
        Ivan Kokshaysky <ink@...assic.park.msu.ru>,
        Jan-Benedict Glaw <jbglaw@...-owl.de>,
        Matt Turner <mattst88@...il.com>,
        Nicolas Pitre <nicolas.pitre@...aro.org>,
        Richard Cochran <richardcochran@...il.com>,
        Richard Henderson <rth@...ddle.net>,
        Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 2/4] alpha: Move two assignments for the variable "error" in
 osf_utsname()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 18 Jan 2017 11:10:03 +0100

A local variable was set to an error code in one case before a concrete
error situation was detected. Thus move the corresponding assignment into
an if branch to indicate a software failure there.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 arch/alpha/kernel/osf_sys.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 41174156a676..73ff5d698591 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -528,20 +528,14 @@ SYSCALL_DEFINE1(osf_utsname, char __user *, name)
 	int error;
 
 	down_read(&uts_sem);
-	error = -EFAULT;
-	if (copy_to_user(name + 0, utsname()->sysname, 32))
-		goto out;
-	if (copy_to_user(name + 32, utsname()->nodename, 32))
-		goto out;
-	if (copy_to_user(name + 64, utsname()->release, 32))
-		goto out;
-	if (copy_to_user(name + 96, utsname()->version, 32))
-		goto out;
-	if (copy_to_user(name + 128, utsname()->machine, 32))
-		goto out;
-
-	error = 0;
- out:
+	if (copy_to_user(name + 0, utsname()->sysname, 32) ||
+	    copy_to_user(name + 32, utsname()->nodename, 32) ||
+	    copy_to_user(name + 64, utsname()->release, 32) ||
+	    copy_to_user(name + 96, utsname()->version, 32) ||
+	    copy_to_user(name + 128, utsname()->machine, 32))
+		error = -EFAULT;
+	else
+		error = 0;
 	up_read(&uts_sem);	
 	return error;
 }
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ