asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) { rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15]; sigset_t set; if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__copy_from_user(&set.sig, &frame->uc.uc_sigmask, sizeof(set))) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); if (restore_sigregs(regs, &frame->uc.uc_mcontext)) goto badframe; if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->gprs[15]) == -EFAULT) goto badframe; return regs->gprs[2]; badframe: force_sig(SIGSEGV, current); return 0; }
asmlinkage long sys_sigreturn(struct pt_regs *regs) { sigframe __user *frame = (sigframe __user *)regs->gprs[15]; sigset_t set; if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__copy_from_user(&set.sig, &frame->sc.oldmask, _SIGMASK_COPY_SIZE)) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); if (restore_sigregs(regs, &frame->sregs)) goto badframe; return regs->gprs[2]; badframe: force_sig(SIGSEGV, current); return 0; }
asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) { rt_sigframe *frame = (rt_sigframe *)regs->gprs[15]; sigset_t set; if (verify_area(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__copy_from_user(&set.sig, &frame->uc.uc_sigmask, sizeof(set))) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(¤t->sighand->siglock); current->blocked = set; recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); if (restore_sigregs(regs, &frame->uc.uc_mcontext)) goto badframe; /* It is more difficult to avoid calling this function than to call it and ignore errors. */ do_sigaltstack(&frame->uc.uc_stack, NULL, regs->gprs[15]); return regs->gprs[2]; badframe: force_sig(SIGSEGV, current); return 0; }
static SizeT restore_rt_sigframe ( ThreadState *tst, struct rt_sigframe *frame, Int *sigNo ) { if (restore_vg_sigframe(tst, &frame->vg, sigNo)) { restore_sigregs(tst, &frame->uc.uc_mcontext); } return sizeof(*frame); }
static SizeT restore_sigframe ( ThreadState *tst, struct sigframe *frame, Int *sigNo ) { if (restore_vg_sigframe(tst, &frame->vg, sigNo)) restore_sigregs(tst, frame->sc.sregs); return sizeof(*frame); }
static int restore_sigcontext(struct sigcontext *sc, pt_regs *regs, sigregs *sregs,sigset_t *set) { unsigned int err; err=restore_sigregs(regs,sregs); if(!err) err=__copy_from_user(&set->sig,&sc->oldmask,SIGMASK_COPY_SIZE); return(err); }