The useracc() calls in osigreturn() and sigreturn() should specify
VM_PROT_READ rather than VM_PROT_WRITE. (This mistake predates the B_READ/B_WRITE -> VM_PROT_READ/VM_PROT_WRITE change.) Submitted by: bde
This commit is contained in:
parent
5053068e49
commit
61bba49fd7
@ -1421,7 +1421,7 @@ osigreturn(struct proc *p,
|
||||
* Test and fetch the context structure.
|
||||
* We grab it all at once for speed.
|
||||
*/
|
||||
if (useracc((caddr_t)scp, sizeof (*scp), VM_PROT_WRITE) == 0 ||
|
||||
if (useracc((caddr_t)scp, sizeof (*scp), VM_PROT_READ) == 0 ||
|
||||
copyin((caddr_t)scp, (caddr_t)&ksc, sizeof ksc))
|
||||
return (EINVAL);
|
||||
|
||||
@ -1491,7 +1491,7 @@ sigreturn(struct proc *p,
|
||||
* Test and fetch the context structure.
|
||||
* We grab it all at once for speed.
|
||||
*/
|
||||
if (useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_WRITE) == 0 ||
|
||||
if (useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ) == 0 ||
|
||||
copyin((caddr_t)ucp, (caddr_t)&uc, sizeof(ucontext_t)))
|
||||
return (EINVAL);
|
||||
|
||||
|
@ -769,7 +769,7 @@ osigreturn(p, uap)
|
||||
|
||||
scp = uap->sigcntxp;
|
||||
|
||||
if (!useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_WRITE))
|
||||
if (!useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_READ))
|
||||
return(EFAULT);
|
||||
|
||||
eflags = scp->sc_ps;
|
||||
@ -880,7 +880,7 @@ sigreturn(p, uap)
|
||||
ucp = uap->sigcntxp;
|
||||
eflags = ucp->uc_mcontext.mc_eflags;
|
||||
|
||||
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_WRITE))
|
||||
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ))
|
||||
return(EFAULT);
|
||||
|
||||
if (eflags & PSL_VM) {
|
||||
|
@ -769,7 +769,7 @@ osigreturn(p, uap)
|
||||
|
||||
scp = uap->sigcntxp;
|
||||
|
||||
if (!useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_WRITE))
|
||||
if (!useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_READ))
|
||||
return(EFAULT);
|
||||
|
||||
eflags = scp->sc_ps;
|
||||
@ -880,7 +880,7 @@ sigreturn(p, uap)
|
||||
ucp = uap->sigcntxp;
|
||||
eflags = ucp->uc_mcontext.mc_eflags;
|
||||
|
||||
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_WRITE))
|
||||
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ))
|
||||
return(EFAULT);
|
||||
|
||||
if (eflags & PSL_VM) {
|
||||
|
@ -782,7 +782,7 @@ osigreturn(p, uap)
|
||||
|
||||
scp = uap->sigcntxp;
|
||||
|
||||
if (!useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_WRITE))
|
||||
if (!useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_READ))
|
||||
return(EFAULT);
|
||||
|
||||
eflags = scp->sc_ps;
|
||||
@ -893,7 +893,7 @@ sigreturn(p, uap)
|
||||
ucp = uap->sigcntxp;
|
||||
eflags = ucp->uc_mcontext.mc_eflags;
|
||||
|
||||
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_WRITE))
|
||||
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ))
|
||||
return(EFAULT);
|
||||
|
||||
if (eflags & PSL_VM) {
|
||||
|
@ -782,7 +782,7 @@ osigreturn(p, uap)
|
||||
|
||||
scp = uap->sigcntxp;
|
||||
|
||||
if (!useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_WRITE))
|
||||
if (!useracc((caddr_t)scp, sizeof (struct osigcontext), VM_PROT_READ))
|
||||
return(EFAULT);
|
||||
|
||||
eflags = scp->sc_ps;
|
||||
@ -893,7 +893,7 @@ sigreturn(p, uap)
|
||||
ucp = uap->sigcntxp;
|
||||
eflags = ucp->uc_mcontext.mc_eflags;
|
||||
|
||||
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_WRITE))
|
||||
if (!useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ))
|
||||
return(EFAULT);
|
||||
|
||||
if (eflags & PSL_VM) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user