Sufficient access checks are performed by vmapbuf() that calling

useracc() is pointless.  Remove the call to useracc() from physio().

Reviewed by:	tegge
This commit is contained in:
Alan Cox 2003-04-05 21:19:58 +00:00
parent 2206cb596f
commit cdb06eda66
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113141

View File

@ -88,25 +88,11 @@ physio(dev_t dev, struct uio *uio, int ioflag)
bp->b_blkno = btodb(bp->b_offset);
if (uio->uio_segflg == UIO_USERSPACE) {
/*
* Note that useracc() alone is not a
* sufficient test. vmapbuf() can still fail
* due to a smaller file mapped into a larger
* area of VM, or if userland races against
* vmapbuf() after the useracc() check.
*/
if (!useracc(bp->b_data, bp->b_bufsize,
bp->b_iocmd == BIO_READ ?
VM_PROT_WRITE : VM_PROT_READ)) {
error = EFAULT;
goto doerror;
}
if (uio->uio_segflg == UIO_USERSPACE)
if (vmapbuf(bp) < 0) {
error = EFAULT;
goto doerror;
}
}
DEV_STRATEGY(bp);
spl = splbio();