diff options
author | jmg <jmg@FreeBSD.org> | 2003-10-24 21:07:53 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2003-10-24 21:07:53 +0000 |
commit | abe50d83e61c4d36e816de10e1c6a1eae2a07df3 (patch) | |
tree | b784a25bb2ae57ad645ce339479e14b23afb260b /sys/kern/vfs_aio.c | |
parent | 7d3a70bca2bcedfcad496a2ef944e323471774b8 (diff) | |
download | FreeBSD-src-abe50d83e61c4d36e816de10e1c6a1eae2a07df3.zip FreeBSD-src-abe50d83e61c4d36e816de10e1c6a1eae2a07df3.tar.gz |
don't allow reading from files that haven't been open'd for reading.
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r-- | sys/kern/vfs_aio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index b746f47..6642fde 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1330,8 +1330,9 @@ _aio_aqueue(struct thread *td, struct aiocb *job, struct aio_liojob *lj, int typ } fp = aiocbe->fd_file = fdp->fd_ofiles[fd]; - if ((fp == NULL) || ((opcode == LIO_WRITE) && ((fp->f_flag & FWRITE) == - 0))) { + if ((fp == NULL) || + ((opcode == LIO_WRITE) && ((fp->f_flag & FWRITE) == 0)) || + ((opcode == LIO_READ) && ((fp->f_flag & FREAD) == 0))) { FILEDESC_UNLOCK(fdp); uma_zfree(aiocb_zone, aiocbe); if (type == 0) |