diff options
Diffstat (limited to 'arch/m68knommu/kernel/signal.c')
-rw-r--r-- | arch/m68knommu/kernel/signal.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/arch/m68knommu/kernel/signal.c b/arch/m68knommu/kernel/signal.c index 97a471217bba..15ac8205e7ca 100644 --- a/arch/m68knommu/kernel/signal.c +++ b/arch/m68knommu/kernel/signal.c | |||
@@ -74,9 +74,9 @@ sys_sigsuspend(int unused0, int unused1, old_sigset_t mask) | |||
74 | return -ERESTARTNOHAND; | 74 | return -ERESTARTNOHAND; |
75 | } | 75 | } |
76 | 76 | ||
77 | asmlinkage int | 77 | asmlinkage int |
78 | sys_sigaction(int sig, const struct old_sigaction *act, | 78 | sys_sigaction(int sig, const struct old_sigaction __user *act, |
79 | struct old_sigaction *oact) | 79 | struct old_sigaction __user *oact) |
80 | { | 80 | { |
81 | struct k_sigaction new_ka, old_ka; | 81 | struct k_sigaction new_ka, old_ka; |
82 | int ret; | 82 | int ret; |
@@ -107,7 +107,7 @@ sys_sigaction(int sig, const struct old_sigaction *act, | |||
107 | } | 107 | } |
108 | 108 | ||
109 | asmlinkage int | 109 | asmlinkage int |
110 | sys_sigaltstack(const stack_t *uss, stack_t *uoss) | 110 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) |
111 | { | 111 | { |
112 | return do_sigaltstack(uss, uoss, rdusp()); | 112 | return do_sigaltstack(uss, uoss, rdusp()); |
113 | } | 113 | } |
@@ -122,10 +122,10 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss) | |||
122 | 122 | ||
123 | struct sigframe | 123 | struct sigframe |
124 | { | 124 | { |
125 | char *pretcode; | 125 | char __user *pretcode; |
126 | int sig; | 126 | int sig; |
127 | int code; | 127 | int code; |
128 | struct sigcontext *psc; | 128 | struct sigcontext __user *psc; |
129 | char retcode[8]; | 129 | char retcode[8]; |
130 | unsigned long extramask[_NSIG_WORDS-1]; | 130 | unsigned long extramask[_NSIG_WORDS-1]; |
131 | struct sigcontext sc; | 131 | struct sigcontext sc; |
@@ -133,10 +133,10 @@ struct sigframe | |||
133 | 133 | ||
134 | struct rt_sigframe | 134 | struct rt_sigframe |
135 | { | 135 | { |
136 | char *pretcode; | 136 | char __user *pretcode; |
137 | int sig; | 137 | int sig; |
138 | struct siginfo *pinfo; | 138 | struct siginfo __user *pinfo; |
139 | void *puc; | 139 | void __user *puc; |
140 | char retcode[8]; | 140 | char retcode[8]; |
141 | struct siginfo info; | 141 | struct siginfo info; |
142 | struct ucontext uc; | 142 | struct ucontext uc; |
@@ -183,7 +183,7 @@ out: | |||
183 | #define uc_formatvec uc_filler[FPCONTEXT_SIZE/4] | 183 | #define uc_formatvec uc_filler[FPCONTEXT_SIZE/4] |
184 | #define uc_extra uc_filler[FPCONTEXT_SIZE/4+1] | 184 | #define uc_extra uc_filler[FPCONTEXT_SIZE/4+1] |
185 | 185 | ||
186 | static inline int rt_restore_fpu_state(struct ucontext *uc) | 186 | static inline int rt_restore_fpu_state(struct ucontext __user *uc) |
187 | { | 187 | { |
188 | unsigned char fpstate[FPCONTEXT_SIZE]; | 188 | unsigned char fpstate[FPCONTEXT_SIZE]; |
189 | int context_size = 0; | 189 | int context_size = 0; |
@@ -202,7 +202,7 @@ static inline int rt_restore_fpu_state(struct ucontext *uc) | |||
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
204 | 204 | ||
205 | if (__get_user(*(long *)fpstate, (long *)&uc->uc_fpstate)) | 205 | if (__get_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate)) |
206 | goto out; | 206 | goto out; |
207 | if (fpstate[0]) { | 207 | if (fpstate[0]) { |
208 | context_size = fpstate[1]; | 208 | context_size = fpstate[1]; |
@@ -222,7 +222,7 @@ static inline int rt_restore_fpu_state(struct ucontext *uc) | |||
222 | "m" (*fpregs.f_fpcntl)); | 222 | "m" (*fpregs.f_fpcntl)); |
223 | } | 223 | } |
224 | if (context_size && | 224 | if (context_size && |
225 | __copy_from_user(fpstate + 4, (long *)&uc->uc_fpstate + 1, | 225 | __copy_from_user(fpstate + 4, (long __user *)&uc->uc_fpstate + 1, |
226 | context_size)) | 226 | context_size)) |
227 | goto out; | 227 | goto out; |
228 | __asm__ volatile (".chip 68k/68881\n\t" | 228 | __asm__ volatile (".chip 68k/68881\n\t" |
@@ -237,7 +237,7 @@ out: | |||
237 | #endif | 237 | #endif |
238 | 238 | ||
239 | static inline int | 239 | static inline int |
240 | restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp, | 240 | restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *usc, void __user *fp, |
241 | int *pd0) | 241 | int *pd0) |
242 | { | 242 | { |
243 | int formatvec; | 243 | int formatvec; |
@@ -277,10 +277,10 @@ badframe: | |||
277 | 277 | ||
278 | static inline int | 278 | static inline int |
279 | rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, | 279 | rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, |
280 | struct ucontext *uc, int *pd0) | 280 | struct ucontext __user *uc, int *pd0) |
281 | { | 281 | { |
282 | int temp; | 282 | int temp; |
283 | greg_t *gregs = uc->uc_mcontext.gregs; | 283 | greg_t __user *gregs = uc->uc_mcontext.gregs; |
284 | unsigned long usp; | 284 | unsigned long usp; |
285 | int err; | 285 | int err; |
286 | 286 | ||
@@ -330,7 +330,7 @@ asmlinkage int do_sigreturn(unsigned long __unused) | |||
330 | struct switch_stack *sw = (struct switch_stack *) &__unused; | 330 | struct switch_stack *sw = (struct switch_stack *) &__unused; |
331 | struct pt_regs *regs = (struct pt_regs *) (sw + 1); | 331 | struct pt_regs *regs = (struct pt_regs *) (sw + 1); |
332 | unsigned long usp = rdusp(); | 332 | unsigned long usp = rdusp(); |
333 | struct sigframe *frame = (struct sigframe *)(usp - 4); | 333 | struct sigframe __user *frame = (struct sigframe __user *)(usp - 4); |
334 | sigset_t set; | 334 | sigset_t set; |
335 | int d0; | 335 | int d0; |
336 | 336 | ||
@@ -362,7 +362,7 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused) | |||
362 | struct switch_stack *sw = (struct switch_stack *) &__unused; | 362 | struct switch_stack *sw = (struct switch_stack *) &__unused; |
363 | struct pt_regs *regs = (struct pt_regs *) (sw + 1); | 363 | struct pt_regs *regs = (struct pt_regs *) (sw + 1); |
364 | unsigned long usp = rdusp(); | 364 | unsigned long usp = rdusp(); |
365 | struct rt_sigframe *frame = (struct rt_sigframe *)(usp - 4); | 365 | struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(usp - 4); |
366 | sigset_t set; | 366 | sigset_t set; |
367 | int d0; | 367 | int d0; |
368 | 368 | ||
@@ -418,7 +418,7 @@ static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs) | |||
418 | } | 418 | } |
419 | } | 419 | } |
420 | 420 | ||
421 | static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs) | 421 | static inline int rt_save_fpu_state(struct ucontext __user *uc, struct pt_regs *regs) |
422 | { | 422 | { |
423 | unsigned char fpstate[FPCONTEXT_SIZE]; | 423 | unsigned char fpstate[FPCONTEXT_SIZE]; |
424 | int context_size = 0; | 424 | int context_size = 0; |
@@ -439,7 +439,7 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs) | |||
439 | ".chip 68k" | 439 | ".chip 68k" |
440 | : : "m" (*fpstate) : "memory"); | 440 | : : "m" (*fpstate) : "memory"); |
441 | 441 | ||
442 | err |= __put_user(*(long *)fpstate, (long *)&uc->uc_fpstate); | 442 | err |= __put_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate); |
443 | if (fpstate[0]) { | 443 | if (fpstate[0]) { |
444 | fpregset_t fpregs; | 444 | fpregset_t fpregs; |
445 | context_size = fpstate[1]; | 445 | context_size = fpstate[1]; |
@@ -456,7 +456,7 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs) | |||
456 | sizeof(fpregs)); | 456 | sizeof(fpregs)); |
457 | } | 457 | } |
458 | if (context_size) | 458 | if (context_size) |
459 | err |= copy_to_user((long *)&uc->uc_fpstate + 1, fpstate + 4, | 459 | err |= copy_to_user((long __user *)&uc->uc_fpstate + 1, fpstate + 4, |
460 | context_size); | 460 | context_size); |
461 | return err; | 461 | return err; |
462 | } | 462 | } |
@@ -481,10 +481,10 @@ static void setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, | |||
481 | #endif | 481 | #endif |
482 | } | 482 | } |
483 | 483 | ||
484 | static inline int rt_setup_ucontext(struct ucontext *uc, struct pt_regs *regs) | 484 | static inline int rt_setup_ucontext(struct ucontext __user *uc, struct pt_regs *regs) |
485 | { | 485 | { |
486 | struct switch_stack *sw = (struct switch_stack *)regs - 1; | 486 | struct switch_stack *sw = (struct switch_stack *)regs - 1; |
487 | greg_t *gregs = uc->uc_mcontext.gregs; | 487 | greg_t __user *gregs = uc->uc_mcontext.gregs; |
488 | int err = 0; | 488 | int err = 0; |
489 | 489 | ||
490 | err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version); | 490 | err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version); |
@@ -512,7 +512,7 @@ static inline int rt_setup_ucontext(struct ucontext *uc, struct pt_regs *regs) | |||
512 | return err; | 512 | return err; |
513 | } | 513 | } |
514 | 514 | ||
515 | static inline void * | 515 | static inline void __user * |
516 | get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) | 516 | get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) |
517 | { | 517 | { |
518 | unsigned long usp; | 518 | unsigned long usp; |
@@ -525,13 +525,13 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) | |||
525 | if (!sas_ss_flags(usp)) | 525 | if (!sas_ss_flags(usp)) |
526 | usp = current->sas_ss_sp + current->sas_ss_size; | 526 | usp = current->sas_ss_sp + current->sas_ss_size; |
527 | } | 527 | } |
528 | return (void *)((usp - frame_size) & -8UL); | 528 | return (void __user *)((usp - frame_size) & -8UL); |
529 | } | 529 | } |
530 | 530 | ||
531 | static int setup_frame (int sig, struct k_sigaction *ka, | 531 | static int setup_frame (int sig, struct k_sigaction *ka, |
532 | sigset_t *set, struct pt_regs *regs) | 532 | sigset_t *set, struct pt_regs *regs) |
533 | { | 533 | { |
534 | struct sigframe *frame; | 534 | struct sigframe __user *frame; |
535 | struct sigcontext context; | 535 | struct sigcontext context; |
536 | int err = 0; | 536 | int err = 0; |
537 | 537 | ||
@@ -592,7 +592,7 @@ give_sigsegv: | |||
592 | static int setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, | 592 | static int setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, |
593 | sigset_t *set, struct pt_regs *regs) | 593 | sigset_t *set, struct pt_regs *regs) |
594 | { | 594 | { |
595 | struct rt_sigframe *frame; | 595 | struct rt_sigframe __user *frame; |
596 | int err = 0; | 596 | int err = 0; |
597 | 597 | ||
598 | frame = get_sigframe(ka, regs, sizeof(*frame)); | 598 | frame = get_sigframe(ka, regs, sizeof(*frame)); |
@@ -609,8 +609,8 @@ static int setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, | |||
609 | 609 | ||
610 | /* Create the ucontext. */ | 610 | /* Create the ucontext. */ |
611 | err |= __put_user(0, &frame->uc.uc_flags); | 611 | err |= __put_user(0, &frame->uc.uc_flags); |
612 | err |= __put_user(0, &frame->uc.uc_link); | 612 | err |= __put_user(NULL, &frame->uc.uc_link); |
613 | err |= __put_user((void *)current->sas_ss_sp, | 613 | err |= __put_user((void __user *)current->sas_ss_sp, |
614 | &frame->uc.uc_stack.ss_sp); | 614 | &frame->uc.uc_stack.ss_sp); |
615 | err |= __put_user(sas_ss_flags(rdusp()), | 615 | err |= __put_user(sas_ss_flags(rdusp()), |
616 | &frame->uc.uc_stack.ss_flags); | 616 | &frame->uc.uc_stack.ss_flags); |