aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/compat_signal.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2011-10-30 10:17:15 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2011-10-30 10:16:46 -0400
commit3c52e49d7c81434e3d2ccb520b3a654c2cc7d03d (patch)
treefee9f3d92204f6081e39481df5bb2dc4b038d9ea /arch/s390/kernel/compat_signal.c
parent5b479a79bff752c6719463f093bdd191f4b837db (diff)
[S390] sparse: fix sparse warnings with __user pointers
Use __force to quiet sparse warnings about user address space. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/compat_signal.c')
-rw-r--r--arch/s390/kernel/compat_signal.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index c68ea9c18046..4f68c81d3ffa 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -141,7 +141,8 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
141 break; 141 break;
142 case __SI_FAULT >> 16: 142 case __SI_FAULT >> 16:
143 err |= __get_user(tmp, &from->si_addr); 143 err |= __get_user(tmp, &from->si_addr);
144 to->si_addr = (void __user *)(u64) (tmp & PSW32_ADDR_INSN); 144 to->si_addr = (void __force __user *)
145 (u64) (tmp & PSW32_ADDR_INSN);
145 break; 146 break;
146 case __SI_POLL >> 16: 147 case __SI_POLL >> 16:
147 err |= __get_user(to->si_band, &from->si_band); 148 err |= __get_user(to->si_band, &from->si_band);
@@ -482,7 +483,7 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
482 } else { 483 } else {
483 regs->gprs[14] = (__u64) frame->retcode | PSW32_ADDR_AMODE; 484 regs->gprs[14] = (__u64) frame->retcode | PSW32_ADDR_AMODE;
484 if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn, 485 if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn,
485 (u16 __user *)(frame->retcode))) 486 (u16 __force __user *)(frame->retcode)))
486 goto give_sigsegv; 487 goto give_sigsegv;
487 } 488 }
488 489
@@ -491,12 +492,12 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
491 goto give_sigsegv; 492 goto give_sigsegv;
492 493
493 /* Set up registers for signal handler */ 494 /* Set up registers for signal handler */
494 regs->gprs[15] = (__u64) frame; 495 regs->gprs[15] = (__force __u64) frame;
495 regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */ 496 regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */
496 regs->psw.addr = (__u64) ka->sa.sa_handler; 497 regs->psw.addr = (__force __u64) ka->sa.sa_handler;
497 498
498 regs->gprs[2] = map_signal(sig); 499 regs->gprs[2] = map_signal(sig);
499 regs->gprs[3] = (__u64) &frame->sc; 500 regs->gprs[3] = (__force __u64) &frame->sc;
500 501
501 /* We forgot to include these in the sigcontext. 502 /* We forgot to include these in the sigcontext.
502 To avoid breaking binary compatibility, they are passed as args. */ 503 To avoid breaking binary compatibility, they are passed as args. */
@@ -504,7 +505,7 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
504 regs->gprs[5] = current->thread.prot_addr; 505 regs->gprs[5] = current->thread.prot_addr;
505 506
506 /* Place signal number on stack to allow backtrace from handler. */ 507 /* Place signal number on stack to allow backtrace from handler. */
507 if (__put_user(regs->gprs[2], (int __user *) &frame->signo)) 508 if (__put_user(regs->gprs[2], (int __force __user *) &frame->signo))
508 goto give_sigsegv; 509 goto give_sigsegv;
509 return 0; 510 return 0;
510 511
@@ -547,21 +548,21 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
547 } else { 548 } else {
548 regs->gprs[14] = (__u64) frame->retcode; 549 regs->gprs[14] = (__u64) frame->retcode;
549 err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn, 550 err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
550 (u16 __user *)(frame->retcode)); 551 (u16 __force __user *)(frame->retcode));
551 } 552 }
552 553
553 /* Set up backchain. */ 554 /* Set up backchain. */
554 if (__put_user(regs->gprs[15], (unsigned int __user *) frame)) 555 if (__put_user(regs->gprs[15], (unsigned int __force __user *) frame))
555 goto give_sigsegv; 556 goto give_sigsegv;
556 557
557 /* Set up registers for signal handler */ 558 /* Set up registers for signal handler */
558 regs->gprs[15] = (__u64) frame; 559 regs->gprs[15] = (__force __u64) frame;
559 regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */ 560 regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */
560 regs->psw.addr = (__u64) ka->sa.sa_handler; 561 regs->psw.addr = (__u64) ka->sa.sa_handler;
561 562
562 regs->gprs[2] = map_signal(sig); 563 regs->gprs[2] = map_signal(sig);
563 regs->gprs[3] = (__u64) &frame->info; 564 regs->gprs[3] = (__force __u64) &frame->info;
564 regs->gprs[4] = (__u64) &frame->uc; 565 regs->gprs[4] = (__force __u64) &frame->uc;
565 return 0; 566 return 0;
566 567
567give_sigsegv: 568give_sigsegv: