diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-25 18:49:25 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-03 18:16:13 -0500 |
commit | f036b943441ac8e79b779e3500ae4820c243b4f2 (patch) | |
tree | 9dfb816a36645124f1ca06a2bff681ee4acff493 /arch | |
parent | d7b5427cec79d993459c162db67eac9e22135e8b (diff) |
s390: switch to generic compat rt_sigaction
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/Kconfig | 1 | ||||
-rw-r--r-- | arch/s390/kernel/compat_linux.h | 8 | ||||
-rw-r--r-- | arch/s390/kernel/compat_signal.c | 40 | ||||
-rw-r--r-- | arch/s390/kernel/compat_wrapper.S | 2 |
4 files changed, 2 insertions, 49 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 17ba4f3be7ec..e3ab2d6fdca6 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -141,6 +141,7 @@ config S390 | |||
141 | select MODULES_USE_ELF_RELA | 141 | select MODULES_USE_ELF_RELA |
142 | select CLONE_BACKWARDS2 | 142 | select CLONE_BACKWARDS2 |
143 | select GENERIC_SIGALTSTACK | 143 | select GENERIC_SIGALTSTACK |
144 | select GENERIC_COMPAT_RT_SIGACTION | ||
144 | select GENERIC_COMPAT_RT_SIGQUEUEINFO | 145 | select GENERIC_COMPAT_RT_SIGQUEUEINFO |
145 | select GENERIC_COMPAT_RT_SIGPROCMASK | 146 | select GENERIC_COMPAT_RT_SIGPROCMASK |
146 | select GENERIC_COMPAT_RT_SIGPENDING | 147 | select GENERIC_COMPAT_RT_SIGPENDING |
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index aee753dea1d4..47e9f07e3675 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h | |||
@@ -68,12 +68,6 @@ struct sigcontext32 | |||
68 | }; | 68 | }; |
69 | 69 | ||
70 | /* asm/signal.h */ | 70 | /* asm/signal.h */ |
71 | struct sigaction32 { | ||
72 | __u32 sa_handler; /* pointer */ | ||
73 | __u32 sa_flags; | ||
74 | __u32 sa_restorer; /* pointer */ | ||
75 | compat_sigset_t sa_mask; /* mask last for extensibility */ | ||
76 | }; | ||
77 | 71 | ||
78 | /* asm/ucontext.h */ | 72 | /* asm/ucontext.h */ |
79 | struct ucontext32 { | 73 | struct ucontext32 { |
@@ -139,6 +133,4 @@ long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); | |||
139 | long sys32_fadvise64_64(struct fadvise64_64_args __user *args); | 133 | long sys32_fadvise64_64(struct fadvise64_64_args __user *args); |
140 | long sys32_sigaction(int sig, const struct old_sigaction32 __user *act, | 134 | long sys32_sigaction(int sig, const struct old_sigaction32 __user *act, |
141 | struct old_sigaction32 __user *oact); | 135 | struct old_sigaction32 __user *oact); |
142 | long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, | ||
143 | struct sigaction32 __user *oact, size_t sigsetsize); | ||
144 | #endif /* _ASM_S390X_S390_H */ | 136 | #endif /* _ASM_S390X_S390_H */ |
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index eacb0d6058a3..141bfe190d52 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
@@ -194,46 +194,6 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act, | |||
194 | return ret; | 194 | return ret; |
195 | } | 195 | } |
196 | 196 | ||
197 | asmlinkage long | ||
198 | sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, | ||
199 | struct sigaction32 __user *oact, size_t sigsetsize) | ||
200 | { | ||
201 | struct k_sigaction new_ka, old_ka; | ||
202 | unsigned long sa_handler; | ||
203 | int ret; | ||
204 | compat_sigset_t set32; | ||
205 | |||
206 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
207 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
208 | return -EINVAL; | ||
209 | |||
210 | if (act) { | ||
211 | ret = get_user(sa_handler, &act->sa_handler); | ||
212 | ret |= __copy_from_user(&set32, &act->sa_mask, | ||
213 | sizeof(compat_sigset_t)); | ||
214 | new_ka.sa.sa_mask.sig[0] = | ||
215 | set32.sig[0] | (((long)set32.sig[1]) << 32); | ||
216 | ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); | ||
217 | |||
218 | if (ret) | ||
219 | return -EFAULT; | ||
220 | new_ka.sa.sa_handler = (__sighandler_t) sa_handler; | ||
221 | } | ||
222 | |||
223 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
224 | |||
225 | if (!ret && oact) { | ||
226 | set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32); | ||
227 | set32.sig[0] = old_ka.sa.sa_mask.sig[0]; | ||
228 | ret = put_user((unsigned long)old_ka.sa.sa_handler, &oact->sa_handler); | ||
229 | ret |= __copy_to_user(&oact->sa_mask, &set32, | ||
230 | sizeof(compat_sigset_t)); | ||
231 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | ||
232 | } | ||
233 | |||
234 | return ret; | ||
235 | } | ||
236 | |||
237 | static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs) | 197 | static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs) |
238 | { | 198 | { |
239 | _s390_regs_common32 regs32; | 199 | _s390_regs_common32 regs32; |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 0dd80b9ff74c..1f8af0017c65 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -691,7 +691,7 @@ ENTRY(sys32_rt_sigaction_wrapper) | |||
691 | llgtr %r3,%r3 # const struct sigaction_emu31 * | 691 | llgtr %r3,%r3 # const struct sigaction_emu31 * |
692 | llgtr %r4,%r4 # const struct sigaction_emu31 * | 692 | llgtr %r4,%r4 # const struct sigaction_emu31 * |
693 | llgfr %r5,%r5 # size_t | 693 | llgfr %r5,%r5 # size_t |
694 | jg sys32_rt_sigaction # branch to system call | 694 | jg compat_sys_rt_sigaction # branch to system call |
695 | 695 | ||
696 | ENTRY(sys32_rt_sigprocmask_wrapper) | 696 | ENTRY(sys32_rt_sigprocmask_wrapper) |
697 | lgfr %r2,%r2 # int | 697 | lgfr %r2,%r2 # int |