summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_physio.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-04-05 21:19:58 +0000
committeralc <alc@FreeBSD.org>2003-04-05 21:19:58 +0000
commitc0badd1444fc63c006a6fdf38d80d02fa22aa919 (patch)
treedaac55d85c2186dd488dd773c43109493dbf1120 /sys/kern/kern_physio.c
parent437a4f18b21c0d555d8c1d4b6949cb54aff43a03 (diff)
downloadFreeBSD-src-c0badd1444fc63c006a6fdf38d80d02fa22aa919.zip
FreeBSD-src-c0badd1444fc63c006a6fdf38d80d02fa22aa919.tar.gz
Sufficient access checks are performed by vmapbuf() that calling
useracc() is pointless. Remove the call to useracc() from physio(). Reviewed by: tegge
Diffstat (limited to 'sys/kern/kern_physio.c')
-rw-r--r--sys/kern/kern_physio.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index aebbbdb..9a28936 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -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();
OpenPOWER on IntegriCloud