1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

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:
Alan Cox 1999-10-31 19:39:51 +00:00
parent 96a9a981cc
commit 0d4d02ecf2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52720
5 changed files with 10 additions and 10 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {