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: <95ac67c7-6a80-6d58-a8c2-43701e76ecdc@users.sourceforge.net>
Date:   Wed, 18 Jan 2017 12:45:13 +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 1/4] alpha: Return an error code only as a constant in
 osf_sigstack()

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

* Return an error code without storing it in an intermediate variable.

* Delete the local variable "error" which became unnecessary with
  this refactoring.

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

diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 56e427c7aa3c..41174156a676 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -691,20 +691,17 @@ SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss,
 	unsigned long usp = rdusp();
 	unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size;
 	unsigned long oss_os = on_sig_stack(usp);
-	int error;
 
 	if (uss) {
 		void __user *ss_sp;
 
-		error = -EFAULT;
 		if (get_user(ss_sp, &uss->ss_sp))
-			goto out;
+			return -EFAULT;
 
 		/* If the current stack was set with sigaltstack, don't
 		   swap stacks while we are on it.  */
-		error = -EPERM;
 		if (current->sas_ss_sp && on_sig_stack(usp))
-			goto out;
+			return -EPERM;
 
 		/* Since we don't know the extent of the stack, and we don't
 		   track onstack-ness, but rather calculate it, we must 
@@ -714,16 +711,12 @@ SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss,
 	}
 
 	if (uoss) {
-		error = -EFAULT;
 		if (! access_ok(VERIFY_WRITE, uoss, sizeof(*uoss))
 		    || __put_user(oss_sp, &uoss->ss_sp)
 		    || __put_user(oss_os, &uoss->ss_onstack))
-			goto out;
+			return -EFAULT;
 	}
-
-	error = 0;
- out:
-	return error;
+	return 0;
 }
 
 SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count)
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ