Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356731
b: refs/heads/master
c: 09a4d5d
h: refs/heads/master
i:
  356729: b2eb7cd
  356727: d11bb3c
v: v3
  • Loading branch information
Al Viro committed Feb 3, 2013
1 parent b2b8fa8 commit fddc692
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 76 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5aa1cde2edbc64403a6b06aaa8723cca11c12681
refs/heads/master: 09a4d5d015d951c7262d999cbd39f5c2cd5786da
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ config PPC
select GENERIC_COMPAT_RT_SIGPROCMASK
select GENERIC_COMPAT_RT_SIGPENDING
select OLD_SIGSUSPEND
select OLD_SIGACTION if PPC32

config EARLY_PRINTK
bool
Expand All @@ -160,6 +161,7 @@ config COMPAT
default y if PPC64
select COMPAT_BINFMT_ELF
select ARCH_WANT_OLD_COMPAT_IPC
select COMPAT_OLD_SIGACTION

config SYSVIPC_COMPAT
bool
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/include/uapi/asm/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ typedef struct {

#include <asm-generic/signal-defs.h>

#ifndef __KERNEL__
struct old_sigaction {
__sighandler_t sa_handler;
old_sigset_t sa_mask;
unsigned long sa_flags;
__sigrestore_t sa_restorer;
};

#ifndef __KERNEL__
struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
Expand Down
9 changes: 0 additions & 9 deletions trunk/arch/powerpc/kernel/ppc32.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@

/* These are here to support 32-bit syscalls on a 64-bit kernel. */

#define __old_sigaction32 old_sigaction32

struct __old_sigaction32 {
compat_uptr_t sa_handler;
compat_old_sigset_t sa_mask;
unsigned int sa_flags;
compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */
};

struct pt_regs32 {
unsigned int gpr[32];
unsigned int nip;
Expand Down
65 changes: 0 additions & 65 deletions trunk/arch/powerpc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@

#ifdef CONFIG_PPC64
#define sys_rt_sigreturn compat_sys_rt_sigreturn
#define sys_sigaction compat_sys_sigaction
#define sys_swapcontext compat_sys_swapcontext
#define sys_sigreturn compat_sys_sigreturn

Expand Down Expand Up @@ -130,23 +129,6 @@ static inline int get_sigset_t(sigset_t *set,
return 0;
}

static inline int get_old_sigaction(struct k_sigaction *new_ka,
struct old_sigaction __user *act)
{
compat_old_sigset_t mask;
compat_uptr_t handler, restorer;

if (get_user(handler, &act->sa_handler) ||
__get_user(restorer, &act->sa_restorer) ||
__get_user(new_ka->sa.sa_flags, &act->sa_flags) ||
__get_user(mask, &act->sa_mask))
return -EFAULT;
new_ka->sa.sa_handler = compat_ptr(handler);
new_ka->sa.sa_restorer = compat_ptr(restorer);
siginitset(&new_ka->sa.sa_mask, mask);
return 0;
}

#define to_user_ptr(p) ptr_to_compat(p)
#define from_user_ptr(p) compat_ptr(p)

Expand Down Expand Up @@ -196,21 +178,6 @@ static inline int get_sigset_t(sigset_t *set, const sigset_t __user *uset)
return copy_from_user(set, uset, sizeof(*uset));
}

static inline int get_old_sigaction(struct k_sigaction *new_ka,
struct old_sigaction __user *act)
{
old_sigset_t mask;

if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
__get_user(new_ka->sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka->sa.sa_restorer, &act->sa_restorer) ||
__get_user(new_ka->sa.sa_flags, &act->sa_flags) ||
__get_user(mask, &act->sa_mask))
return -EFAULT;
siginitset(&new_ka->sa.sa_mask, mask);
return 0;
}

#define to_user_ptr(p) ((unsigned long)(p))
#define from_user_ptr(p) ((void __user *)(p))

Expand All @@ -234,40 +201,8 @@ static inline int restore_general_regs(struct pt_regs *regs,
return -EFAULT;
return 0;
}

#endif /* CONFIG_PPC64 */

long sys_sigaction(int sig, struct old_sigaction __user *act,
struct old_sigaction __user *oact)
{
struct k_sigaction new_ka, old_ka;
int ret;

#ifdef CONFIG_PPC64
if (sig < 0)
sig = -sig;
#endif

if (act) {
if (get_old_sigaction(&new_ka, act))
return -EFAULT;
}

ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
if (!ret && oact) {
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
__put_user(to_user_ptr(old_ka.sa.sa_handler),
&oact->sa_handler) ||
__put_user(to_user_ptr(old_ka.sa.sa_restorer),
&oact->sa_restorer) ||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
return -EFAULT;
}

return ret;
}

/*
* When we have signals to deliver, we set up on the
* user stack, going down from the original stack pointer:
Expand Down

0 comments on commit fddc692

Please sign in to comment.