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]
Date:	Mon,  3 Mar 2014 00:59:16 +0100
From:	Richard Weinberger <richard@....at>
To:	linux-kernel@...r.kernel.org
Cc:	linux-arch@...r.kernel.org, viro@...iv.linux.org.uk,
	vgupta@...opsys.com, catalin.marinas@....com, will.deacon@....com,
	hskinnemoen@...il.com, egtvedt@...fundet.no, vapier@...too.org,
	msalter@...hat.com, a-jacquiot@...com, starvik@...s.com,
	jesper.nilsson@...s.com, dhowells@...hat.com, rkuo@...eaurora.org,
	tony.luck@...el.com, fenghua.yu@...el.com, takata@...ux-m32r.org,
	geert@...ux-m68k.org, james.hogan@...tec.com, monstr@...str.eu,
	yasutake.koichi@...panasonic.com, ralf@...ux-mips.org,
	jonas@...thpole.se, jejb@...isc-linux.org, deller@....de,
	benh@...nel.crashing.org, paulus@...ba.org, schwidefsky@...ibm.com,
	heiko.carstens@...ibm.com, liqin.linux@...il.com,
	lennox.wu@...il.com, cmetcalf@...era.com, gxt@...c.pku.edu.cn,
	linux-xtensa@...ux-xtensa.org, akpm@...ux-foundation.org,
	oleg@...hat.com, tj@...nel.org, hch@...radead.org,
	Richard Weinberger <richard@....at>
Subject: [PATCH 33/44] frv: Use translate_signal()

Use the common helper instead of it's own open coded variant.

Signed-off-by: Richard Weinberger <richard@....at>
---
 arch/frv/kernel/signal.c | 27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 8e37cf2..108a74e 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -19,7 +19,6 @@
 #include <linux/wait.h>
 #include <linux/ptrace.h>
 #include <linux/unistd.h>
-#include <linux/personality.h>
 #include <linux/tracehook.h>
 #include <asm/ucontext.h>
 #include <asm/uaccess.h>
@@ -183,7 +182,6 @@ static inline void __user *get_sigframe(struct k_sigaction *ka,
 static int setup_frame(struct ksignal *ksig, sigset_t *set)
 {
 	struct sigframe __user *frame;
-	int rsig, sig = ksig->sig;
 
 	set_fs(USER_DS);
 
@@ -192,13 +190,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
 	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
 		return -EFAULT;
 
-	rsig = sig;
-	if (sig < 32 &&
-	    __current_thread_info->exec_domain &&
-	    __current_thread_info->exec_domain->signal_invmap)
-		rsig = __current_thread_info->exec_domain->signal_invmap[sig];
-
-	if (__put_user(rsig, &frame->sig) < 0)
+	if (__put_user(translate_signal(ksig->sig), &frame->sig) < 0)
 		return -EFAULT;
 
 	if (setup_sigcontext(&frame->sc, set->sig[0]))
@@ -246,11 +238,11 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
 
 	__frame->sp   = (unsigned long) frame;
 	__frame->lr   = (unsigned long) &frame->retcode;
-	__frame->gr8  = sig;
+	__frame->gr8  = ksig->sig;
 
 #if DEBUG_SIG
 	printk("SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n",
-	       sig, current->comm, current->pid, frame, __frame->pc,
+	       ksig->sig, current->comm, current->pid, frame, __frame->pc,
 	       frame->pretcode);
 #endif
 
@@ -264,7 +256,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
 static int setup_rt_frame(struct ksignal *ksig, sigset_t *set)
 {
 	struct rt_sigframe __user *frame;
-	int rsig, sig = ksig->sig;
 
 	set_fs(USER_DS);
 
@@ -273,13 +264,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set)
 	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
 		return -EFAULT;
 
-	rsig = sig;
-	if (sig < 32 &&
-	    __current_thread_info->exec_domain &&
-	    __current_thread_info->exec_domain->signal_invmap)
-		rsig = __current_thread_info->exec_domain->signal_invmap[sig];
-
-	if (__put_user(rsig,		&frame->sig) ||
+	if (__put_user(translate_signal(ksig->sig), &frame->sig) ||
 	    __put_user(&frame->info,	&frame->pinfo) ||
 	    __put_user(&frame->uc,	&frame->puc))
 		return -EFAULT;
@@ -335,12 +320,12 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set)
 
 	__frame->sp  = (unsigned long) frame;
 	__frame->lr  = (unsigned long) &frame->retcode;
-	__frame->gr8 = sig;
+	__frame->gr8 = ksig->sig;
 	__frame->gr9 = (unsigned long) &frame->info;
 
 #if DEBUG_SIG
 	printk("SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n",
-	       sig, current->comm, current->pid, frame, __frame->pc,
+	       ksig->sig, current->comm, current->pid, frame, __frame->pc,
 	       frame->pretcode);
 #endif
 	return 0;
-- 
1.8.4.2

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